createLicenseTokenWithHttpInfo method
Future<Response>
createLicenseTokenWithHttpInfo(
- String account,
- String license, {
- CreateLicenseTokenRequest? createLicenseTokenRequest,
Generate a license token
Create a license token for a license. A license token has permission to activate and deactivate machines for the given license. An alternative to Token Authentication is License Authentication. Typically, we recommend using License Authentication where possible, as it very much simplifies an integration.
Note: This method returns the HTTP Response
.
Parameters:
-
String account (required): The identifier (UUID) or slug of your Keygen account.
-
String license (required): The identifier (UUID) or key of the license the token is for.
-
CreateLicenseTokenRequest createLicenseTokenRequest:
Implementation
Future<Response> createLicenseTokenWithHttpInfo(String account, String license, { CreateLicenseTokenRequest? createLicenseTokenRequest, }) async {
// ignore: prefer_const_declarations
final path = r'/accounts/{account}/licenses/{license}/tokens'
.replaceAll('{account}', account)
.replaceAll('{license}', license);
// ignore: prefer_final_locals
Object? postBody = createLicenseTokenRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/vnd.api+json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}