Skip to content

create_theme

create_theme(
    aws_account_id: AwsAccountId,
    theme_id: ShortRestrictiveResourceId,
    name: ThemeName,
    base_theme_id: ShortRestrictiveResourceId,
    configuration: ThemeConfiguration,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    version_description: Optional[VersionDescription] = None,
    permissions: Optional[ResourcePermissionList] = None,
    tags: Optional[TagList] = None,
) -> CreateThemeResponse

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.

Parameters:

  • aws_account_id (AwsAccountId) –

    The ID of the Amazon Web Services account where you want to store the new theme.

  • theme_id (ShortRestrictiveResourceId) –

    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.

  • name (ThemeName) –

    A display name for the theme.

  • base_theme_id (ShortRestrictiveResourceId) –

    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.

  • version_description (Optional[VersionDescription], default: None ) –

    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.

  • configuration (ThemeConfiguration) –

    The theme configuration, which contains the theme display properties.

  • permissions (Optional[ResourcePermissionList], default: None ) –

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

  • tags (Optional[TagList], default: None ) –

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

Raises:

  • AccessDeniedException –

    You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.

  • InternalFailureException –

    An internal failure occurred.

  • InvalidParameterValueException –

    One or more parameters has a value that isn't valid.

  • LimitExceededException –

    A limit is exceeded.

  • ResourceExistsException –

    The resource specified already exists.

  • ResourceNotFoundException –

    One or more resources can't be found.

  • ThrottlingException –

    Access is throttled.

  • UnsupportedUserEditionException –

    This error indicates that you are calling an operation on an Amazon Quick Suite subscription where the edition doesn't include support for that operation. Amazon Quick Suite currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_quicksight/_services/quick_sight.py
def create_theme(
    self,
    aws_account_id: "capo_quicksight.types.aws_account_id.AwsAccountId",
    theme_id: "capo_quicksight.types.short_restrictive_resource_id.ShortRestrictiveResourceId",
    name: "capo_quicksight.types.theme_name.ThemeName",
    base_theme_id: "capo_quicksight.types.short_restrictive_resource_id.ShortRestrictiveResourceId",
    configuration: "capo_quicksight.types.theme_configuration.ThemeConfiguration",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    version_description: Optional[
        "capo_quicksight.types.version_description.VersionDescription"
    ] = None,
    permissions: Optional[
        "capo_quicksight.types.resource_permission_list.ResourcePermissionList"
    ] = None,
    tags: Optional["capo_quicksight.types.tag_list.TagList"] = None,
) -> "capo_quicksight.types.create_theme_response.CreateThemeResponse":
    """<p>Creates a theme.</p> <p>A <i>theme</i> is set of configuration options for color and layout. Themes apply to analyses and dashboards. For more information, see <a href="https://docs.aws.amazon.com/quicksight/latest/user/themes-in-quicksight.html">Using Themes in Amazon Quick Sight</a> in the <i>Amazon Quick Sight User Guide</i>.</p>

    Args:
        aws_account_id: <p>The ID of the Amazon Web Services account where you want to store the new theme. </p>
        theme_id: <p>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.</p>
        name: <p>A display name for the theme.</p>
        base_theme_id: <p>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 <code>ListThemes</code> or choose <b>Themes</b> from within an analysis. </p>
        version_description: <p>A description of the first version of the theme that you're creating. Every time <code>UpdateTheme</code> is called, a new version is created. Each version of the theme has a description of the version in the <code>VersionDescription</code> field.</p>
        configuration: <p>The theme configuration, which contains the theme display properties.</p>
        permissions: <p>A valid grouping of resource permissions to apply to the new theme. </p>
        tags: <p>A map of the key-value pairs for the resource tag or tags that you want to add to the resource.</p>

    Raises:
        capo_quicksight.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.limit_exceeded_exception.LimitExceededException: <p>A limit is exceeded.</p>
        capo_quicksight.errors.resource_exists_exception.ResourceExistsException: <p>The resource specified already exists. </p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.unsupported_user_edition_exception.UnsupportedUserEditionException: <p>This error indicates that you are calling an operation on an Amazon Quick Suite subscription where the edition doesn't include support for that operation. Amazon Quick Suite currently has Standard Edition and Enterprise Edition. Not every operation and capability is available in every edition.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_quicksight.types.create_theme_request.CreateThemeRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.create_theme_response.CreateThemeResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.create_theme

        output, http_response = (
            capo_quicksight._operations.quick_sight_20180401.create_theme.create_theme(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateTheme")
    )
    input_: capo_quicksight.types.create_theme_request.CreateThemeRequest = {
        "aws_account_id": aws_account_id,
        "theme_id": theme_id,
        "name": name,
        "base_theme_id": base_theme_id,
        "configuration": configuration,
    }
    if version_description is not None:
        input_["version_description"] = version_description
    if permissions is not None:
        input_["permissions"] = permissions
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output