deleteLicense method

Future<DeleteLicenseResponse> deleteLicense({
  1. required String licenseArn,
  2. required String sourceVersion,
})

Deletes the specified license.

May throw ValidationException. May throw InvalidParameterValueException. May throw RedirectException. May throw ConflictException. May throw ServerInternalException. May throw AuthorizationException. May throw AccessDeniedException. May throw RateLimitExceededException.

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

Parameter sourceVersion : Current version of the license.

Implementation

Future<DeleteLicenseResponse> deleteLicense({
  required String licenseArn,
  required String sourceVersion,
}) async {
  ArgumentError.checkNotNull(licenseArn, 'licenseArn');
  _s.validateStringLength(
    'licenseArn',
    licenseArn,
    0,
    2048,
    isRequired: true,
  );
  ArgumentError.checkNotNull(sourceVersion, 'sourceVersion');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSLicenseManager.DeleteLicense'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'LicenseArn': licenseArn,
      'SourceVersion': sourceVersion,
    },
  );

  return DeleteLicenseResponse.fromJson(jsonResponse.body);
}