getEffectivePolicies method

Future<GetEffectivePoliciesResponse> getEffectivePolicies({
  1. String? cognitoIdentityPoolId,
  2. String? principal,
  3. String? thingName,
})

Gets a list of the policies that have an effect on the authorization behavior of the specified device when it connects to the AWS IoT device gateway.

May throw ResourceNotFoundException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException. May throw LimitExceededException.

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 {
  _s.validateStringLength(
    'thingName',
    thingName,
    1,
    128,
  );
  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);
}