createDataSet method

Future<CreateDataSetResponse> createDataSet({
  1. required String awsAccountId,
  2. required String dataSetId,
  3. required DataSetImportMode importMode,
  4. required String name,
  5. required Map<String, PhysicalTable> physicalTableMap,
  6. List<ColumnGroup>? columnGroups,
  7. List<ColumnLevelPermissionRule>? columnLevelPermissionRules,
  8. DataPrepConfiguration? dataPrepConfiguration,
  9. DataSetUsageConfiguration? dataSetUsageConfiguration,
  10. List<DatasetParameter>? datasetParameters,
  11. Map<String, FieldFolder>? fieldFolders,
  12. List<String>? folderArns,
  13. Map<String, LogicalTable>? logicalTableMap,
  14. PerformanceConfiguration? performanceConfiguration,
  15. List<ResourcePermission>? permissions,
  16. RowLevelPermissionDataSet? rowLevelPermissionDataSet,
  17. RowLevelPermissionTagConfiguration? rowLevelPermissionTagConfiguration,
  18. SemanticModelConfiguration? semanticModelConfiguration,
  19. List<Tag>? tags,
  20. DataSetUseAs? useAs,
})

Creates a dataset. This operation doesn't support datasets that include uploaded files as a source.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidDataSetParameterValueException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw ResourceExistsException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnsupportedUserEditionException.

Parameter awsAccountId : The Amazon Web Services account ID.

Parameter dataSetId : An ID for the dataset that you want to create. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.

Parameter importMode : Indicates whether you want to import the data into SPICE.

Parameter name : The display name for the dataset.

Parameter physicalTableMap : Declares the physical tables that are available in the underlying data sources.

Parameter columnGroups : Groupings of columns that work together in certain Amazon Quick Sight features. Currently, only geospatial hierarchy is supported.

Parameter columnLevelPermissionRules : A set of one or more definitions of a ColumnLevelPermissionRule .

Parameter dataPrepConfiguration : The data preparation configuration for the dataset. This configuration defines the source tables, transformation steps, and destination tables used to prepare the data. Required when using the new data preparation experience.

Parameter datasetParameters : The parameter declarations of the dataset.

Parameter fieldFolders : The folder that contains fields and nested subfolders for your dataset.

Parameter folderArns : When you create the dataset, Amazon Quick Sight adds the dataset to these folders.

Parameter logicalTableMap : Configures the combination and transformation of the data from the physical tables. This parameter is used with the legacy data preparation experience.

Parameter performanceConfiguration : The configuration for the performance optimization of the dataset that contains a UniqueKey configuration.

Parameter permissions : A list of resource permissions on the dataset.

Parameter rowLevelPermissionDataSet : The row-level security configuration for the data that you want to create. This parameter is used with the legacy data preparation experience.

Parameter rowLevelPermissionTagConfiguration : The configuration of tags on a dataset to set row-level security. Row-level security tags are currently supported for anonymous embedding only. This parameter is used with the legacy data preparation experience.

Parameter semanticModelConfiguration : The semantic model configuration for the dataset. This configuration defines how the prepared data is structured for an analysis, including table mappings and row-level security configurations. Required when using the new data preparation experience.

Parameter tags : Contains a map of the key-value pairs for the resource tag or tags assigned to the dataset.

Parameter useAs : The usage of the dataset. RLS_RULES must be specified for RLS permission datasets.

Implementation

Future<CreateDataSetResponse> createDataSet({
  required String awsAccountId,
  required String dataSetId,
  required DataSetImportMode importMode,
  required String name,
  required Map<String, PhysicalTable> physicalTableMap,
  List<ColumnGroup>? columnGroups,
  List<ColumnLevelPermissionRule>? columnLevelPermissionRules,
  DataPrepConfiguration? dataPrepConfiguration,
  DataSetUsageConfiguration? dataSetUsageConfiguration,
  List<DatasetParameter>? datasetParameters,
  Map<String, FieldFolder>? fieldFolders,
  List<String>? folderArns,
  Map<String, LogicalTable>? logicalTableMap,
  PerformanceConfiguration? performanceConfiguration,
  List<ResourcePermission>? permissions,
  RowLevelPermissionDataSet? rowLevelPermissionDataSet,
  RowLevelPermissionTagConfiguration? rowLevelPermissionTagConfiguration,
  SemanticModelConfiguration? semanticModelConfiguration,
  List<Tag>? tags,
  DataSetUseAs? useAs,
}) async {
  final $payload = <String, dynamic>{
    'DataSetId': dataSetId,
    'ImportMode': importMode.value,
    'Name': name,
    'PhysicalTableMap': physicalTableMap,
    if (columnGroups != null) 'ColumnGroups': columnGroups,
    if (columnLevelPermissionRules != null)
      'ColumnLevelPermissionRules': columnLevelPermissionRules,
    if (dataPrepConfiguration != null)
      'DataPrepConfiguration': dataPrepConfiguration,
    if (dataSetUsageConfiguration != null)
      'DataSetUsageConfiguration': dataSetUsageConfiguration,
    if (datasetParameters != null) 'DatasetParameters': datasetParameters,
    if (fieldFolders != null) 'FieldFolders': fieldFolders,
    if (folderArns != null) 'FolderArns': folderArns,
    if (logicalTableMap != null) 'LogicalTableMap': logicalTableMap,
    if (performanceConfiguration != null)
      'PerformanceConfiguration': performanceConfiguration,
    if (permissions != null) 'Permissions': permissions,
    if (rowLevelPermissionDataSet != null)
      'RowLevelPermissionDataSet': rowLevelPermissionDataSet,
    if (rowLevelPermissionTagConfiguration != null)
      'RowLevelPermissionTagConfiguration':
          rowLevelPermissionTagConfiguration,
    if (semanticModelConfiguration != null)
      'SemanticModelConfiguration': semanticModelConfiguration,
    if (tags != null) 'Tags': tags,
    if (useAs != null) 'UseAs': useAs.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/accounts/${Uri.encodeComponent(awsAccountId)}/data-sets',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDataSetResponse.fromJson(response);
}