createTheme method

Future<CreateThemeResponse> createTheme({
  1. required String awsAccountId,
  2. required String baseThemeId,
  3. required ThemeConfiguration configuration,
  4. required String name,
  5. required String themeId,
  6. List<ResourcePermission>? permissions,
  7. List<Tag>? tags,
  8. String? versionDescription,
})

Creates a theme.

A theme is set of configuration options for color and layout. Themes apply to analyses and dashboards. For more information, see Using Themes in Amazon Quick Sight in the Amazon Quick Sight User Guide.

May throw AccessDeniedException. 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 store the new theme.

Parameter baseThemeId : The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon Quick Sight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis.

Parameter configuration : The theme configuration, which contains the theme display properties.

Parameter name : A display name for the theme.

Parameter themeId : An ID for the theme that you want to create. The theme ID is unique per Amazon Web Services Region in each Amazon Web Services account.

Parameter permissions : A valid grouping of resource permissions to apply to the new theme.

Parameter tags : A map of the key-value pairs for the resource tag or tags that you want to add to the resource.

Parameter versionDescription : A description of the first version of the theme that you're creating. Every time UpdateTheme is called, a new version is created. Each version of the theme has a description of the version in the VersionDescription field.

Implementation

Future<CreateThemeResponse> createTheme({
  required String awsAccountId,
  required String baseThemeId,
  required ThemeConfiguration configuration,
  required String name,
  required String themeId,
  List<ResourcePermission>? permissions,
  List<Tag>? tags,
  String? versionDescription,
}) async {
  final $payload = <String, dynamic>{
    'BaseThemeId': baseThemeId,
    'Configuration': configuration,
    'Name': name,
    if (permissions != null) 'Permissions': permissions,
    if (tags != null) 'Tags': tags,
    if (versionDescription != null) 'VersionDescription': versionDescription,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/themes/${Uri.encodeComponent(themeId)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateThemeResponse.fromJson(response);
}