Box.V2.Managers.BoxFoldersManager.DeleteAsync C# (CSharp) Метод

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

Used to delete a folder. A recursive parameter must be included in order to delete folders that have items inside of them. An optional If-Match header can be included using the etag parameter to ensure that client only deletes the folder if it knows about the latest version.
public DeleteAsync ( string id, bool recursive = false, string etag = null ) : Task
id string Id of the folder
recursive bool Whether to delete this folder if it has items inside of it.
etag string This ‘etag’ field of the folder object to set in the If-Match header
Результат Task
        public async Task<bool> DeleteAsync(string id, bool recursive = false, string etag = null)
        {
            id.ThrowIfNullOrWhiteSpace("id");

            BoxRequest request = new BoxRequest(_config.FoldersEndpointUri, id)
                .Method(RequestMethod.Delete)
                .Header(Constants.RequestParameters.IfMatch, etag)
                .Param("recursive", recursive.ToString().ToLowerInvariant());

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

            return response.Status == ResponseStatus.Success;
        }