createLicenseConversionTaskForResource method

Future<CreateLicenseConversionTaskForResourceResponse> createLicenseConversionTaskForResource({
  1. required LicenseConversionContext destinationLicenseContext,
  2. required String resourceArn,
  3. required LicenseConversionContext sourceLicenseContext,
})

Creates a new license conversion task.

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

Parameter destinationLicenseContext : Information that identifies the license type you are converting to. For the structure of the destination license, see Convert a license type using the CLI in the License Manager User Guide.

Parameter resourceArn : Amazon Resource Name (ARN) of the resource you are converting the license type for.

Parameter sourceLicenseContext : Information that identifies the license type you are converting from. For the structure of the source license, see Convert a license type using the CLI in the License Manager User Guide.

Implementation

Future<CreateLicenseConversionTaskForResourceResponse>
    createLicenseConversionTaskForResource({
  required LicenseConversionContext destinationLicenseContext,
  required String resourceArn,
  required LicenseConversionContext sourceLicenseContext,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSLicenseManager.CreateLicenseConversionTaskForResource'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DestinationLicenseContext': destinationLicenseContext,
      'ResourceArn': resourceArn,
      'SourceLicenseContext': sourceLicenseContext,
    },
  );

  return CreateLicenseConversionTaskForResourceResponse.fromJson(
      jsonResponse.body);
}