list method
Retrieves a list of HMAC keys matching the criteria.
Request parameters:
projectId
- Name of the project in which to look for HMAC keys.
maxResults
- Maximum number of items to return in a single page of
responses. The service uses this parameter or 250 items, whichever is
smaller. The max number of items per page will also be limited by the
number of distinct service accounts in the response. If the number of
service accounts in a single response is too high, the page will truncated
and a next page token will be returned.
pageToken
- A previously-returned page token representing part of the
larger set of results to view.
serviceAccountEmail
- If present, only keys for the given service
account are returned.
showDeletedKeys
- Whether or not to show keys in the DELETED state.
userProject
- The project to be billed for this request.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a HmacKeysMetadata.
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<HmacKeysMetadata> list(
core.String projectId, {
core.int? maxResults,
core.String? pageToken,
core.String? serviceAccountEmail,
core.bool? showDeletedKeys,
core.String? userProject,
core.String? $fields,
}) async {
final _queryParams = <core.String, core.List<core.String>>{
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if (serviceAccountEmail != null)
'serviceAccountEmail': [serviceAccountEmail],
if (showDeletedKeys != null) 'showDeletedKeys': ['${showDeletedKeys}'],
if (userProject != null) 'userProject': [userProject],
if ($fields != null) 'fields': [$fields],
};
final _url =
'projects/' + commons.escapeVariable('$projectId') + '/hmacKeys';
final _response = await _requester.request(
_url,
'GET',
queryParams: _queryParams,
);
return HmacKeysMetadata.fromJson(
_response as core.Map<core.String, core.dynamic>);
}