checkOutMachineWithHttpInfo method

Future<Response> checkOutMachineWithHttpInfo(
  1. String account,
  2. String machine, {
  3. int? ttl,
  4. List<String>? include,
  5. bool? encrypt,
})

Check-out machine

Action to check-out a machine. This will generate a snapshot of the machine at time of checkout, encoded into a machine file certificate that can be decoded and used for licensing offline and air-gapped environments. The algorithm will depend on the license policy's scheme. Machine files can be distributed using email or USB drives to air-gapped devices. For instructions on verifying a machine file, please see machine file verification.

Note: This method returns the HTTP Response.

Parameters:

  • String account (required): The identifier (UUID) or slug of your Keygen account.

  • String machine (required): The identifier (UUID) or URL-safe fingerprint of the machine to check-out.

  • int ttl: The time-to-live (TTL) of the checked out machine file, in seconds.

  • List<String> include: Include relationship data in the machine file.

  • bool encrypt: Whether or not to encrypt the machine file.

Implementation

Future<Response> checkOutMachineWithHttpInfo(String account, String machine, { int? ttl, List<String>? include, bool? encrypt, }) async {
  // ignore: prefer_const_declarations
  final path = r'/accounts/{account}/machines/{machine}/actions/check-out'
    .replaceAll('{account}', account)
    .replaceAll('{machine}', machine);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (ttl != null) {
    queryParams.addAll(_queryParams('', 'ttl', ttl));
  }
  if (include != null) {
    queryParams.addAll(_queryParams('multi', 'include', include));
  }
  if (encrypt != null) {
    queryParams.addAll(_queryParams('', 'encrypt', encrypt));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}