associatePermission method
Adds or updates a permission policy for a Amazon Q Business application, allowing cross-account access for an ISV. This operation creates a new policy statement for the specified Amazon Q Business application. The policy statement defines the IAM actions that the ISV is allowed to perform on the Amazon Q Business application's resources.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter actions :
The list of Amazon Q Business actions that the ISV is allowed to perform.
Parameter applicationId :
The unique identifier of the Amazon Q Business application.
Parameter principal :
The Amazon Resource Name of the IAM role for the ISV that is being granted
permission.
Parameter statementId :
A unique identifier for the policy statement.
Parameter conditions :
The conditions that restrict when the permission is effective. These
conditions can be used to limit the permission based on specific
attributes of the request.
Implementation
Future<AssociatePermissionResponse> associatePermission({
required List<String> actions,
required String applicationId,
required String principal,
required String statementId,
List<PermissionCondition>? conditions,
}) async {
final $payload = <String, dynamic>{
'actions': actions,
'principal': principal,
'statementId': statementId,
if (conditions != null) 'conditions': conditions,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/applications/${Uri.encodeComponent(applicationId)}/policy',
exceptionFnMap: _exceptionFns,
);
return AssociatePermissionResponse.fromJson(response);
}