Box.V2.Managers.BoxFoldersManager.UpdateInformationAsync C# (CSharp) Méthode

UpdateInformationAsync() public méthode

Used to update information about the folder. To move a folder, update the ID of its parent. To enable an email address that can be used to upload files to this folder, update the folder_upload_email attribute. An optional If-Match header can be included using the etag parameter to ensure that client only updates the folder if it knows about the latest version.
public UpdateInformationAsync ( Box.V2.Models.BoxFolderRequest folderRequest, List fields = null, string etag = null ) : Task
folderRequest Box.V2.Models.BoxFolderRequest BoxFolderRequest object
fields List Attribute(s) to include in the response
etag string This ‘etag’ field of the folder object to set in the If-Match header
Résultat Task
        public async Task<BoxFolder> UpdateInformationAsync(BoxFolderRequest folderRequest, List<string> fields = null, string etag = null)
        {
            folderRequest.ThrowIfNull("folderRequest")
                .Id.ThrowIfNullOrWhiteSpace("folderRequest.Id");

            BoxRequest request = new BoxRequest(_config.FoldersEndpointUri, folderRequest.Id)
                    .Header(Constants.RequestParameters.IfMatch, etag)
                    .Param(ParamFields, fields)
                    .Payload(_converter.Serialize(folderRequest))
                    .Method(RequestMethod.Put);

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

            return response.ResponseObject;
        }