batchGet method

Future<BatchGetEffectiveIamPoliciesResponse> batchGet(
  1. String scope, {
  2. List<String>? names,
  3. String? $fields,
})

Gets effective IAM policies for a batch of resources.

Request parameters:

scope - Required. Only IAM policies on or below the scope will be returned. This can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"). To know how to get organization ID, visit here . To know how to get folder or project ID, visit here . Value must have pattern ^\[^/\]+/\[^/\]+$.

names - Required. The names refer to the full_resource_names of the asset types supported by search APIs. A maximum of 20 resources' effective policies can be retrieved in a batch.

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

Completes with a BatchGetEffectiveIamPoliciesResponse.

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<BatchGetEffectiveIamPoliciesResponse> batchGet(
  core.String scope, {
  core.List<core.String>? names,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (names != null) 'names': names,
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' +
      core.Uri.encodeFull('$scope') +
      '/effectiveIamPolicies:batchGet';

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