Skip to content

list_payment_instruments async

list_payment_instruments(
    payment_manager_arn: PaymentManagerArn,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = None,
    user_id: Optional[UserId] = None,
    agent_name: Optional[PaymentAgentName] = None,
    payment_connector_id: Optional[PaymentConnectorId] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
) -> ListPaymentInstrumentsResponse

List payment instruments for a manager.

Parameters:

  • user_id (Optional[UserId], default: None ) –

    The user ID associated with the payment instruments.

  • agent_name (Optional[PaymentAgentName], default: None ) –

    The agent name associated with this request, used for observability.

  • payment_manager_arn (PaymentManagerArn) –

    The ARN of the payment manager that owns the payment instruments.

  • payment_connector_id (Optional[PaymentConnectorId], default: None ) –

    The ID of the payment connector to filter by.

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

    Token for pagination to retrieve the next set of results.

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

    Maximum number of results to return in a single response.

Raises:

  • AccessDeniedException –

    The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.

  • InternalServerException –

    The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.

  • ThrottlingException –

    The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.

  • ValidationException –

    The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.

  • UnknownServiceError –

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

Source code in docs_src/capo_bedrock_agentcore/_services/async_bedrock_agent_core.py
async def list_payment_instruments(
    self,
    payment_manager_arn: "capo_bedrock_agentcore.types.payment_manager_arn.PaymentManagerArn",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = None,
    user_id: Optional["capo_bedrock_agentcore.types.user_id.UserId"] = None,
    agent_name: Optional[
        "capo_bedrock_agentcore.types.payment_agent_name.PaymentAgentName"
    ] = None,
    payment_connector_id: Optional[
        "capo_bedrock_agentcore.types.payment_connector_id.PaymentConnectorId"
    ] = None,
    next_token: Optional[
        "capo_bedrock_agentcore.types.next_token.NextToken"
    ] = None,
    max_results: Optional[int] = None,
) -> "capo_bedrock_agentcore.types.list_payment_instruments_response.ListPaymentInstrumentsResponse":
    """<p>List payment instruments for a manager.</p>

    Args:
        user_id: <p>The user ID associated with the payment instruments.</p>
        agent_name: <p>The agent name associated with this request, used for observability.</p>
        payment_manager_arn: <p>The ARN of the payment manager that owns the payment instruments.</p>
        payment_connector_id: <p>The ID of the payment connector to filter by.</p>
        next_token: <p>Token for pagination to retrieve the next set of results.</p>
        max_results: <p>Maximum number of results to return in a single response.</p>

    Raises:
        capo_bedrock_agentcore.errors.access_denied_exception.AccessDeniedException: <p>The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.</p>
        capo_bedrock_agentcore.errors.internal_server_exception.InternalServerException: <p>The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.</p>
        capo_bedrock_agentcore.errors.throttling_exception.ThrottlingException: <p>The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.</p>
        capo_bedrock_agentcore.errors.validation_exception.ValidationException: <p>The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.</p>
        capo_bedrock_agentcore.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_agentcore.types.list_payment_instruments_request.ListPaymentInstrumentsRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore.types.list_payment_instruments_response.ListPaymentInstrumentsResponse"
    ]:
        import capo_bedrock_agentcore._operations.amazon_bedrock_agent_core.list_payment_instruments

        (
            output,
            http_response,
        ) = await capo_bedrock_agentcore._operations.amazon_bedrock_agent_core.list_payment_instruments.async_list_payment_instruments(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPaymentInstruments")
    )
    input_: capo_bedrock_agentcore.types.list_payment_instruments_request.ListPaymentInstrumentsRequest = {
        "payment_manager_arn": payment_manager_arn
    }
    if user_id is not None:
        input_["user_id"] = user_id
    if agent_name is not None:
        input_["agent_name"] = agent_name
    if payment_connector_id is not None:
        input_["payment_connector_id"] = payment_connector_id
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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