updateDashboard method

Future<UpdateDashboardResponse> updateDashboard({
  1. required String awsAccountId,
  2. required String dashboardId,
  3. required String name,
  4. DashboardPublishOptions? dashboardPublishOptions,
  5. DashboardVersionDefinition? definition,
  6. Parameters? parameters,
  7. DashboardSourceEntity? sourceEntity,
  8. String? themeArn,
  9. ValidationStrategy? validationStrategy,
  10. String? versionDescription,
})

Updates a dashboard in an Amazon Web Services account.

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

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the dashboard that you're updating.

Parameter dashboardId : The ID for the dashboard.

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.

Parameter parameters : A structure that contains the parameters of the dashboard. These are parameter overrides for a dashboard. A dashboard can have any type of parameters, and some parameters might accept multiple values.

Parameter sourceEntity : The entity that you are using as a source when you update the dashboard. In SourceEntity, you specify the type of object you're using as source. You can only update a dashboard from a template, so you use a SourceTemplate entity. If you need to update 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 SourceTemplate ARN 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.

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 was originally associated with the 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 update a dashboard with definition objects. This skips the validation step for specific errors.

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

Implementation

Future<UpdateDashboardResponse> updateDashboard({
  required String awsAccountId,
  required String dashboardId,
  required String name,
  DashboardPublishOptions? dashboardPublishOptions,
  DashboardVersionDefinition? definition,
  Parameters? parameters,
  DashboardSourceEntity? sourceEntity,
  String? themeArn,
  ValidationStrategy? validationStrategy,
  String? versionDescription,
}) async {
  final $payload = <String, dynamic>{
    'Name': name,
    if (dashboardPublishOptions != null)
      'DashboardPublishOptions': dashboardPublishOptions,
    if (definition != null) 'Definition': definition,
    if (parameters != null) 'Parameters': parameters,
    if (sourceEntity != null) 'SourceEntity': sourceEntity,
    if (themeArn != null) 'ThemeArn': themeArn,
    if (validationStrategy != null) 'ValidationStrategy': validationStrategy,
    if (versionDescription != null) 'VersionDescription': versionDescription,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/dashboards/${Uri.encodeComponent(dashboardId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDashboardResponse.fromJson(response);
}