list method
Retrieves a list of buckets for a given project.
Request parameters:
project - A valid API project identifier.
maxResults - Maximum number of buckets to return in a single response.
The service will use this parameter or 1,000 items, whichever is smaller.
pageToken - A previously-returned page token representing part of the
larger set of results to view.
prefix - Filter results to buckets whose names begin with this prefix.
projection - Set of properties to return. Defaults to noAcl.
Possible string values are:
- "full" : Include all properties.
- "noAcl" : Omit owner, acl and defaultObjectAcl properties.
returnPartialSuccess - If true, return a list of bucket resource names
for buckets that are in unreachable locations.
softDeleted - If true, only soft-deleted bucket versions will be
returned. The default is false. For more information, see
Soft Delete.
userProject - The project to be billed for this request.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a Buckets.
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<Buckets> list(
core.String project, {
core.int? maxResults,
core.String? pageToken,
core.String? prefix,
core.String? projection,
core.bool? returnPartialSuccess,
core.bool? softDeleted,
core.String? userProject,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'project': [project],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'prefix': ?prefix == null ? null : [prefix],
'projection': ?projection == null ? null : [projection],
'returnPartialSuccess': ?returnPartialSuccess == null
? null
: ['${returnPartialSuccess}'],
'softDeleted': ?softDeleted == null ? null : ['${softDeleted}'],
'userProject': ?userProject == null ? null : [userProject],
'fields': ?$fields == null ? null : [$fields],
};
const url_ = 'b';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Buckets.fromJson(response_ as core.Map<core.String, core.dynamic>);
}