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