Skip to content

describe_resource_policy

describe_resource_policy(
    resource_arn: ComprehendModelArn,
    *,
    config_overrides: Optional[ComprehendClientConfig] = None,
) -> DescribeResourcePolicyResponse

Gets the details of a resource-based policy that is attached to a custom model, including the JSON body of the policy.

Parameters:

  • resource_arn (ComprehendModelArn) –

    The Amazon Resource Name (ARN) of the custom model version that has the resource policy.

Raises:

Source code in docs_src/capo_comprehend/_services/comprehend.py
def describe_resource_policy(
    self,
    resource_arn: "capo_comprehend.types.comprehend_model_arn.ComprehendModelArn",
    *,
    config_overrides: Optional[ComprehendClientConfig] = None,
) -> "capo_comprehend.types.describe_resource_policy_response.DescribeResourcePolicyResponse":
    """<p>Gets the details of a resource-based policy that is attached to a custom model, including the JSON body of the policy.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the custom model version that has the resource policy.</p>

    Raises:
        capo_comprehend.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_comprehend.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_comprehend.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
        capo_comprehend.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_comprehend.types.describe_resource_policy_request.DescribeResourcePolicyRequest]",
    ) -> OperationResponse[
        "capo_comprehend.types.describe_resource_policy_response.DescribeResourcePolicyResponse"
    ]:
        import capo_comprehend._operations.comprehend_20171127.describe_resource_policy

        output, http_response = (
            capo_comprehend._operations.comprehend_20171127.describe_resource_policy.describe_resource_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeResourcePolicy")
    )
    input_: capo_comprehend.types.describe_resource_policy_request.DescribeResourcePolicyRequest = {
        "resource_arn": resource_arn
    }

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