listMachinesWithHttpInfo method
List all machines
Returns a list of machines. The machines are returned sorted by creation date, with the most recent machines appearing first. Resources are automatically scoped to the authenticated bearer e.g. when authenticated as a user, only machines for that specific user 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:
-
String fingerprint: The machine fingerprint to filter by.
-
String ip: The machine IP address to filter by.
-
String hostname: The machine hostname to filter by.
-
String product: The identifier (UUID) of the product to filter by.
-
String policy: The identifier (UUID) of the policy to filter by.
-
String license: The identifier (UUID) or key of the license to filter by.
-
String key: The license key to filter by.
-
String user: The identifier (UUID) of the user to filter by.
-
String group: The identifier (UUID) of the group to filter by.
-
Object metadata: The metadata object to filter by.
Implementation
Future<Response> listMachinesWithHttpInfo(String account, { Object? page, int? limit, String? fingerprint, String? ip, String? hostname, String? product, String? policy, String? license, String? key, String? user, String? group, Object? metadata, }) async {
// ignore: prefer_const_declarations
final path = r'/accounts/{account}/machines'
.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 (fingerprint != null) {
queryParams.addAll(_queryParams('', 'fingerprint', fingerprint));
}
if (ip != null) {
queryParams.addAll(_queryParams('', 'ip', ip));
}
if (hostname != null) {
queryParams.addAll(_queryParams('', 'hostname', hostname));
}
if (product != null) {
queryParams.addAll(_queryParams('', 'product', product));
}
if (policy != null) {
queryParams.addAll(_queryParams('', 'policy', policy));
}
if (license != null) {
queryParams.addAll(_queryParams('', 'license', license));
}
if (key != null) {
queryParams.addAll(_queryParams('', 'key', key));
}
if (user != null) {
queryParams.addAll(_queryParams('', 'user', user));
}
if (group != null) {
queryParams.addAll(_queryParams('', 'group', group));
}
if (metadata != null) {
queryParams.addAll(_queryParams('', 'metadata', metadata));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}