getResourcePolicies method

Future<GetResourcePoliciesResponse> getResourcePolicies({
  1. int? maxResults,
  2. String? nextToken,
})

Retrieves the security configurations for the resource policies set on individual resources, and also the account-level policy.

This operation also returns the Data Catalog resource policy. However, if you enabled metadata encryption in Data Catalog settings, and you do not have permission on the AWS KMS key, the operation can't return the Data Catalog resource policy.

May throw InternalServiceException. May throw OperationTimeoutException. May throw InvalidInputException. May throw GlueEncryptionException.

Parameter maxResults : The maximum size of a list to return.

Parameter nextToken : A continuation token, if this is a continuation request.

Implementation

Future<GetResourcePoliciesResponse> getResourcePolicies({
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetResourcePolicies'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return GetResourcePoliciesResponse.fromJson(jsonResponse.body);
}