コード例 #1
0
        /// <summary>
        /// Updates the specified DocumentCommentReply using PATCH.
        /// </summary>
        /// <param name="documentCommentReplyToUpdate">The DocumentCommentReply 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 DocumentCommentReply.</returns>
        public async System.Threading.Tasks.Task <DocumentCommentReply> UpdateAsync(DocumentCommentReply documentCommentReplyToUpdate, CancellationToken cancellationToken)
        {
            if (documentCommentReplyToUpdate.AdditionalData != null)
            {
                if (documentCommentReplyToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    documentCommentReplyToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, documentCommentReplyToUpdate.GetType().Name)
                    });
                }
            }
            if (documentCommentReplyToUpdate.AdditionalData != null)
            {
                if (documentCommentReplyToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    documentCommentReplyToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, documentCommentReplyToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <DocumentCommentReply>(documentCommentReplyToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
コード例 #2
0
        /// <summary>
        /// Creates the specified DocumentCommentReply using POST.
        /// </summary>
        /// <param name="documentCommentReplyToCreate">The DocumentCommentReply to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created DocumentCommentReply.</returns>
        public async System.Threading.Tasks.Task <DocumentCommentReply> CreateAsync(DocumentCommentReply documentCommentReplyToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <DocumentCommentReply>(documentCommentReplyToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
コード例 #3
0
 /// <summary>
 /// Creates the specified DocumentCommentReply using POST.
 /// </summary>
 /// <param name="documentCommentReplyToCreate">The DocumentCommentReply to create.</param>
 /// <returns>The created DocumentCommentReply.</returns>
 public System.Threading.Tasks.Task <DocumentCommentReply> CreateAsync(DocumentCommentReply documentCommentReplyToCreate)
 {
     return(this.CreateAsync(documentCommentReplyToCreate, CancellationToken.None));
 }
コード例 #4
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="documentCommentReplyToInitialize">The <see cref="DocumentCommentReply"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(DocumentCommentReply documentCommentReplyToInitialize)
 {
 }
コード例 #5
0
 /// <summary>
 /// Adds the specified DocumentCommentReply to the collection via POST.
 /// </summary>
 /// <param name="documentCommentReply">The DocumentCommentReply to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created DocumentCommentReply.</returns>
 public System.Threading.Tasks.Task <DocumentCommentReply> AddAsync(DocumentCommentReply documentCommentReply, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <DocumentCommentReply>(documentCommentReply, cancellationToken));
 }
コード例 #6
0
 /// <summary>
 /// Adds the specified DocumentCommentReply to the collection via POST.
 /// </summary>
 /// <param name="documentCommentReply">The DocumentCommentReply to add.</param>
 /// <returns>The created DocumentCommentReply.</returns>
 public System.Threading.Tasks.Task <DocumentCommentReply> AddAsync(DocumentCommentReply documentCommentReply)
 {
     return(this.AddAsync(documentCommentReply, CancellationToken.None));
 }