describePolicy method

Future<DescribePolicyResponse> describePolicy({
  1. required String policyId,
})

Retrieves information about a policy.

You can only call this operation from the management account or a member account that is a delegated administrator.

May throw AccessDeniedException. May throw AWSOrganizationsNotInUseException. May throw InvalidInputException. May throw PolicyNotFoundException. May throw ServiceException. May throw TooManyRequestsException. May throw UnsupportedAPIEndpointException.

Parameter policyId : ID for the policy that you want details about. You can get the ID from the ListPolicies or ListPoliciesForTarget operations.

The regex pattern for a policy ID string requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, or the underscore character (_).

Implementation

Future<DescribePolicyResponse> describePolicy({
  required String policyId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSOrganizationsV20161128.DescribePolicy'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'PolicyId': policyId,
    },
  );

  return DescribePolicyResponse.fromJson(jsonResponse.body);
}