list method
List Policies
Request parameters:
filter
- Optional. A CEL expression for filtering the results. Policies
can be filtered by application with this expression:
setting.type.matches('^settings/gmail\..$') Policies can be filtered by
setting type with this expression:
setting.type.matches('^.\.service_status$') A maximum of one of the
above setting.type clauses can be used. Policies can be filtered by
customer with this expression: customer == "customers/{customer}" Where
customer
is the id
from the [Admin SDK Customer
resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers).
You may use customers/my_customer
to specify your own organization. When
no customer is mentioned it will be default to customers/my_customer. A
maximum of one customer clause can be used. The above clauses can only be
combined together in a single filter expression with the &&
operator.
pageSize
- Optional. The maximum number of results to return. The
service can return fewer than this number. If omitted or set to 0, the
default is 50 results per page. The maximum allowed value is 100.
page_size
values greater than 100 default to 100.
pageToken
- Optional. The pagination token received from a prior call to
PoliciesService.ListPolicies to retrieve the next page of results. When
paginating, all other parameters provided to ListPoliciesRequest
must
match the call that provided the page token.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListPoliciesResponse.
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<ListPoliciesResponse> list({
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'v1/policies';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListPoliciesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}