deleteResourceTree method

Future<void> deleteResourceTree({
  1. required String resourceArn,
})

Deletes an entire resource tree. This operation will delete the parent resource and its child resources.

Child resources are resources that were created from another resource. For example, when a forecast is generated from a predictor, the forecast is the child resource and the predictor is the parent resource.

Amazon Forecast resources possess the following parent-child resource hierarchies:

  • Dataset: dataset import jobs
  • Dataset Group: predictors, predictor backtest export jobs, forecasts, forecast export jobs
  • Predictor: predictor backtest export jobs, forecasts, forecast export jobs
  • Forecast: forecast export jobs

May throw InvalidInputException. May throw ResourceInUseException. May throw ResourceNotFoundException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the parent resource to delete. All child resources of the parent resource will also be deleted.

Implementation

Future<void> deleteResourceTree({
  required String resourceArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonForecast.DeleteResourceTree'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
    },
  );
}