Skip to content

put_policy async

put_policy(
    arn: VeniceGlobalArn,
    policy: PolicyDocument,
    *,
    config_overrides: Optional[AsyncEntityResolutionClientConfig] = None,
    token: Optional[PolicyToken] = None,
) -> PutPolicyOutput

Updates the resource-based policy.

Parameters:

  • arn (VeniceGlobalArn) –

    The Amazon Resource Name (ARN) of the resource for which the policy needs to be updated.

  • token (Optional[PolicyToken], default: None ) –

    A unique identifier for the current revision of the policy.

  • policy (PolicyDocument) –

    The resource-based policy.

    If you set the value of the effect parameter in the policy to Deny for the PutPolicy operation, you must also set the value of the effect parameter to Deny for the AddPolicyStatement operation.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request couldn't be processed because of conflict in the current state of the resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.

  • InternalServerException –

    This exception occurs when there is an internal failure in the Entity Resolution service.

  • ResourceNotFoundException –

    The resource couldn't be found.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by Entity Resolution.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_entityresolution/_services/async_entity_resolution.py
async def put_policy(
    self,
    arn: "capo_entityresolution.types.venice_global_arn.VeniceGlobalArn",
    policy: "capo_entityresolution.types.policy_document.PolicyDocument",
    *,
    config_overrides: Optional[AsyncEntityResolutionClientConfig] = None,
    token: Optional["capo_entityresolution.types.policy_token.PolicyToken"] = None,
) -> "capo_entityresolution.types.put_policy_output.PutPolicyOutput":
    """<p>Updates the resource-based policy.</p>

    Args:
        arn: <p>The Amazon Resource Name (ARN) of the resource for which the policy needs to be updated.</p>
        token: <p>A unique identifier for the current revision of the policy.</p>
        policy: <p>The resource-based policy.</p> <important> <p>If you set the value of the <code>effect</code> parameter in the <code>policy</code> to <code>Deny</code> for the <code>PutPolicy</code> operation, you must also set the value of the <code>effect</code> parameter to <code>Deny</code> for the <code>AddPolicyStatement</code> operation.</p> </important>

    Raises:
        capo_entityresolution.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. </p>
        capo_entityresolution.errors.conflict_exception.ConflictException: <p>The request couldn't be processed because of conflict in the current state of the resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc. </p>
        capo_entityresolution.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Entity Resolution service. </p>
        capo_entityresolution.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource couldn't be found. </p>
        capo_entityresolution.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. </p>
        capo_entityresolution.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by Entity Resolution. </p>
        capo_entityresolution.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_entityresolution.types.put_policy_input.PutPolicyInput]",
    ) -> AsyncOperationResponse[
        "capo_entityresolution.types.put_policy_output.PutPolicyOutput"
    ]:
        import capo_entityresolution._operations.aws_venice_service.put_policy

        (
            output,
            http_response,
        ) = await capo_entityresolution._operations.aws_venice_service.put_policy.async_put_policy(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutPolicy")
    )
    input_: capo_entityresolution.types.put_policy_input.PutPolicyInput = {
        "arn": arn,
        "policy": policy,
    }
    if token is not None:
        input_["token"] = token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output