Skip to content

list_curation_proposals async

list_curation_proposals(
    agent_context_id: AgentContextIdentifier,
    status: CurationProposalStatus,
    *,
    config_overrides: Optional[AsyncContextClientConfig] = None,
    access_control: Optional[AccessControl] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListCurationProposalsResponse

Lists an agent context's curation proposals, newest first. A curation proposal holds a change to the agent context for review.

Parameters:

  • agent_context_id (AgentContextIdentifier) –

    The agent context whose proposals you want to list, by its ID or ARN.

  • status (CurationProposalStatus) –

    The status to scope the queue to, for example, PENDING_REVIEW for the review queue. Required: a request lists one status, so list each status you want in its own request.

    Valid values:

    • PENDING_REVIEW - Waiting for a curator's decision. The only status Accept and Reject act on.

    • APPROVED - A curator accepted it. Its change set is published or publishing.

    • REJECTED - Closed without applying its change set: a curator rejected it, or the service did when a holding policy's review window passed with no decision (statusReasonCode REQUEST_EXPIRED).

    • SUPERSEDED - A newer proposal for the same document replaced it.

    • FAILED - The proposal was accepted, but publishing its change set failed. This status is final. To apply the change, submit it again.

    • PUBLISHING - Accepted and publishing asynchronously (an ontology-schema publish). The status then changes to APPROVED or FAILED.

    • ARCHIVED - The connection that produced it was removed from the agent context. statusReason.code is CONNECTION_REMOVED.

  • access_control (Optional[AccessControl], default: None ) –

    The accessControl value to list proposals for. If you omit it, every proposal in the status is listed, each with its accessControl. If you specify a value that isn't listed, the request fails with ValidationException.

    Valid values:

    • ACL_RESTRICTED - Only an allowed end user can read the content (its operations), and the change set can't be edited. Every caller can read its metadata, and its proposal's title names no nodes or edges.

    • NO_ACL - Every caller can read the content.

  • max_results (Optional[MaxResults], default: None ) –

    Maximum number of results per page (upper bound, not a target). The service might return fewer. Defaults to 50. A value outside 1–100 fails with ValidationException.

  • next_token (Optional[PaginationToken], default: None ) –

    Opaque pagination cursor from a prior response. Omit for the first page.

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.

  • 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:

List the curation proposals waiting for review The following example lists the curation proposals of an agent context that are waiting for a curator's decision, newest first.

>>> await client.list_curation_proposals(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', status='PENDING_REVIEW', max_results=25)
Source code in docs_src/capo_context/_services/async_context.py
async def list_curation_proposals(
    self,
    agent_context_id: "capo_context.types.agent_context_identifier.AgentContextIdentifier",
    status: "capo_context.types.curation_proposal_status.CurationProposalStatus",
    *,
    config_overrides: Optional[AsyncContextClientConfig] = None,
    access_control: Optional[
        "capo_context.types.access_control.AccessControl"
    ] = None,
    max_results: Optional["capo_context.types.max_results.MaxResults"] = None,
    next_token: Optional[
        "capo_context.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_context.types.list_curation_proposals_response.ListCurationProposalsResponse":
    """<p>Lists an agent context's curation proposals, newest first. A curation proposal holds a change to the agent context for review.</p>

    Args:
        agent_context_id: <p>The agent context whose proposals you want to list, by its ID or ARN.</p>
        status: <p>The status to scope the queue to, for example, PENDING_REVIEW for the review queue. Required: a request lists one status, so list each status you want in its own request.</p> <p>Valid values:</p> <ul> <li> <p> <code>PENDING_REVIEW</code> - Waiting for a curator's decision. The only status Accept and Reject act on.</p> </li> <li> <p> <code>APPROVED</code> - A curator accepted it. Its change set is published or publishing.</p> </li> <li> <p> <code>REJECTED</code> - Closed without applying its change set: a curator rejected it, or the service did when a holding policy's review window passed with no decision (<code>statusReasonCode</code> REQUEST_EXPIRED).</p> </li> <li> <p> <code>SUPERSEDED</code> - A newer proposal for the same document replaced it.</p> </li> <li> <p> <code>FAILED</code> - The proposal was accepted, but publishing its change set failed. This status is final. To apply the change, submit it again.</p> </li> <li> <p> <code>PUBLISHING</code> - Accepted and publishing asynchronously (an ontology-schema publish). The status then changes to APPROVED or FAILED.</p> </li> <li> <p> <code>ARCHIVED</code> - The connection that produced it was removed from the agent context. <code>statusReason.code</code> is CONNECTION_REMOVED.</p> </li> </ul>
        access_control: <p>The <code>accessControl</code> value to list proposals for. If you omit it, every proposal in the status is listed, each with its <code>accessControl</code>. If you specify a value that isn't listed, the request fails with <code>ValidationException</code>.</p> <p>Valid values:</p> <ul> <li> <p> <code>ACL_RESTRICTED</code> - Only an allowed end user can read the content (its operations), and the change set can't be edited. Every caller can read its metadata, and its proposal's <code>title</code> names no nodes or edges.</p> </li> <li> <p> <code>NO_ACL</code> - Every caller can read the content.</p> </li> </ul>
        max_results: <p>Maximum number of results per page (upper bound, not a target). The service might return fewer. Defaults to 50. A value outside 1–100 fails with <code>ValidationException</code>.</p>
        next_token: <p>Opaque pagination cursor from a prior response. Omit for the first page.</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.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:
        List the curation proposals waiting for review
        The following example lists the curation proposals of an agent context that are waiting for a curator's decision, newest first.

        >>> await client.list_curation_proposals(agent_context_id='ac-4f2a9c1e7b3d4a6f8e0c2b5d7a9f1e3c', status='PENDING_REVIEW', max_results=25)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_context.types.list_curation_proposals_request.ListCurationProposalsRequest]",
    ) -> AsyncOperationResponse[
        "capo_context.types.list_curation_proposals_response.ListCurationProposalsResponse"
    ]:
        import capo_context._operations.context.list_curation_proposals

        (
            output,
            http_response,
        ) = await capo_context._operations.context.list_curation_proposals.async_list_curation_proposals(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCurationProposals")
    )
    input_: capo_context.types.list_curation_proposals_request.ListCurationProposalsRequest = {
        "agent_context_id": agent_context_id,
        "status": status,
    }
    if access_control is not None:
        input_["access_control"] = access_control
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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