createDashboard method

Future<CreateDashboardResponse> createDashboard({
  1. required String awsAccountId,
  2. required String dashboardId,
  3. required String name,
  4. DashboardPublishOptions? dashboardPublishOptions,
  5. DashboardVersionDefinition? definition,
  6. List<String>? folderArns,
  7. List<String>? linkEntities,
  8. LinkSharingConfiguration? linkSharingConfiguration,
  9. Parameters? parameters,
  10. List<ResourcePermission>? permissions,
  11. DashboardSourceEntity? sourceEntity,
  12. List<Tag>? tags,
  13. String? themeArn,
  14. ValidationStrategy? validationStrategy,
  15. String? versionDescription,
})

Creates a dashboard from either a template or directly with a DashboardDefinition. To first create a template, see the CreateTemplate API operation.

A dashboard is an entity in Amazon Quick Sight that identifies Amazon Quick Sight reports, created from analyses. You can share Amazon Quick Sight dashboards. With the right permissions, you can create scheduled email reports from them. If you have the correct permissions, you can create a dashboard from a template that exists in a different Amazon Web Services account.

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

Parameter awsAccountId : The ID of the Amazon Web Services account where you want to create the dashboard.

Parameter dashboardId : The ID for the dashboard, also added to the IAM policy.

Parameter name : The display name of the dashboard.

Parameter dashboardPublishOptions : Options for publishing the dashboard when you create it:

  • AvailabilityStatus for AdHocFilteringOption - This status can be either ENABLED or DISABLED. When this is set to DISABLED, Amazon Quick Sight disables the left filter pane on the published dashboard, which can be used for ad hoc (one-time) filtering. This option is ENABLED by default.
  • AvailabilityStatus for ExportToCSVOption - This status can be either ENABLED or DISABLED. The visual option to export data to .CSV format isn't enabled when this is set to DISABLED. This option is ENABLED by default.
  • VisibilityState for SheetControlsOption - This visibility state can be either COLLAPSED or EXPANDED. This option is COLLAPSED by default.
  • AvailabilityStatus for QuickSuiteActionsOption - This status can be either ENABLED or DISABLED. Features related to Actions in Amazon Quick Suite on dashboards are disabled when this is set to DISABLED. This option is DISABLED by default.
  • AvailabilityStatus for ExecutiveSummaryOption - This status can be either ENABLED or DISABLED. The option to build an executive summary is disabled when this is set to DISABLED. This option is ENABLED by default.
  • AvailabilityStatus for DataStoriesSharingOption - This status can be either ENABLED or DISABLED. The option to share a data story is disabled when this is set to DISABLED. This option is ENABLED by default.

Parameter definition : The definition of a dashboard.

A definition is the data model of all features in a Dashboard, Template, or Analysis.

Either a SourceEntity or a Definition must be provided in order for the request to be valid.

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

Parameter linkEntities : A list of analysis Amazon Resource Names (ARNs) to be linked to the dashboard.

Parameter linkSharingConfiguration : A structure that contains the permissions of a shareable link to the dashboard.

Parameter parameters : The parameters for the creation of the dashboard, which you want to use to override the default settings. A dashboard can have any type of parameters, and some parameters might accept multiple values.

Parameter permissions : A structure that contains the permissions of the dashboard. You can use this structure for granting permissions by providing a list of IAM action information for each principal ARN.

To specify no permissions, omit the permissions list.

Parameter sourceEntity : The entity that you are using as a source when you create the dashboard. In SourceEntity, you specify the type of object you're using as source. You can only create a dashboard from a template, so you use a SourceTemplate entity. If you need to create a dashboard from an analysis, first convert the analysis to a template by using the CreateTemplate API operation. For SourceTemplate, specify the Amazon Resource Name (ARN) of the source template. The SourceTemplateARN can contain any Amazon Web Services account and any Amazon Quick Sight-supported Amazon Web Services Region.

Use the DataSetReferences entity within SourceTemplate to list the replacement datasets for the placeholders listed in the original. The schema in each dataset must match its placeholder.

Either a SourceEntity or a Definition must be provided in order for the request to be valid.

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

Parameter themeArn : The Amazon Resource Name (ARN) of the theme that is being used for this dashboard. If you add a value for this field, it overrides the value that is used in the source entity. The theme ARN must exist in the same Amazon Web Services account where you create the dashboard.

Parameter validationStrategy : The option to relax the validation needed to create a dashboard with definition objects. This option skips the validation step for specific errors.

Parameter versionDescription : A description for the first version of the dashboard being created.

Implementation

Future<CreateDashboardResponse> createDashboard({
  required String awsAccountId,
  required String dashboardId,
  required String name,
  DashboardPublishOptions? dashboardPublishOptions,
  DashboardVersionDefinition? definition,
  List<String>? folderArns,
  List<String>? linkEntities,
  LinkSharingConfiguration? linkSharingConfiguration,
  Parameters? parameters,
  List<ResourcePermission>? permissions,
  DashboardSourceEntity? sourceEntity,
  List<Tag>? tags,
  String? themeArn,
  ValidationStrategy? validationStrategy,
  String? versionDescription,
}) async {
  final $payload = <String, dynamic>{
    'Name': name,
    if (dashboardPublishOptions != null)
      'DashboardPublishOptions': dashboardPublishOptions,
    if (definition != null) 'Definition': definition,
    if (folderArns != null) 'FolderArns': folderArns,
    if (linkEntities != null) 'LinkEntities': linkEntities,
    if (linkSharingConfiguration != null)
      'LinkSharingConfiguration': linkSharingConfiguration,
    if (parameters != null) 'Parameters': parameters,
    if (permissions != null) 'Permissions': permissions,
    if (sourceEntity != null) 'SourceEntity': sourceEntity,
    if (tags != null) 'Tags': tags,
    if (themeArn != null) 'ThemeArn': themeArn,
    if (validationStrategy != null) 'ValidationStrategy': validationStrategy,
    if (versionDescription != null) 'VersionDescription': versionDescription,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/dashboards/${Uri.encodeComponent(dashboardId)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDashboardResponse.fromJson(response);
}