예제 #1
0
        /// <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="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(Constants.HttpPropertyNames.ResponseHeaders) ||
                    reviewSetQueryToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, reviewSetQueryToUpdate.GetType().Name)
                    });
                }
            }
            if (reviewSetQueryToUpdate.AdditionalData != null)
            {
                if (reviewSetQueryToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    reviewSetQueryToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <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));
 }
예제 #4
0
 /// <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));
 }
예제 #5
0
 /// <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));
 }
예제 #6
0
 /// <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)
 {
 }