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.
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.String? userProject,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'project': [project],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if (prefix != null) 'prefix': [prefix],
if (projection != null) 'projection': [projection],
if (userProject != null) 'userProject': [userProject],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'b';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Buckets.fromJson(response_ as core.Map<core.String, core.dynamic>);
}