listLicenseVersions method

Future<ListLicenseVersionsResponse> listLicenseVersions({
  1. required String licenseArn,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all versions of the specified license.

May throw InvalidParameterValueException. May throw AuthorizationException. May throw AccessDeniedException. May throw RateLimitExceededException. May throw ServerInternalException.

Parameter licenseArn : Amazon Resource Name (ARN) of the license.

Parameter maxResults : Maximum number of results to return in a single call.

Parameter nextToken : Token for the next set of results.

Implementation

Future<ListLicenseVersionsResponse> listLicenseVersions({
  required String licenseArn,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(licenseArn, 'licenseArn');
  _s.validateStringLength(
    'licenseArn',
    licenseArn,
    0,
    2048,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSLicenseManager.ListLicenseVersions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'LicenseArn': licenseArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListLicenseVersionsResponse.fromJson(jsonResponse.body);
}