accept_curation_proposal
async
¶
accept_curation_proposal(
curation_proposal_id: CurationProposalId,
agent_context_id: AgentContextIdentifier,
revision_id: CurationProposalRevision,
*,
config_overrides: Optional[AsyncContextClientConfig] = None,
client_token: Optional[ClientToken] = None,
) -> AcceptCurationProposalResponse
Accepts a curation proposal and applies its change to the agent context.
Parameters:
-
curation_proposal_id(CurationProposalId) –The ID of the proposal to accept.
-
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 proposal's current state, 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:
Accept a curation proposal The following example accepts a curation proposal that is waiting for review, using the revisionId from GetCurationProposal, so AWS Context applies its change set to the agent context.
>>> await client.accept_curation_proposal(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', curation_proposal_id='cp-dc0af01d4ca5847e27d63a3e30a0c9c6', revision_id='7f3c2a1e-9b4d-4e6f-8a0c-2d5e7b9f1a3c', client_token='5e2b8d14-6c3a-4f7e-9b1d-0a4c6e8f2b3d')
Accept a curation proposal with a stale revision, which fails with ConflictException
The following example fails with a ConflictException because the proposal changed after the caller read it, so the revisionId in the request is no longer current.
>>> await client.accept_curation_proposal(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', curation_proposal_id='cp-dc0af01d4ca5847e27d63a3e30a0c9c6', revision_id='0b2d4f6a-8c1e-4b3d-a5f7-9c1e3a5b7d9f')