listLicensesWithHttpInfo method

Future<Response> listLicensesWithHttpInfo(
  1. String account, {
  2. Object? page,
  3. int? limit,
  4. ListLicensesExpiresParameter? expires,
  5. String? status,
  6. bool? unassigned,
  7. String? product,
  8. String? policy,
  9. String? user,
  10. String? group,
  11. String? machine,
  12. Object? metadata,
})

List all licenses

Returns a list of licenses. The licenses are returned sorted by creation date, with the most recent licenses appearing first. Resources are automatically scoped to the authenticated bearer e.g. when authenticated as a user, only licenses of 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 page number.

  • int limit:

  • ListLicensesExpiresParameter expires: Object containing in, before, or after filters.

  • String status: The status of the license to filter by.

  • bool unassigned: The user-relationship status of the license 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 user: The identifier (UUID) or email of the user to filter by.

  • String group: The identifier (UUID) of the group to filter by.

  • String machine: The identifier (UUID) of the machine to filter by.

  • Object metadata: The metadata object to filter by.

Implementation

Future<Response> listLicensesWithHttpInfo(String account, { Object? page, int? limit, ListLicensesExpiresParameter? expires, String? status, bool? unassigned, String? product, String? policy, String? user, String? group, String? machine, Object? metadata, }) async {
  // ignore: prefer_const_declarations
  final path = r'/accounts/{account}/licenses'
    .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 (expires != null) {
    queryParams.addAll(_queryParams('', 'expires', expires));
  }
  if (status != null) {
    queryParams.addAll(_queryParams('', 'status', status));
  }
  if (unassigned != null) {
    queryParams.addAll(_queryParams('', 'unassigned', unassigned));
  }
  if (product != null) {
    queryParams.addAll(_queryParams('', 'product', product));
  }
  if (policy != null) {
    queryParams.addAll(_queryParams('', 'policy', policy));
  }
  if (user != null) {
    queryParams.addAll(_queryParams('', 'user', user));
  }
  if (group != null) {
    queryParams.addAll(_queryParams('', 'group', group));
  }
  if (machine != null) {
    queryParams.addAll(_queryParams('', 'machine', machine));
  }
  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,
  );
}