Box.V2.Managers.BoxCommentsManager.UpdateAsync C# (CSharp) Method

UpdateAsync() public method

Used to update the message of the comment.
public UpdateAsync ( string id, BoxCommentRequest commentsRequest, List fields = null ) : Task
id string Id of the comment.
commentsRequest Box.V2.Models.BoxCommentRequest BoxCommentsRequest object.
fields List Attribute(s) to include in the response.
return Task
        public async Task<BoxComment> UpdateAsync(string id, BoxCommentRequest commentsRequest, List<string> fields = null)
        {
            id.ThrowIfNullOrWhiteSpace("id");
            commentsRequest.ThrowIfNull("commentsRequest")
                .Message.ThrowIfNullOrWhiteSpace("commentsRequest.Message");

            BoxRequest request = new BoxRequest(_config.CommentsEndpointUri, id)
                .Method(RequestMethod.Put)
                .Param(ParamFields, fields)
                .Payload(_converter.Serialize(commentsRequest));

            IBoxResponse<BoxComment> response = await ToResponseAsync<BoxComment>(request).ConfigureAwait(false);

            return response.ResponseObject;
        }