Box.V2.Managers.BoxFilesManager.UpdateInformationAsync C# (CSharp) Метод

UpdateInformationAsync() публичный Метод

Used to update individual or multiple fields in the file object, including renaming the file, changing it’s description, and creating a shared link for the file. To move a file, change the ID of its parent folder. An optional etag can be included to ensure that client only updates the file if it knows about the latest version.
public UpdateInformationAsync ( Box.V2.Models.BoxFileRequest fileRequest, string etag = null, List fields = null ) : Task
fileRequest Box.V2.Models.BoxFileRequest BoxFileRequest object.
etag string This ‘etag’ field of the file, which will be set in the If-Match header.
fields List Attribute(s) to include in the response.
Результат Task
        public async Task<BoxFile> UpdateInformationAsync(BoxFileRequest fileRequest, string etag = null, List<string> fields = null)
        {
            fileRequest.ThrowIfNull("fileRequest")
                .Id.ThrowIfNullOrWhiteSpace("fileRequest.Id");

            BoxRequest request = new BoxRequest(_config.FilesEndpointUri, fileRequest.Id)
                .Method(RequestMethod.Put)
                .Header(Constants.RequestParameters.IfMatch, etag)
                .Param(ParamFields, fields);

            request.Payload = _converter.Serialize(fileRequest);

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

            return response.ResponseObject;
        }