listPolicies method

Future<GoogleIamV2ListPoliciesResponse> listPolicies(
  1. String parent, {
  2. int? pageSize,
  3. String? pageToken,
  4. String? $fields,
})

Retrieves the policies of the specified kind that are attached to a resource.

The response lists only policy metadata. In particular, policy rules are omitted.

Request parameters:

parent - Required. The resource that the policy is attached to, along with the kind of policy to list. Format: policies/{attachment_point}/denypolicies The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies. For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID. Value must have pattern ^policies/\[^/\]+/\[^/\]+$.

pageSize - The maximum number of policies to return. IAM ignores this value and uses the value 1000.

pageToken - A page token received in a ListPoliciesResponse. Provide this token to retrieve the next page.

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

Completes with a GoogleIamV2ListPoliciesResponse.

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<GoogleIamV2ListPoliciesResponse> listPolicies(
  core.String parent, {
  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_ = 'v2/' + core.Uri.encodeFull('$parent');

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