Skip to content

reject_curation_proposal

reject_curation_proposal(
    curation_proposal_id: CurationProposalId,
    agent_context_id: AgentContextIdentifier,
    revision_id: CurationProposalRevision,
    *,
    config_overrides: Optional[ContextClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> RejectCurationProposalResponse

Rejects a curation proposal. Its change is not applied to the agent context.

Parameters:

  • curation_proposal_id (CurationProposalId) –

    The ID of the proposal to reject.

  • agent_context_id (AgentContextIdentifier) –

    The agent context that the proposal belongs to, by its ID or ARN. If the proposal belongs to another agent context, the request fails with ResourceNotFoundException.

  • revision_id (CurationProposalRevision) –

    The revisionId the curator observed. A mismatch means a stale view.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to make the request idempotent. For 8 hours, a retry with the same token returns the rejected proposal, and the same token used with another proposal returns a ValidationException.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.

  • InternalServerException –

    The request failed because of an internal error. Retry the request.

  • ThrottlingException –

    The request was denied because it exceeded a request rate quota. Wait, then retry the request.

  • ValidationException –

    The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.

  • ConflictException –

    The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.

  • ResourceNotFoundException –

    The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.

  • UnknownServiceError –

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

Examples:

Reject a curation proposal The following example rejects a curation proposal that is waiting for review, so AWS Context doesn't apply its change set to the agent context.

>>> client.reject_curation_proposal(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', curation_proposal_id='cp-1331654b3cbad6b265e09a4588a4e32f', revision_id='c4e6a8b0-2d1f-4a3c-9e5b-7d9f1b3a5c7e', client_token='8a1c3e5b-7d9f-4b2d-a6c8-0e2f4a6b8d1c')
Source code in docs_src/capo_context/_services/context.py
def reject_curation_proposal(
    self,
    curation_proposal_id: "capo_context.types.curation_proposal_id.CurationProposalId",
    agent_context_id: "capo_context.types.agent_context_identifier.AgentContextIdentifier",
    revision_id: "capo_context.types.curation_proposal_revision.CurationProposalRevision",
    *,
    config_overrides: Optional[ContextClientConfig] = None,
    client_token: Optional["capo_context.types.client_token.ClientToken"] = None,
) -> "capo_context.types.reject_curation_proposal_response.RejectCurationProposalResponse":
    """<p>Rejects a curation proposal. Its change is not applied to the agent context.</p>

    Args:
        curation_proposal_id: <p>The ID of the proposal to reject.</p>
        agent_context_id: <p>The agent context that the proposal belongs to, by its ID or ARN. If the proposal belongs to another agent context, the request fails with <code>ResourceNotFoundException</code>.</p>
        revision_id: <p>The revisionId the curator observed. A mismatch means a stale view.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to make the request idempotent. For 8 hours, a retry with the same token returns the rejected proposal, and the same token used with another proposal returns a <code>ValidationException</code>.</p>

    Raises:
        capo_context.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.</p>
        capo_context.errors.internal_server_exception.InternalServerException: <p>The request failed because of an internal error. Retry the request.</p>
        capo_context.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a request rate quota. Wait, then retry the request.</p>
        capo_context.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.</p>
        capo_context.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.</p>
        capo_context.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.</p>
        capo_context.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Reject a curation proposal
        The following example rejects a curation proposal that is waiting for review, so AWS Context doesn't apply its change set to the agent context.

        >>> client.reject_curation_proposal(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', curation_proposal_id='cp-1331654b3cbad6b265e09a4588a4e32f', revision_id='c4e6a8b0-2d1f-4a3c-9e5b-7d9f1b3a5c7e', client_token='8a1c3e5b-7d9f-4b2d-a6c8-0e2f4a6b8d1c')
    """

    def _handler(
        req: "OperationRequest[capo_context.types.reject_curation_proposal_request.RejectCurationProposalRequest]",
    ) -> OperationResponse[
        "capo_context.types.reject_curation_proposal_response.RejectCurationProposalResponse"
    ]:
        import capo_context._operations.context.reject_curation_proposal

        output, http_response = (
            capo_context._operations.context.reject_curation_proposal.reject_curation_proposal(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RejectCurationProposal")
    )
    input_: capo_context.types.reject_curation_proposal_request.RejectCurationProposalRequest = {
        "curation_proposal_id": curation_proposal_id,
        "agent_context_id": agent_context_id,
        "revision_id": revision_id,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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