Skip to content

get_resource_policy

get_resource_policy(
    identifier: ResourcePolicyIdentifier,
    *,
    config_overrides: Optional[MigrationHubRefactorSpacesClientConfig] = None,
) -> GetResourcePolicyResponse

Gets the resource-based permission policy that is set for the given environment.

Parameters:

Raises:

Source code in docs_src/capo_migration_hub_refactor_spaces/_services/migration_hub_refactor_spaces.py
def get_resource_policy(
    self,
    identifier: "capo_migration_hub_refactor_spaces.types.resource_policy_identifier.ResourcePolicyIdentifier",
    *,
    config_overrides: Optional[MigrationHubRefactorSpacesClientConfig] = None,
) -> "capo_migration_hub_refactor_spaces.types.get_resource_policy_response.GetResourcePolicyResponse":
    """<p>Gets the resource-based permission policy that is set for the given environment. </p>

    Args:
        identifier: <p>The Amazon Resource Name (ARN) of the resource associated with the policy. </p>

    Raises:
        capo_migration_hub_refactor_spaces.errors.access_denied_exception.AccessDeniedException: <p>The user does not have sufficient access to perform this action. </p>
        capo_migration_hub_refactor_spaces.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing the request.</p>
        capo_migration_hub_refactor_spaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist. </p>
        capo_migration_hub_refactor_spaces.errors.throttling_exception.ThrottlingException: <p>Request was denied because the request was throttled. </p>
        capo_migration_hub_refactor_spaces.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an Amazon Web Service. </p>
        capo_migration_hub_refactor_spaces.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_migration_hub_refactor_spaces.types.get_resource_policy_request.GetResourcePolicyRequest]",
    ) -> OperationResponse[
        "capo_migration_hub_refactor_spaces.types.get_resource_policy_response.GetResourcePolicyResponse"
    ]:
        import capo_migration_hub_refactor_spaces._operations.refactor_spaces.get_resource_policy

        output, http_response = (
            capo_migration_hub_refactor_spaces._operations.refactor_spaces.get_resource_policy.get_resource_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetResourcePolicy")
    )
    input_: capo_migration_hub_refactor_spaces.types.get_resource_policy_request.GetResourcePolicyRequest = {
        "identifier": identifier
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output