getEffectivePolicies method
Gets a list of the policies that have an effect on the authorization behavior of the specified device when it connects to the IoT device gateway.
Requires permission to access the GetEffectivePolicies action.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw UnauthorizedException.
Parameter cognitoIdentityPoolId :
The Cognito identity pool ID.
Parameter principal :
The principal. Valid principals are CertificateArn
(arn:aws:iot:region:accountId:cert/certificateId),
thingGroupArn
(arn:aws:iot:region:accountId:thinggroup/groupName)
and CognitoId (region:id).
Parameter thingName :
The thing name.
Implementation
Future<GetEffectivePoliciesResponse> getEffectivePolicies({
String? cognitoIdentityPoolId,
String? principal,
String? thingName,
}) async {
final $query = <String, List<String>>{
if (thingName != null) 'thingName': [thingName],
};
final $payload = <String, dynamic>{
if (cognitoIdentityPoolId != null)
'cognitoIdentityPoolId': cognitoIdentityPoolId,
if (principal != null) 'principal': principal,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/effective-policies',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return GetEffectivePoliciesResponse.fromJson(response);
}