list method

Future<ListDataPoliciesResponse> list(
  1. String parent, {
  2. String? filter,
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

List all of the data policies in the specified parent project.

Request parameters:

parent - Required. Resource name of the project for which to list data policies. Format is projects/{project_number}/locations/{location_id}. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

filter - Filters the data policies by policy tags that they are associated with. Currently filter only supports "policy_tag" based filtering and OR based predicates. Sample filter can be "policy_tag: projects/1/locations/us/taxonomies/2/policyTags/3". You may also use wildcard such as "policy_tag: projects/1/locations/us/taxonomies/2*". Please note that OR predicates cannot be used with wildcard filters.

pageSize - The maximum number of data policies to return. Must be a value between 1 and 1000. If not set, defaults to 50.

pageToken - The nextPageToken value returned from a previous list request, if any. If not set, defaults to an empty string.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListDataPoliciesResponse.

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<ListDataPoliciesResponse> list(
  core.String parent, {
  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],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/dataPolicies';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListDataPoliciesResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}