getPermissionPolicy method

Future<GetPermissionPolicyResponse> getPermissionPolicy({
  1. required String resourceArn,
})

Returns the IAM policy that is attached to the specified rule group.

You must be the owner of the rule group to perform this operation.

May throw WAFNonexistentItemException. May throw WAFInternalErrorException. May throw WAFInvalidParameterException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the rule group for which you want to get the policy.

Implementation

Future<GetPermissionPolicyResponse> getPermissionPolicy({
  required String resourceArn,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    20,
    2048,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSWAF_20190729.GetPermissionPolicy'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
    },
  );

  return GetPermissionPolicyResponse.fromJson(jsonResponse.body);
}