get method

Future<Folder> get(
  1. String bucket,
  2. String folder, {
  3. String? ifMetagenerationMatch,
  4. String? ifMetagenerationNotMatch,
  5. String? $fields,
})

Returns metadata for the specified folder.

Only applicable to buckets with hierarchical namespace enabled.

Request parameters:

bucket - Name of the bucket in which the folder resides.

folder - Name of a folder.

ifMetagenerationMatch - Makes the return of the folder metadata conditional on whether the folder's current metageneration matches the given value.

ifMetagenerationNotMatch - Makes the return of the folder metadata conditional on whether the folder's current metageneration does not match the given value.

$fields - Selector specifying which fields to include in a partial response.

Completes with a Folder.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<Folder> get(
  core.String bucket,
  core.String folder, {
  core.String? ifMetagenerationMatch,
  core.String? ifMetagenerationNotMatch,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (ifMetagenerationMatch != null)
      'ifMetagenerationMatch': [ifMetagenerationMatch],
    if (ifMetagenerationNotMatch != null)
      'ifMetagenerationNotMatch': [ifMetagenerationNotMatch],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'b/' +
      commons.escapeVariable('$bucket') +
      '/folders/' +
      commons.escapeVariable('$folder');

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return Folder.fromJson(response_ as core.Map<core.String, core.dynamic>);
}