Skip to content

list_agreement_approvals

list_agreement_approvals(
    party_type: AgreementApprovalPartyType,
    *,
    config_overrides: Optional[MarketplaceAgreementClientConfig] = None,
    catalog: Optional[Catalog] = None,
    agreement_request_id: Optional[AgreementRequestId] = None,
    approval_type: Optional[AgreementApprovalType] = None,
    status: Optional[AgreementApprovalStatus] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListAgreementApprovalsOutput

Lists agreement approvals available to you as a buyer. Use REQUESTER as the partyType to list the agreement approvals that your account started. Use AWS_ORGANIZATION_ADMIN to list the agreement approvals in your AWS organization, if your account is the management account or a delegated administrator of the organization. You can filter the results by agreement request, approval type, and status.

Parameters:

  • catalog (Optional[Catalog], default: None ) –

    An optional parameter to filter agreement approvals by catalog (for example, AWSMarketplace).

  • party_type (AgreementApprovalPartyType) –

    The party type for the agreement approvals. Required parameter. Use REQUESTER to list agreement approvals for agreement requests that you created, or AWS_ORGANIZATION_ADMIN to list agreement approvals as an AWS Organizations administrator.

  • agreement_request_id (Optional[AgreementRequestId], default: None ) –

    An optional parameter to filter agreement approvals for a specific agreement request.

  • approval_type (Optional[AgreementApprovalType], default: None ) –

    An optional parameter to filter agreement approvals by type. The only valid value is BUYER_AGREEMENT_APPROVAL.

  • status (Optional[AgreementApprovalStatus], default: None ) –

    An optional parameter to filter agreement approvals by status. Valid values include PENDING_APPROVAL, APPROVED, REJECTED, EXPIRED, and CANCELLED. If you don't specify a status, agreement approvals of all statuses are returned.

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

    The maximum number of agreement approvals to return in a single response (1-50). Default is 20.

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

    A token to specify where to start pagination.

Raises:

Examples:

List agreement approvals

>>> client.list_agreement_approvals(party_type='REQUESTER', status='PENDING_APPROVAL', max_results=10)
Source code in docs_src/capo_marketplace_agreement/_services/marketplace_agreement.py
def list_agreement_approvals(
    self,
    party_type: "capo_marketplace_agreement.types.agreement_approval_party_type.AgreementApprovalPartyType",
    *,
    config_overrides: Optional[MarketplaceAgreementClientConfig] = None,
    catalog: Optional["capo_marketplace_agreement.types.catalog.Catalog"] = None,
    agreement_request_id: Optional[
        "capo_marketplace_agreement.types.agreement_request_id.AgreementRequestId"
    ] = None,
    approval_type: Optional[
        "capo_marketplace_agreement.types.agreement_approval_type.AgreementApprovalType"
    ] = None,
    status: Optional[
        "capo_marketplace_agreement.types.agreement_approval_status.AgreementApprovalStatus"
    ] = None,
    max_results: Optional[
        "capo_marketplace_agreement.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_marketplace_agreement.types.next_token.NextToken"
    ] = None,
) -> "capo_marketplace_agreement.types.list_agreement_approvals_output.ListAgreementApprovalsOutput":
    """<p>Lists agreement approvals available to you as a buyer. Use <code>REQUESTER</code> as the <code>partyType</code> to list the agreement approvals that your account started. Use <code>AWS_ORGANIZATION_ADMIN</code> to list the agreement approvals in your AWS organization, if your account is the management account or a delegated administrator of the organization. You can filter the results by agreement request, approval type, and status.</p>

    Args:
        catalog: <p>An optional parameter to filter agreement approvals by catalog (for example, <code>AWSMarketplace</code>).</p>
        party_type: <p>The party type for the agreement approvals. Required parameter. Use <code>REQUESTER</code> to list agreement approvals for agreement requests that you created, or <code>AWS_ORGANIZATION_ADMIN</code> to list agreement approvals as an AWS Organizations administrator.</p>
        agreement_request_id: <p>An optional parameter to filter agreement approvals for a specific agreement request.</p>
        approval_type: <p>An optional parameter to filter agreement approvals by type. The only valid value is <code>BUYER_AGREEMENT_APPROVAL</code>.</p>
        status: <p>An optional parameter to filter agreement approvals by status. Valid values include <code>PENDING_APPROVAL</code>, <code>APPROVED</code>, <code>REJECTED</code>, <code>EXPIRED</code>, and <code>CANCELLED</code>. If you don't specify a status, agreement approvals of all statuses are returned.</p>
        max_results: <p>The maximum number of agreement approvals to return in a single response (1-50). Default is 20.</p>
        next_token: <p>A token to specify where to start pagination.</p>

    Raises:
        capo_marketplace_agreement.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_marketplace_agreement.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_marketplace_agreement.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_marketplace_agreement.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_marketplace_agreement.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List agreement approvals

        >>> client.list_agreement_approvals(party_type='REQUESTER', status='PENDING_APPROVAL', max_results=10)
    """

    def _handler(
        req: "OperationRequest[capo_marketplace_agreement.types.list_agreement_approvals_input.ListAgreementApprovalsInput]",
    ) -> OperationResponse[
        "capo_marketplace_agreement.types.list_agreement_approvals_output.ListAgreementApprovalsOutput"
    ]:
        if req.options.protocol == "awsJson1_0":
            import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.list_agreement_approvals

            output, http_response = (
                capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.list_agreement_approvals.list_agreement_approvals(
                    req.options, req.input
                )
            )
        elif req.options.protocol == "rpcv2Cbor":
            import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.rpcv2_cbor.list_agreement_approvals

            output, http_response = (
                capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.rpcv2_cbor.list_agreement_approvals.list_agreement_approvals(
                    req.options, req.input
                )
            )
        else:
            raise ValueError(f"unknown protocol {req.options.protocol!r}")
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAgreementApprovals")
    )
    input_: capo_marketplace_agreement.types.list_agreement_approvals_input.ListAgreementApprovalsInput = {
        "party_type": party_type
    }
    if catalog is not None:
        input_["catalog"] = catalog
    if agreement_request_id is not None:
        input_["agreement_request_id"] = agreement_request_id
    if approval_type is not None:
        input_["approval_type"] = approval_type
    if status is not None:
        input_["status"] = status
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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