describeApplicationAssignment method
Retrieves a direct assignment of a user or group to an application. If the user doesn’t have a direct assignment to the application, the user may still have access to the application through a group. Therefore, don’t use this API to test access to an application for a user. Instead use ListApplicationAssignmentsForPrincipal.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter applicationArn :
Specifies the ARN of the application. For more information about ARNs, see
Amazon Resource
Names (ARNs) and Amazon Web Services Service Namespaces in the
Amazon Web Services General Reference.
Parameter principalId :
An identifier for an object in IAM Identity Center, such as a user or
group. PrincipalIds are GUIDs (For example,
f81d4fae-7dec-11d0-a765-00a0c91e6bf6). For more information about
PrincipalIds in IAM Identity Center, see the IAM
Identity Center Identity Store API Reference.
Parameter principalType :
The entity type for which the assignment will be created.
Implementation
Future<DescribeApplicationAssignmentResponse> describeApplicationAssignment({
required String applicationArn,
required String principalId,
required PrincipalType principalType,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SWBExternalService.DescribeApplicationAssignment'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ApplicationArn': applicationArn,
'PrincipalId': principalId,
'PrincipalType': principalType.value,
},
);
return DescribeApplicationAssignmentResponse.fromJson(jsonResponse.body);
}