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.
Parameters:
-
principal
(Optional[Principal], default:
None
)
–
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).
-
cognito_identity_pool_id
(Optional[CognitoIdentityPoolId], default:
None
)
–
The Cognito identity pool ID.
-
thing_name
(Optional[ThingName], default:
None
)
–
Raises:
Source code in docs_src/capo_iot/_services/io_t.py
| def get_effective_policies(
self,
*,
config_overrides: Optional[IoTClientConfig] = None,
principal: Optional["capo_iot.types.principal.Principal"] = None,
cognito_identity_pool_id: Optional[
"capo_iot.types.cognito_identity_pool_id.CognitoIdentityPoolId"
] = None,
thing_name: Optional["capo_iot.types.thing_name.ThingName"] = None,
) -> "capo_iot.types.get_effective_policies_response.GetEffectivePoliciesResponse":
"""<p>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.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">GetEffectivePolicies</a> action.</p>
Args:
principal: <p>The principal. Valid principals are CertificateArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:cert/<i>certificateId</i>), thingGroupArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:thinggroup/<i>groupName</i>) and CognitoId (<i>region</i>:<i>id</i>).</p>
cognito_identity_pool_id: <p>The Cognito identity pool ID.</p>
thing_name: <p>The thing name.</p>
Raises:
capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
capo_iot.errors.limit_exceeded_exception.LimitExceededException: <p>A limit has been exceeded.</p>
capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
capo_iot.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iot.types.get_effective_policies_request.GetEffectivePoliciesRequest]",
) -> OperationResponse[
"capo_iot.types.get_effective_policies_response.GetEffectivePoliciesResponse"
]:
import capo_iot._operations.aws_iot_service.get_effective_policies
output, http_response = (
capo_iot._operations.aws_iot_service.get_effective_policies.get_effective_policies(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetEffectivePolicies")
)
input_: capo_iot.types.get_effective_policies_request.GetEffectivePoliciesRequest = {}
if principal is not None:
input_["principal"] = principal
if cognito_identity_pool_id is not None:
input_["cognito_identity_pool_id"] = cognito_identity_pool_id
if thing_name is not None:
input_["thing_name"] = thing_name
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|