getGroupPolicy method

Future<GetGroupPolicyResponse> getGroupPolicy({
  1. required String groupName,
  2. required String policyName,
})

Retrieves the specified inline policy document that is embedded in the specified IAM group. An IAM group can also have managed policies attached to it. To retrieve a managed policy document that is attached to a group, use GetPolicy to determine the policy's default version, then use GetPolicyVersion to retrieve the policy document.

For more information about policies, see Managed Policies and Inline Policies in the IAM User Guide.

May throw NoSuchEntityException. May throw ServiceFailureException.

Parameter groupName : The name of the group the policy is associated with.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Parameter policyName : The name of the policy document to get.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Implementation

Future<GetGroupPolicyResponse> getGroupPolicy({
  required String groupName,
  required String policyName,
}) async {
  ArgumentError.checkNotNull(groupName, 'groupName');
  _s.validateStringLength(
    'groupName',
    groupName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(policyName, 'policyName');
  _s.validateStringLength(
    'policyName',
    policyName,
    1,
    128,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['GroupName'] = groupName;
  $request['PolicyName'] = policyName;
  final $result = await _protocol.send(
    $request,
    action: 'GetGroupPolicy',
    version: '2010-05-08',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['GetGroupPolicyRequest'],
    shapes: shapes,
    resultWrapper: 'GetGroupPolicyResult',
  );
  return GetGroupPolicyResponse.fromXml($result);
}