Skip to content

describe_resource_policy async

describe_resource_policy(
    resource_arn: ComprehendModelArn,
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = 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/async_comprehend.py
async def describe_resource_policy(
    self,
    resource_arn: "capo_comprehend.types.comprehend_model_arn.ComprehendModelArn",
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = 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.
    """

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

        (
            output,
            http_response,
        ) = await capo_comprehend._operations.comprehend_20171127.describe_resource_policy.async_describe_resource_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output