analyzeOrgPolicies method

Future<AnalyzeOrgPoliciesResponse> analyzeOrgPolicies(
  1. String scope, {
  2. String? constraint,
  3. String? filter,
  4. int? pageSize,
  5. String? pageToken,
  6. String? $fields,
})

Analyzes organization policies under a scope.

Request parameters:

scope - Required. The organization to scope the request. Only organization policies within the scope will be analyzed. * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") Value must have pattern ^\[^/\]+/\[^/\]+$.

constraint - Required. The name of the constraint to analyze organization policies for. The response only contains analyzed organization policies for the provided constraint.

filter - The expression to filter AnalyzeOrgPoliciesResponse.org_policy_results. Filtering is currently available for bare literal values and the following fields: * consolidated_policy.attached_resource * consolidated_policy.rules.enforce When filtering by a specific field, the only supported operator is =. For example, filtering by consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" will return all the Organization Policy results attached to "folders/001".

pageSize - The maximum number of items to return per page. If unspecified, AnalyzeOrgPoliciesResponse.org_policy_results will contain 20 items with a maximum of 200.

pageToken - The pagination token to retrieve the next page.

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

Completes with a AnalyzeOrgPoliciesResponse.

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<AnalyzeOrgPoliciesResponse> analyzeOrgPolicies(
  core.String scope, {
  core.String? constraint,
  core.String? filter,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (constraint != null) 'constraint': [constraint],
    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('$scope') + ':analyzeOrgPolicies';

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