putInlinePolicyToPermissionSet method
Attaches an IAM inline policy to a permission set.
May throw ResourceNotFoundException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException. May throw AccessDeniedException. May throw ConflictException.
Parameter inlinePolicy
:
The IAM inline policy to attach to a PermissionSet.
Parameter instanceArn
:
The ARN of the SSO instance under which the operation will be executed.
For more information about ARNs, see Amazon Resource
Names (ARNs) and AWS Service Namespaces in the AWS General
Reference.
Parameter permissionSetArn
:
The ARN of the permission set.
Implementation
Future<void> putInlinePolicyToPermissionSet({
required String inlinePolicy,
required String instanceArn,
required String permissionSetArn,
}) async {
ArgumentError.checkNotNull(inlinePolicy, 'inlinePolicy');
_s.validateStringLength(
'inlinePolicy',
inlinePolicy,
1,
10240,
isRequired: true,
);
ArgumentError.checkNotNull(instanceArn, 'instanceArn');
_s.validateStringLength(
'instanceArn',
instanceArn,
10,
1224,
isRequired: true,
);
ArgumentError.checkNotNull(permissionSetArn, 'permissionSetArn');
_s.validateStringLength(
'permissionSetArn',
permissionSetArn,
10,
1224,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SWBExternalService.PutInlinePolicyToPermissionSet'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InlinePolicy': inlinePolicy,
'InstanceArn': instanceArn,
'PermissionSetArn': permissionSetArn,
},
);
}