list method
Lists all access levels for an access policy.
Request parameters:
parent
- Required. Resource name for the access policy to list Access
Levels from. Format: accessPolicies/{policy_id}
Value must have pattern ^accessPolicies/\[^/\]+$
.
accessLevelFormat
- Whether to return BasicLevels
in the Cloud Common
Expression language, as CustomLevels
, rather than as BasicLevels
.
Defaults to returning AccessLevels
in the format they were defined.
Possible string values are:
- "LEVEL_FORMAT_UNSPECIFIED" : The format was not specified.
- "AS_DEFINED" : Uses the format the resource was defined in. BasicLevels are returned as BasicLevels, CustomLevels are returned as CustomLevels.
- "CEL" : Use Cloud Common Expression Language when returning the resource. Both BasicLevels and CustomLevels are returned as CustomLevels.
pageSize
- Number of Access Levels to include in the list. Default 100.
pageToken
- Next page token for the next batch of Access Level
instances. Defaults to the first page of results.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListAccessLevelsResponse.
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<ListAccessLevelsResponse> list(
core.String parent, {
core.String? accessLevelFormat,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (accessLevelFormat != null) 'accessLevelFormat': [accessLevelFormat],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/accessLevels';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListAccessLevelsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}