terminateProvisionedProduct method

Future<TerminateProvisionedProductOutput> terminateProvisionedProduct({
  1. String? acceptLanguage,
  2. bool? ignoreErrors,
  3. String? provisionedProductId,
  4. String? provisionedProductName,
  5. bool? retainPhysicalResources,
  6. String? terminateToken,
})

Terminates the specified provisioned product.

This operation does not delete any records associated with the provisioned product.

You can check the status of this request using DescribeRecord.

May throw ResourceNotFoundException.

Parameter acceptLanguage : The language code.

  • en - English (default)
  • jp - Japanese
  • zh - Chinese

Parameter ignoreErrors : If set to true, AWS Service Catalog stops managing the specified provisioned product even if it cannot delete the underlying resources.

Parameter provisionedProductId : The identifier of the provisioned product. You cannot specify both ProvisionedProductName and ProvisionedProductId.

Parameter provisionedProductName : The name of the provisioned product. You cannot specify both ProvisionedProductName and ProvisionedProductId.

Parameter retainPhysicalResources : When this boolean parameter is set to true, the TerminateProvisionedProduct API deletes the Service Catalog provisioned product. However, it does not remove the CloudFormation stack, stack set, or the underlying resources of the deleted provisioned product. The default value is false.

Parameter terminateToken : An idempotency token that uniquely identifies the termination request. This token is only valid during the termination process. After the provisioned product is terminated, subsequent requests to terminate the same provisioned product always return ResourceNotFound.

Implementation

Future<TerminateProvisionedProductOutput> terminateProvisionedProduct({
  String? acceptLanguage,
  bool? ignoreErrors,
  String? provisionedProductId,
  String? provisionedProductName,
  bool? retainPhysicalResources,
  String? terminateToken,
}) async {
  _s.validateStringLength(
    'acceptLanguage',
    acceptLanguage,
    0,
    100,
  );
  _s.validateStringLength(
    'provisionedProductId',
    provisionedProductId,
    1,
    100,
  );
  _s.validateStringLength(
    'provisionedProductName',
    provisionedProductName,
    1,
    1224,
  );
  _s.validateStringLength(
    'terminateToken',
    terminateToken,
    1,
    128,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWS242ServiceCatalogService.TerminateProvisionedProduct'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
      if (ignoreErrors != null) 'IgnoreErrors': ignoreErrors,
      if (provisionedProductId != null)
        'ProvisionedProductId': provisionedProductId,
      if (provisionedProductName != null)
        'ProvisionedProductName': provisionedProductName,
      if (retainPhysicalResources != null)
        'RetainPhysicalResources': retainPhysicalResources,
      'TerminateToken': terminateToken ?? _s.generateIdempotencyToken(),
    },
  );

  return TerminateProvisionedProductOutput.fromJson(jsonResponse.body);
}