Beispiel #1
0
        /// <summary>
        /// Creates the specified AddToReviewSetOperation using POST.
        /// </summary>
        /// <param name="addToReviewSetOperationToCreate">The AddToReviewSetOperation to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created AddToReviewSetOperation.</returns>
        public async System.Threading.Tasks.Task <AddToReviewSetOperation> CreateAsync(AddToReviewSetOperation addToReviewSetOperationToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <AddToReviewSetOperation>(addToReviewSetOperationToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="addToReviewSetOperationToInitialize">The <see cref="AddToReviewSetOperation"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(AddToReviewSetOperation addToReviewSetOperationToInitialize)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Creates the specified AddToReviewSetOperation using POST.
 /// </summary>
 /// <param name="addToReviewSetOperationToCreate">The AddToReviewSetOperation to create.</param>
 /// <returns>The created AddToReviewSetOperation.</returns>
 public System.Threading.Tasks.Task <AddToReviewSetOperation> CreateAsync(AddToReviewSetOperation addToReviewSetOperationToCreate)
 {
     return(this.CreateAsync(addToReviewSetOperationToCreate, CancellationToken.None));
 }
Beispiel #4
0
        /// <summary>
        /// Updates the specified AddToReviewSetOperation using PATCH.
        /// </summary>
        /// <param name="addToReviewSetOperationToUpdate">The AddToReviewSetOperation 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 AddToReviewSetOperation.</returns>
        public async System.Threading.Tasks.Task <AddToReviewSetOperation> UpdateAsync(AddToReviewSetOperation addToReviewSetOperationToUpdate, CancellationToken cancellationToken)
        {
            if (addToReviewSetOperationToUpdate.AdditionalData != null)
            {
                if (addToReviewSetOperationToUpdate.AdditionalData.ContainsKey(Microsoft.Graph.Constants.HttpPropertyNames.ResponseHeaders) ||
                    addToReviewSetOperationToUpdate.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, addToReviewSetOperationToUpdate.GetType().Name)
                    });
                }
            }
            if (addToReviewSetOperationToUpdate.AdditionalData != null)
            {
                if (addToReviewSetOperationToUpdate.AdditionalData.ContainsKey(Microsoft.Graph.Constants.HttpPropertyNames.ResponseHeaders) ||
                    addToReviewSetOperationToUpdate.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, addToReviewSetOperationToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <AddToReviewSetOperation>(addToReviewSetOperationToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }