github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/quicksight/theme.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package quicksight
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Resource for managing a QuickSight Theme.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := quicksight.NewTheme(ctx, "example", &quicksight.ThemeArgs{
    35  //				ThemeId:     pulumi.String("example"),
    36  //				Name:        pulumi.String("example"),
    37  //				BaseThemeId: pulumi.String("MIDNIGHT"),
    38  //				Configuration: &quicksight.ThemeConfigurationArgs{
    39  //					DataColorPalette: &quicksight.ThemeConfigurationDataColorPaletteArgs{
    40  //						Colors: pulumi.StringArray{
    41  //							pulumi.String("#FFFFFF"),
    42  //							pulumi.String("#111111"),
    43  //							pulumi.String("#222222"),
    44  //							pulumi.String("#333333"),
    45  //							pulumi.String("#444444"),
    46  //							pulumi.String("#555555"),
    47  //							pulumi.String("#666666"),
    48  //							pulumi.String("#777777"),
    49  //							pulumi.String("#888888"),
    50  //							pulumi.String("#999999"),
    51  //						},
    52  //						EmptyFillColor: pulumi.String("#FFFFFF"),
    53  //						MinMaxGradients: pulumi.StringArray{
    54  //							pulumi.String("#FFFFFF"),
    55  //							pulumi.String("#111111"),
    56  //						},
    57  //					},
    58  //				},
    59  //			})
    60  //			if err != nil {
    61  //				return err
    62  //			}
    63  //			return nil
    64  //		})
    65  //	}
    66  //
    67  // ```
    68  // <!--End PulumiCodeChooser -->
    69  //
    70  // ## Import
    71  //
    72  // Using `pulumi import`, import a QuickSight Theme using the AWS account ID and theme ID separated by a comma (`,`). For example:
    73  //
    74  // ```sh
    75  // $ pulumi import aws:quicksight/theme:Theme example 123456789012,example-id
    76  // ```
    77  type Theme struct {
    78  	pulumi.CustomResourceState
    79  
    80  	// ARN of the theme.
    81  	Arn pulumi.StringOutput `pulumi:"arn"`
    82  	// AWS account ID.
    83  	AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"`
    84  	// The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis.
    85  	BaseThemeId pulumi.StringOutput `pulumi:"baseThemeId"`
    86  	// The theme configuration, which contains the theme display properties. See configuration.
    87  	//
    88  	// The following arguments are optional:
    89  	Configuration ThemeConfigurationPtrOutput `pulumi:"configuration"`
    90  	// The time that the theme was created.
    91  	CreatedTime pulumi.StringOutput `pulumi:"createdTime"`
    92  	// The time that the theme was last updated.
    93  	LastUpdatedTime pulumi.StringOutput `pulumi:"lastUpdatedTime"`
    94  	// Display name of the theme.
    95  	Name pulumi.StringOutput `pulumi:"name"`
    96  	// A set of resource permissions on the theme. Maximum of 64 items. See permissions.
    97  	Permissions ThemePermissionArrayOutput `pulumi:"permissions"`
    98  	// The theme creation status.
    99  	Status pulumi.StringOutput `pulumi:"status"`
   100  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   101  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   102  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   103  	//
   104  	// Deprecated: Please use `tags` instead.
   105  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   106  	// Identifier of the theme.
   107  	ThemeId pulumi.StringOutput `pulumi:"themeId"`
   108  	// A description of the current theme version being created/updated.
   109  	VersionDescription pulumi.StringPtrOutput `pulumi:"versionDescription"`
   110  	// The version number of the theme version.
   111  	VersionNumber pulumi.IntOutput `pulumi:"versionNumber"`
   112  }
   113  
   114  // NewTheme registers a new resource with the given unique name, arguments, and options.
   115  func NewTheme(ctx *pulumi.Context,
   116  	name string, args *ThemeArgs, opts ...pulumi.ResourceOption) (*Theme, error) {
   117  	if args == nil {
   118  		return nil, errors.New("missing one or more required arguments")
   119  	}
   120  
   121  	if args.BaseThemeId == nil {
   122  		return nil, errors.New("invalid value for required argument 'BaseThemeId'")
   123  	}
   124  	if args.ThemeId == nil {
   125  		return nil, errors.New("invalid value for required argument 'ThemeId'")
   126  	}
   127  	opts = internal.PkgResourceDefaultOpts(opts)
   128  	var resource Theme
   129  	err := ctx.RegisterResource("aws:quicksight/theme:Theme", name, args, &resource, opts...)
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	return &resource, nil
   134  }
   135  
   136  // GetTheme gets an existing Theme resource's state with the given name, ID, and optional
   137  // state properties that are used to uniquely qualify the lookup (nil if not required).
   138  func GetTheme(ctx *pulumi.Context,
   139  	name string, id pulumi.IDInput, state *ThemeState, opts ...pulumi.ResourceOption) (*Theme, error) {
   140  	var resource Theme
   141  	err := ctx.ReadResource("aws:quicksight/theme:Theme", name, id, state, &resource, opts...)
   142  	if err != nil {
   143  		return nil, err
   144  	}
   145  	return &resource, nil
   146  }
   147  
   148  // Input properties used for looking up and filtering Theme resources.
   149  type themeState struct {
   150  	// ARN of the theme.
   151  	Arn *string `pulumi:"arn"`
   152  	// AWS account ID.
   153  	AwsAccountId *string `pulumi:"awsAccountId"`
   154  	// The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis.
   155  	BaseThemeId *string `pulumi:"baseThemeId"`
   156  	// The theme configuration, which contains the theme display properties. See configuration.
   157  	//
   158  	// The following arguments are optional:
   159  	Configuration *ThemeConfiguration `pulumi:"configuration"`
   160  	// The time that the theme was created.
   161  	CreatedTime *string `pulumi:"createdTime"`
   162  	// The time that the theme was last updated.
   163  	LastUpdatedTime *string `pulumi:"lastUpdatedTime"`
   164  	// Display name of the theme.
   165  	Name *string `pulumi:"name"`
   166  	// A set of resource permissions on the theme. Maximum of 64 items. See permissions.
   167  	Permissions []ThemePermission `pulumi:"permissions"`
   168  	// The theme creation status.
   169  	Status *string `pulumi:"status"`
   170  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   171  	Tags map[string]string `pulumi:"tags"`
   172  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   173  	//
   174  	// Deprecated: Please use `tags` instead.
   175  	TagsAll map[string]string `pulumi:"tagsAll"`
   176  	// Identifier of the theme.
   177  	ThemeId *string `pulumi:"themeId"`
   178  	// A description of the current theme version being created/updated.
   179  	VersionDescription *string `pulumi:"versionDescription"`
   180  	// The version number of the theme version.
   181  	VersionNumber *int `pulumi:"versionNumber"`
   182  }
   183  
   184  type ThemeState struct {
   185  	// ARN of the theme.
   186  	Arn pulumi.StringPtrInput
   187  	// AWS account ID.
   188  	AwsAccountId pulumi.StringPtrInput
   189  	// The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis.
   190  	BaseThemeId pulumi.StringPtrInput
   191  	// The theme configuration, which contains the theme display properties. See configuration.
   192  	//
   193  	// The following arguments are optional:
   194  	Configuration ThemeConfigurationPtrInput
   195  	// The time that the theme was created.
   196  	CreatedTime pulumi.StringPtrInput
   197  	// The time that the theme was last updated.
   198  	LastUpdatedTime pulumi.StringPtrInput
   199  	// Display name of the theme.
   200  	Name pulumi.StringPtrInput
   201  	// A set of resource permissions on the theme. Maximum of 64 items. See permissions.
   202  	Permissions ThemePermissionArrayInput
   203  	// The theme creation status.
   204  	Status pulumi.StringPtrInput
   205  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   206  	Tags pulumi.StringMapInput
   207  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   208  	//
   209  	// Deprecated: Please use `tags` instead.
   210  	TagsAll pulumi.StringMapInput
   211  	// Identifier of the theme.
   212  	ThemeId pulumi.StringPtrInput
   213  	// A description of the current theme version being created/updated.
   214  	VersionDescription pulumi.StringPtrInput
   215  	// The version number of the theme version.
   216  	VersionNumber pulumi.IntPtrInput
   217  }
   218  
   219  func (ThemeState) ElementType() reflect.Type {
   220  	return reflect.TypeOf((*themeState)(nil)).Elem()
   221  }
   222  
   223  type themeArgs struct {
   224  	// AWS account ID.
   225  	AwsAccountId *string `pulumi:"awsAccountId"`
   226  	// The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis.
   227  	BaseThemeId string `pulumi:"baseThemeId"`
   228  	// The theme configuration, which contains the theme display properties. See configuration.
   229  	//
   230  	// The following arguments are optional:
   231  	Configuration *ThemeConfiguration `pulumi:"configuration"`
   232  	// Display name of the theme.
   233  	Name *string `pulumi:"name"`
   234  	// A set of resource permissions on the theme. Maximum of 64 items. See permissions.
   235  	Permissions []ThemePermission `pulumi:"permissions"`
   236  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   237  	Tags map[string]string `pulumi:"tags"`
   238  	// Identifier of the theme.
   239  	ThemeId string `pulumi:"themeId"`
   240  	// A description of the current theme version being created/updated.
   241  	VersionDescription *string `pulumi:"versionDescription"`
   242  }
   243  
   244  // The set of arguments for constructing a Theme resource.
   245  type ThemeArgs struct {
   246  	// AWS account ID.
   247  	AwsAccountId pulumi.StringPtrInput
   248  	// The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis.
   249  	BaseThemeId pulumi.StringInput
   250  	// The theme configuration, which contains the theme display properties. See configuration.
   251  	//
   252  	// The following arguments are optional:
   253  	Configuration ThemeConfigurationPtrInput
   254  	// Display name of the theme.
   255  	Name pulumi.StringPtrInput
   256  	// A set of resource permissions on the theme. Maximum of 64 items. See permissions.
   257  	Permissions ThemePermissionArrayInput
   258  	// Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   259  	Tags pulumi.StringMapInput
   260  	// Identifier of the theme.
   261  	ThemeId pulumi.StringInput
   262  	// A description of the current theme version being created/updated.
   263  	VersionDescription pulumi.StringPtrInput
   264  }
   265  
   266  func (ThemeArgs) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*themeArgs)(nil)).Elem()
   268  }
   269  
   270  type ThemeInput interface {
   271  	pulumi.Input
   272  
   273  	ToThemeOutput() ThemeOutput
   274  	ToThemeOutputWithContext(ctx context.Context) ThemeOutput
   275  }
   276  
   277  func (*Theme) ElementType() reflect.Type {
   278  	return reflect.TypeOf((**Theme)(nil)).Elem()
   279  }
   280  
   281  func (i *Theme) ToThemeOutput() ThemeOutput {
   282  	return i.ToThemeOutputWithContext(context.Background())
   283  }
   284  
   285  func (i *Theme) ToThemeOutputWithContext(ctx context.Context) ThemeOutput {
   286  	return pulumi.ToOutputWithContext(ctx, i).(ThemeOutput)
   287  }
   288  
   289  // ThemeArrayInput is an input type that accepts ThemeArray and ThemeArrayOutput values.
   290  // You can construct a concrete instance of `ThemeArrayInput` via:
   291  //
   292  //	ThemeArray{ ThemeArgs{...} }
   293  type ThemeArrayInput interface {
   294  	pulumi.Input
   295  
   296  	ToThemeArrayOutput() ThemeArrayOutput
   297  	ToThemeArrayOutputWithContext(context.Context) ThemeArrayOutput
   298  }
   299  
   300  type ThemeArray []ThemeInput
   301  
   302  func (ThemeArray) ElementType() reflect.Type {
   303  	return reflect.TypeOf((*[]*Theme)(nil)).Elem()
   304  }
   305  
   306  func (i ThemeArray) ToThemeArrayOutput() ThemeArrayOutput {
   307  	return i.ToThemeArrayOutputWithContext(context.Background())
   308  }
   309  
   310  func (i ThemeArray) ToThemeArrayOutputWithContext(ctx context.Context) ThemeArrayOutput {
   311  	return pulumi.ToOutputWithContext(ctx, i).(ThemeArrayOutput)
   312  }
   313  
   314  // ThemeMapInput is an input type that accepts ThemeMap and ThemeMapOutput values.
   315  // You can construct a concrete instance of `ThemeMapInput` via:
   316  //
   317  //	ThemeMap{ "key": ThemeArgs{...} }
   318  type ThemeMapInput interface {
   319  	pulumi.Input
   320  
   321  	ToThemeMapOutput() ThemeMapOutput
   322  	ToThemeMapOutputWithContext(context.Context) ThemeMapOutput
   323  }
   324  
   325  type ThemeMap map[string]ThemeInput
   326  
   327  func (ThemeMap) ElementType() reflect.Type {
   328  	return reflect.TypeOf((*map[string]*Theme)(nil)).Elem()
   329  }
   330  
   331  func (i ThemeMap) ToThemeMapOutput() ThemeMapOutput {
   332  	return i.ToThemeMapOutputWithContext(context.Background())
   333  }
   334  
   335  func (i ThemeMap) ToThemeMapOutputWithContext(ctx context.Context) ThemeMapOutput {
   336  	return pulumi.ToOutputWithContext(ctx, i).(ThemeMapOutput)
   337  }
   338  
   339  type ThemeOutput struct{ *pulumi.OutputState }
   340  
   341  func (ThemeOutput) ElementType() reflect.Type {
   342  	return reflect.TypeOf((**Theme)(nil)).Elem()
   343  }
   344  
   345  func (o ThemeOutput) ToThemeOutput() ThemeOutput {
   346  	return o
   347  }
   348  
   349  func (o ThemeOutput) ToThemeOutputWithContext(ctx context.Context) ThemeOutput {
   350  	return o
   351  }
   352  
   353  // ARN of the theme.
   354  func (o ThemeOutput) Arn() pulumi.StringOutput {
   355  	return o.ApplyT(func(v *Theme) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   356  }
   357  
   358  // AWS account ID.
   359  func (o ThemeOutput) AwsAccountId() pulumi.StringOutput {
   360  	return o.ApplyT(func(v *Theme) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput)
   361  }
   362  
   363  // The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use ListThemes or choose Themes from within an analysis.
   364  func (o ThemeOutput) BaseThemeId() pulumi.StringOutput {
   365  	return o.ApplyT(func(v *Theme) pulumi.StringOutput { return v.BaseThemeId }).(pulumi.StringOutput)
   366  }
   367  
   368  // The theme configuration, which contains the theme display properties. See configuration.
   369  //
   370  // The following arguments are optional:
   371  func (o ThemeOutput) Configuration() ThemeConfigurationPtrOutput {
   372  	return o.ApplyT(func(v *Theme) ThemeConfigurationPtrOutput { return v.Configuration }).(ThemeConfigurationPtrOutput)
   373  }
   374  
   375  // The time that the theme was created.
   376  func (o ThemeOutput) CreatedTime() pulumi.StringOutput {
   377  	return o.ApplyT(func(v *Theme) pulumi.StringOutput { return v.CreatedTime }).(pulumi.StringOutput)
   378  }
   379  
   380  // The time that the theme was last updated.
   381  func (o ThemeOutput) LastUpdatedTime() pulumi.StringOutput {
   382  	return o.ApplyT(func(v *Theme) pulumi.StringOutput { return v.LastUpdatedTime }).(pulumi.StringOutput)
   383  }
   384  
   385  // Display name of the theme.
   386  func (o ThemeOutput) Name() pulumi.StringOutput {
   387  	return o.ApplyT(func(v *Theme) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   388  }
   389  
   390  // A set of resource permissions on the theme. Maximum of 64 items. See permissions.
   391  func (o ThemeOutput) Permissions() ThemePermissionArrayOutput {
   392  	return o.ApplyT(func(v *Theme) ThemePermissionArrayOutput { return v.Permissions }).(ThemePermissionArrayOutput)
   393  }
   394  
   395  // The theme creation status.
   396  func (o ThemeOutput) Status() pulumi.StringOutput {
   397  	return o.ApplyT(func(v *Theme) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   398  }
   399  
   400  // Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   401  func (o ThemeOutput) Tags() pulumi.StringMapOutput {
   402  	return o.ApplyT(func(v *Theme) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   403  }
   404  
   405  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   406  //
   407  // Deprecated: Please use `tags` instead.
   408  func (o ThemeOutput) TagsAll() pulumi.StringMapOutput {
   409  	return o.ApplyT(func(v *Theme) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   410  }
   411  
   412  // Identifier of the theme.
   413  func (o ThemeOutput) ThemeId() pulumi.StringOutput {
   414  	return o.ApplyT(func(v *Theme) pulumi.StringOutput { return v.ThemeId }).(pulumi.StringOutput)
   415  }
   416  
   417  // A description of the current theme version being created/updated.
   418  func (o ThemeOutput) VersionDescription() pulumi.StringPtrOutput {
   419  	return o.ApplyT(func(v *Theme) pulumi.StringPtrOutput { return v.VersionDescription }).(pulumi.StringPtrOutput)
   420  }
   421  
   422  // The version number of the theme version.
   423  func (o ThemeOutput) VersionNumber() pulumi.IntOutput {
   424  	return o.ApplyT(func(v *Theme) pulumi.IntOutput { return v.VersionNumber }).(pulumi.IntOutput)
   425  }
   426  
   427  type ThemeArrayOutput struct{ *pulumi.OutputState }
   428  
   429  func (ThemeArrayOutput) ElementType() reflect.Type {
   430  	return reflect.TypeOf((*[]*Theme)(nil)).Elem()
   431  }
   432  
   433  func (o ThemeArrayOutput) ToThemeArrayOutput() ThemeArrayOutput {
   434  	return o
   435  }
   436  
   437  func (o ThemeArrayOutput) ToThemeArrayOutputWithContext(ctx context.Context) ThemeArrayOutput {
   438  	return o
   439  }
   440  
   441  func (o ThemeArrayOutput) Index(i pulumi.IntInput) ThemeOutput {
   442  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Theme {
   443  		return vs[0].([]*Theme)[vs[1].(int)]
   444  	}).(ThemeOutput)
   445  }
   446  
   447  type ThemeMapOutput struct{ *pulumi.OutputState }
   448  
   449  func (ThemeMapOutput) ElementType() reflect.Type {
   450  	return reflect.TypeOf((*map[string]*Theme)(nil)).Elem()
   451  }
   452  
   453  func (o ThemeMapOutput) ToThemeMapOutput() ThemeMapOutput {
   454  	return o
   455  }
   456  
   457  func (o ThemeMapOutput) ToThemeMapOutputWithContext(ctx context.Context) ThemeMapOutput {
   458  	return o
   459  }
   460  
   461  func (o ThemeMapOutput) MapIndex(k pulumi.StringInput) ThemeOutput {
   462  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Theme {
   463  		return vs[0].(map[string]*Theme)[vs[1].(string)]
   464  	}).(ThemeOutput)
   465  }
   466  
   467  func init() {
   468  	pulumi.RegisterInputType(reflect.TypeOf((*ThemeInput)(nil)).Elem(), &Theme{})
   469  	pulumi.RegisterInputType(reflect.TypeOf((*ThemeArrayInput)(nil)).Elem(), ThemeArray{})
   470  	pulumi.RegisterInputType(reflect.TypeOf((*ThemeMapInput)(nil)).Elem(), ThemeMap{})
   471  	pulumi.RegisterOutputType(ThemeOutput{})
   472  	pulumi.RegisterOutputType(ThemeArrayOutput{})
   473  	pulumi.RegisterOutputType(ThemeMapOutput{})
   474  }