listTokensWithHttpInfo method
Future<Response>
listTokensWithHttpInfo(
- String account, {
- Object? page,
- int? limit,
- ListTokensBearerParameter? bearer,
List all tokens
Returns a list of tokens. The tokens are returned sorted by creation date, with the most recent tokens appearing first. Resources are automatically scoped to the authenticated bearer e.g. when authenticated as a product, only tokens that belong to the specific product will be listed.
Note: This method returns the HTTP Response
.
Parameters:
-
String account (required): The identifier (UUID) or slug of your Keygen account.
-
Object page: Object containing page
size
and pagenumber
. -
int limit:
-
ListTokensBearerParameter bearer: Object containing the bearer's type and ID.
Implementation
Future<Response> listTokensWithHttpInfo(String account, { Object? page, int? limit, ListTokensBearerParameter? bearer, }) async {
// ignore: prefer_const_declarations
final path = r'/accounts/{account}/tokens'
.replaceAll('{account}', account);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (page != null) {
queryParams.addAll(_queryParams('', 'page', page));
}
if (limit != null) {
queryParams.addAll(_queryParams('', 'limit', limit));
}
if (bearer != null) {
queryParams.addAll(_queryParams('', 'bearer', bearer));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}