listVirtualCards

abstract suspend fun listVirtualCards(limit: Int = DEFAULT_CARD_LIMIT, nextToken: String? = null, cachePolicy: CachePolicy = CachePolicy.REMOTE_ONLY): ListAPIResult<VirtualCard, PartialVirtualCard>

Get a list of VirtualCards.

This API returns a ListAPIResult:

  • On ListAPIResult.Success result, contains the list of requested VirtualCards.

  • On ListAPIResult.Partial result, contains the list of PartialVirtualCards representing virtual cards that could not be unsealed successfully and the exception indicating why the unsealing failed. A virtual card may fail to unseal if the client version is not up to date or the required cryptographic key is missing from the client device.

If no VirtualCards can be found, the result will contain null for the nextToken field and contain an empty item list.

To ensure you obtain all the virtual cards that match, you should continue to call this method whenever the nextToken field is not null, even if the items list is empty.

Return

A ListAPIResult.Success or a ListAPIResult.Partial result containing either a list of VirtualCards or PartialVirtualCards respectively. Returns an empty list if no virtual cards can be found.

Parameters

limit

Int Maximum number of VirtualCards to return. If omitted the limit defaults to 10.

nextToken

String A token generated from previous calls to listVirtualCards. This is to allow for pagination. This value should be generated from a previous pagination call, otherwise it will throw an exception. The same arguments should be passed to this method if using a previously generated nextToken.

cachePolicy

CachePolicy Determines how the data will be fetched. When using CachePolicy.CACHE_ONLY, be aware that this will only return cached results of identical API calls.

Throws