createExport method

Future<CreateExportResponse> createExport({
  1. required Export export,
  2. List<ResourceTag>? resourceTags,
})

Creates a data export and specifies the data query, the delivery preference, and any optional resource tags.

A DataQuery consists of both a QueryStatement and TableConfigurations.

The QueryStatement is an SQL statement. Data Exports only supports a limited subset of the SQL syntax. For more information on the SQL syntax that is supported, see Data query. To view the available tables and columns, see the Data Exports table dictionary.

The TableConfigurations is a collection of specified TableProperties for the table being queried in the QueryStatement. TableProperties are additional configurations you can provide to change the data and schema of a table. Each table can have different TableProperties. However, tables are not required to have any TableProperties. Each table property has a default value that it assumes if not specified. For more information on table configurations, see Data query. To view the table properties available for each table, see the Data Exports table dictionary or use the ListTables API to get a response of all tables and their available properties.

May throw AccessDeniedException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter export : The details of the export, including data query, name, description, and destination configuration.

Parameter resourceTags : An optional list of tags to associate with the specified export. Each tag consists of a key and a value, and each key must be unique for the resource.

Implementation

Future<CreateExportResponse> createExport({
  required Export export,
  List<ResourceTag>? resourceTags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSBillingAndCostManagementDataExports.CreateExport'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Export': export,
      if (resourceTags != null) 'ResourceTags': resourceTags,
    },
  );

  return CreateExportResponse.fromJson(jsonResponse.body);
}