Deletes a resource-based policy that is attached to a custom model.
Parameters:
-
resource_arn
(ComprehendModelArn)
–
The Amazon Resource Name (ARN) of the custom model version that has the policy to delete.
-
policy_revision_id
(Optional[PolicyRevisionId], default:
None
)
–
The revision ID of the policy to delete.
Raises:
Source code in docs_src/capo_comprehend/_services/comprehend.py
| def delete_resource_policy(
self,
resource_arn: "capo_comprehend.types.comprehend_model_arn.ComprehendModelArn",
*,
config_overrides: Optional[ComprehendClientConfig] = None,
policy_revision_id: Optional[
"capo_comprehend.types.policy_revision_id.PolicyRevisionId"
] = None,
) -> "capo_comprehend.types.delete_resource_policy_response.DeleteResourcePolicyResponse":
"""<p>Deletes a resource-based policy that is attached to a custom model.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the custom model version that has the policy to delete.</p>
policy_revision_id: <p>The revision ID of the policy to delete.</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.delete_resource_policy_request.DeleteResourcePolicyRequest]",
) -> OperationResponse[
"capo_comprehend.types.delete_resource_policy_response.DeleteResourcePolicyResponse"
]:
import capo_comprehend._operations.comprehend_20171127.delete_resource_policy
output, http_response = (
capo_comprehend._operations.comprehend_20171127.delete_resource_policy.delete_resource_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteResourcePolicy")
)
input_: capo_comprehend.types.delete_resource_policy_request.DeleteResourcePolicyRequest = {
"resource_arn": resource_arn
}
if policy_revision_id is not None:
input_["policy_revision_id"] = policy_revision_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|