Lists the payment instruments on your account. This operation returns summaries. To get the details that are specific to an instrument's payment method, use GetPaymentInstrument. Results are paginated. Use nextToken to retrieve more results.
To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for payments:ListPaymentInstruments.
Parameters:
-
next_token
(Optional[PaginationToken], default:
None
)
–
The pagination token from the nextToken of the previous response. Omit it to get the first page. Tokens expire. If the token is malformed or expired, or doesn't match the original request, the request fails with ValidationException and the reason INVALID_PAGINATION_TOKEN. In that case, start again from the first page.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of payment instruments to return in one page. The default is 25. A page can contain fewer payment instruments even when more remain. Use nextToken to find out whether more payment instruments are available.
Raises:
-
AccessDeniedException
–
The request is denied because you don't have sufficient access to perform this operation. Verify that you have the required permissions and try again. This error is also returned, instead of ResourceNotFoundException, when you aren't authorized for the resource, so the response doesn't reveal whether the resource exists.
-
InternalServerException
–
The request processing failed because of an unknown error, exception, or failure. Retry your request.
-
ThrottlingException
–
The request was denied due to request throttling. Reduce the frequency of your requests and try again.
-
ValidationException
–
The request isn't valid. Check reason and fieldList for the cause, correct the request, and try again.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Invoke ListPaymentInstruments
>>> await client.list_payment_instruments(max_results=5)
Source code in docs_src/capo_payments/_services/async_payments.py
| async def list_payment_instruments(
self,
*,
config_overrides: Optional[AsyncPaymentsClientConfig] = None,
next_token: Optional[
"capo_payments.types.pagination_token.PaginationToken"
] = None,
max_results: Optional["capo_payments.types.max_results.MaxResults"] = None,
) -> "capo_payments.types.list_payment_instruments_response.ListPaymentInstrumentsResponse":
"""<p>Lists the payment instruments on your account. This operation returns summaries. To get the details that are specific to an instrument's payment method, use <code>GetPaymentInstrument</code>. Results are paginated. Use <code>nextToken</code> to retrieve more results.</p> <p>To use this operation, you must have Amazon Web Services Identity and Access Management (IAM) permission for <code>payments:ListPaymentInstruments</code>.</p>
Args:
next_token: <p>The pagination token from the <code>nextToken</code> of the previous response. Omit it to get the first page. Tokens expire. If the token is malformed or expired, or doesn't match the original request, the request fails with <code>ValidationException</code> and the reason <code>INVALID_PAGINATION_TOKEN</code>. In that case, start again from the first page.</p>
max_results: <p>The maximum number of payment instruments to return in one page. The default is 25. A page can contain fewer payment instruments even when more remain. Use <code>nextToken</code> to find out whether more payment instruments are available.</p>
Raises:
capo_payments.errors.access_denied_exception.AccessDeniedException: <p>The request is denied because you don't have sufficient access to perform this operation. Verify that you have the required permissions and try again. This error is also returned, instead of <code>ResourceNotFoundException</code>, when you aren't authorized for the resource, so the response doesn't reveal whether the resource exists.</p>
capo_payments.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an unknown error, exception, or failure. Retry your request.</p>
capo_payments.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Reduce the frequency of your requests and try again.</p>
capo_payments.errors.validation_exception.ValidationException: <p>The request isn't valid. Check <code>reason</code> and <code>fieldList</code> for the cause, correct the request, and try again.</p>
capo_payments.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Invoke ListPaymentInstruments
>>> await client.list_payment_instruments(max_results=5)
"""
async def _handler(
req: "AsyncOperationRequest[capo_payments.types.list_payment_instruments_request.ListPaymentInstrumentsRequest]",
) -> AsyncOperationResponse[
"capo_payments.types.list_payment_instruments_response.ListPaymentInstrumentsResponse"
]:
import capo_payments._operations.aws_payments.list_payment_instruments
(
output,
http_response,
) = await capo_payments._operations.aws_payments.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_payments.types.list_payment_instruments_request.ListPaymentInstrumentsRequest = {}
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
|