list method
Lists every ServiceAccount that belongs to a specific project.
Request parameters:
name
- Required. The resource name of the project associated with the
service accounts, such as projects/my-project-123
.
Value must have pattern ^projects/\[^/\]+$
.
pageSize
- Optional limit on the number of service accounts to include
in the response. Further accounts can subsequently be obtained by
including the ListServiceAccountsResponse.next_page_token in a subsequent
request. The default is 20, and the maximum is 100.
pageToken
- Optional pagination token returned in an earlier
ListServiceAccountsResponse.next_page_token.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListServiceAccountsResponse.
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<ListServiceAccountsResponse> list(
core.String name, {
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/serviceAccounts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListServiceAccountsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}