deleteGroupPolicy method
Deletes the specified inline policy that is embedded in the specified IAM group.
A group can also have managed policies attached to it. To detach a managed policy from a group, use DetachGroupPolicy. For more information about policies, refer to Managed Policies and Inline Policies in the IAM User Guide.
May throw NoSuchEntityException. May throw LimitExceededException. May throw ServiceFailureException.
Parameter groupName
:
The name (friendly name, not ARN) identifying the group that the policy is
embedded in.
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 identifying the policy document to delete.
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<void> deleteGroupPolicy({
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;
await _protocol.send(
$request,
action: 'DeleteGroupPolicy',
version: '2010-05-08',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['DeleteGroupPolicyRequest'],
shapes: shapes,
);
}