list method
List policies.
Request parameters:
filter - Optional. A CEL expression for filtering the results. Policies
can be filtered using the expression in the following ways: - Filter by
application: setting.type.matches('^settings/gmail\\..*$') - Filter by
setting type: setting.type.matches('^.*\\.service_status$') - Filter by
customer: 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.
You may only filter on policies for a single customer at a time. The above
clauses can be combined together in a single filter expression with the
&& and || operators, like in the following example: customer == "customers/my_customer" && ( setting.type.matches('^settings/gmail\\..*$') || setting.type.matches('^.*\\.service_status$') ).
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>>{
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$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>,
);
}