/// <summary> /// Adds the specified RoleScopeTagAutoAssignment to the collection via POST. /// </summary> /// <param name="roleScopeTagAutoAssignment">The RoleScopeTagAutoAssignment to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created RoleScopeTagAutoAssignment.</returns> public System.Threading.Tasks.Task <RoleScopeTagAutoAssignment> AddAsync(RoleScopeTagAutoAssignment roleScopeTagAutoAssignment, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; return(this.SendAsync <RoleScopeTagAutoAssignment>(roleScopeTagAutoAssignment, cancellationToken)); }
/// <summary> /// Adds the specified RoleScopeTagAutoAssignment to the collection via POST. /// </summary> /// <param name="roleScopeTagAutoAssignment">The RoleScopeTagAutoAssignment to add.</param> /// <returns>The created RoleScopeTagAutoAssignment.</returns> public System.Threading.Tasks.Task <RoleScopeTagAutoAssignment> AddAsync(RoleScopeTagAutoAssignment roleScopeTagAutoAssignment) { return(this.AddAsync(roleScopeTagAutoAssignment, CancellationToken.None)); }
/// <summary> /// Creates the specified RoleScopeTagAutoAssignment using POST. /// </summary> /// <param name="roleScopeTagAutoAssignmentToCreate">The RoleScopeTagAutoAssignment to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created RoleScopeTagAutoAssignment.</returns> public async System.Threading.Tasks.Task <RoleScopeTagAutoAssignment> CreateAsync(RoleScopeTagAutoAssignment roleScopeTagAutoAssignmentToCreate, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; var newEntity = await this.SendAsync <RoleScopeTagAutoAssignment>(roleScopeTagAutoAssignmentToCreate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(newEntity); return(newEntity); }
/// <summary> /// Creates the specified RoleScopeTagAutoAssignment using POST. /// </summary> /// <param name="roleScopeTagAutoAssignmentToCreate">The RoleScopeTagAutoAssignment to create.</param> /// <returns>The created RoleScopeTagAutoAssignment.</returns> public System.Threading.Tasks.Task <RoleScopeTagAutoAssignment> CreateAsync(RoleScopeTagAutoAssignment roleScopeTagAutoAssignmentToCreate) { return(this.CreateAsync(roleScopeTagAutoAssignmentToCreate, CancellationToken.None)); }
/// <summary> /// Initializes any collection properties after deserialization, like next requests for paging. /// </summary> /// <param name="roleScopeTagAutoAssignmentToInitialize">The <see cref="RoleScopeTagAutoAssignment"/> with the collection properties to initialize.</param> private void InitializeCollectionProperties(RoleScopeTagAutoAssignment roleScopeTagAutoAssignmentToInitialize) { }
/// <summary> /// Updates the specified RoleScopeTagAutoAssignment using PATCH. /// </summary> /// <param name="roleScopeTagAutoAssignmentToUpdate">The RoleScopeTagAutoAssignment to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception> /// <returns>The updated RoleScopeTagAutoAssignment.</returns> public async System.Threading.Tasks.Task <RoleScopeTagAutoAssignment> UpdateAsync(RoleScopeTagAutoAssignment roleScopeTagAutoAssignmentToUpdate, CancellationToken cancellationToken) { if (roleScopeTagAutoAssignmentToUpdate.AdditionalData != null) { if (roleScopeTagAutoAssignmentToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || roleScopeTagAutoAssignmentToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, roleScopeTagAutoAssignmentToUpdate.GetType().Name) }); } } if (roleScopeTagAutoAssignmentToUpdate.AdditionalData != null) { if (roleScopeTagAutoAssignmentToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || roleScopeTagAutoAssignmentToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, roleScopeTagAutoAssignmentToUpdate.GetType().Name) }); } } this.ContentType = "application/json"; this.Method = "PATCH"; var updatedEntity = await this.SendAsync <RoleScopeTagAutoAssignment>(roleScopeTagAutoAssignmentToUpdate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(updatedEntity); return(updatedEntity); }