github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/humanTaskUI.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 sagemaker
     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  // Provides a SageMaker Human Task UI resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sagemaker"
    26  //	"github.com/pulumi/pulumi-std/sdk/go/std"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			invokeFile, err := std.File(ctx, &std.FileArgs{
    34  //				Input: "sagemaker-human-task-ui-template.html",
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			_, err = sagemaker.NewHumanTaskUI(ctx, "example", &sagemaker.HumanTaskUIArgs{
    40  //				HumanTaskUiName: pulumi.String("example"),
    41  //				UiTemplate: &sagemaker.HumanTaskUIUiTemplateArgs{
    42  //					Content: invokeFile.Result,
    43  //				},
    44  //			})
    45  //			if err != nil {
    46  //				return err
    47  //			}
    48  //			return nil
    49  //		})
    50  //	}
    51  //
    52  // ```
    53  // <!--End PulumiCodeChooser -->
    54  //
    55  // ## Import
    56  //
    57  // Using `pulumi import`, import SageMaker Human Task UIs using the `human_task_ui_name`. For example:
    58  //
    59  // ```sh
    60  // $ pulumi import aws:sagemaker/humanTaskUI:HumanTaskUI example example
    61  // ```
    62  type HumanTaskUI struct {
    63  	pulumi.CustomResourceState
    64  
    65  	// The Amazon Resource Name (ARN) assigned by AWS to this Human Task UI.
    66  	Arn pulumi.StringOutput `pulumi:"arn"`
    67  	// The name of the Human Task UI.
    68  	HumanTaskUiName pulumi.StringOutput `pulumi:"humanTaskUiName"`
    69  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    70  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    71  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    72  	//
    73  	// Deprecated: Please use `tags` instead.
    74  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    75  	// The Liquid template for the worker user interface. See UI Template below.
    76  	UiTemplate HumanTaskUIUiTemplateOutput `pulumi:"uiTemplate"`
    77  }
    78  
    79  // NewHumanTaskUI registers a new resource with the given unique name, arguments, and options.
    80  func NewHumanTaskUI(ctx *pulumi.Context,
    81  	name string, args *HumanTaskUIArgs, opts ...pulumi.ResourceOption) (*HumanTaskUI, error) {
    82  	if args == nil {
    83  		return nil, errors.New("missing one or more required arguments")
    84  	}
    85  
    86  	if args.HumanTaskUiName == nil {
    87  		return nil, errors.New("invalid value for required argument 'HumanTaskUiName'")
    88  	}
    89  	if args.UiTemplate == nil {
    90  		return nil, errors.New("invalid value for required argument 'UiTemplate'")
    91  	}
    92  	opts = internal.PkgResourceDefaultOpts(opts)
    93  	var resource HumanTaskUI
    94  	err := ctx.RegisterResource("aws:sagemaker/humanTaskUI:HumanTaskUI", name, args, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // GetHumanTaskUI gets an existing HumanTaskUI resource's state with the given name, ID, and optional
   102  // state properties that are used to uniquely qualify the lookup (nil if not required).
   103  func GetHumanTaskUI(ctx *pulumi.Context,
   104  	name string, id pulumi.IDInput, state *HumanTaskUIState, opts ...pulumi.ResourceOption) (*HumanTaskUI, error) {
   105  	var resource HumanTaskUI
   106  	err := ctx.ReadResource("aws:sagemaker/humanTaskUI:HumanTaskUI", name, id, state, &resource, opts...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return &resource, nil
   111  }
   112  
   113  // Input properties used for looking up and filtering HumanTaskUI resources.
   114  type humanTaskUIState struct {
   115  	// The Amazon Resource Name (ARN) assigned by AWS to this Human Task UI.
   116  	Arn *string `pulumi:"arn"`
   117  	// The name of the Human Task UI.
   118  	HumanTaskUiName *string `pulumi:"humanTaskUiName"`
   119  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   120  	Tags map[string]string `pulumi:"tags"`
   121  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   122  	//
   123  	// Deprecated: Please use `tags` instead.
   124  	TagsAll map[string]string `pulumi:"tagsAll"`
   125  	// The Liquid template for the worker user interface. See UI Template below.
   126  	UiTemplate *HumanTaskUIUiTemplate `pulumi:"uiTemplate"`
   127  }
   128  
   129  type HumanTaskUIState struct {
   130  	// The Amazon Resource Name (ARN) assigned by AWS to this Human Task UI.
   131  	Arn pulumi.StringPtrInput
   132  	// The name of the Human Task UI.
   133  	HumanTaskUiName pulumi.StringPtrInput
   134  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   135  	Tags pulumi.StringMapInput
   136  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   137  	//
   138  	// Deprecated: Please use `tags` instead.
   139  	TagsAll pulumi.StringMapInput
   140  	// The Liquid template for the worker user interface. See UI Template below.
   141  	UiTemplate HumanTaskUIUiTemplatePtrInput
   142  }
   143  
   144  func (HumanTaskUIState) ElementType() reflect.Type {
   145  	return reflect.TypeOf((*humanTaskUIState)(nil)).Elem()
   146  }
   147  
   148  type humanTaskUIArgs struct {
   149  	// The name of the Human Task UI.
   150  	HumanTaskUiName string `pulumi:"humanTaskUiName"`
   151  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   152  	Tags map[string]string `pulumi:"tags"`
   153  	// The Liquid template for the worker user interface. See UI Template below.
   154  	UiTemplate HumanTaskUIUiTemplate `pulumi:"uiTemplate"`
   155  }
   156  
   157  // The set of arguments for constructing a HumanTaskUI resource.
   158  type HumanTaskUIArgs struct {
   159  	// The name of the Human Task UI.
   160  	HumanTaskUiName pulumi.StringInput
   161  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   162  	Tags pulumi.StringMapInput
   163  	// The Liquid template for the worker user interface. See UI Template below.
   164  	UiTemplate HumanTaskUIUiTemplateInput
   165  }
   166  
   167  func (HumanTaskUIArgs) ElementType() reflect.Type {
   168  	return reflect.TypeOf((*humanTaskUIArgs)(nil)).Elem()
   169  }
   170  
   171  type HumanTaskUIInput interface {
   172  	pulumi.Input
   173  
   174  	ToHumanTaskUIOutput() HumanTaskUIOutput
   175  	ToHumanTaskUIOutputWithContext(ctx context.Context) HumanTaskUIOutput
   176  }
   177  
   178  func (*HumanTaskUI) ElementType() reflect.Type {
   179  	return reflect.TypeOf((**HumanTaskUI)(nil)).Elem()
   180  }
   181  
   182  func (i *HumanTaskUI) ToHumanTaskUIOutput() HumanTaskUIOutput {
   183  	return i.ToHumanTaskUIOutputWithContext(context.Background())
   184  }
   185  
   186  func (i *HumanTaskUI) ToHumanTaskUIOutputWithContext(ctx context.Context) HumanTaskUIOutput {
   187  	return pulumi.ToOutputWithContext(ctx, i).(HumanTaskUIOutput)
   188  }
   189  
   190  // HumanTaskUIArrayInput is an input type that accepts HumanTaskUIArray and HumanTaskUIArrayOutput values.
   191  // You can construct a concrete instance of `HumanTaskUIArrayInput` via:
   192  //
   193  //	HumanTaskUIArray{ HumanTaskUIArgs{...} }
   194  type HumanTaskUIArrayInput interface {
   195  	pulumi.Input
   196  
   197  	ToHumanTaskUIArrayOutput() HumanTaskUIArrayOutput
   198  	ToHumanTaskUIArrayOutputWithContext(context.Context) HumanTaskUIArrayOutput
   199  }
   200  
   201  type HumanTaskUIArray []HumanTaskUIInput
   202  
   203  func (HumanTaskUIArray) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*[]*HumanTaskUI)(nil)).Elem()
   205  }
   206  
   207  func (i HumanTaskUIArray) ToHumanTaskUIArrayOutput() HumanTaskUIArrayOutput {
   208  	return i.ToHumanTaskUIArrayOutputWithContext(context.Background())
   209  }
   210  
   211  func (i HumanTaskUIArray) ToHumanTaskUIArrayOutputWithContext(ctx context.Context) HumanTaskUIArrayOutput {
   212  	return pulumi.ToOutputWithContext(ctx, i).(HumanTaskUIArrayOutput)
   213  }
   214  
   215  // HumanTaskUIMapInput is an input type that accepts HumanTaskUIMap and HumanTaskUIMapOutput values.
   216  // You can construct a concrete instance of `HumanTaskUIMapInput` via:
   217  //
   218  //	HumanTaskUIMap{ "key": HumanTaskUIArgs{...} }
   219  type HumanTaskUIMapInput interface {
   220  	pulumi.Input
   221  
   222  	ToHumanTaskUIMapOutput() HumanTaskUIMapOutput
   223  	ToHumanTaskUIMapOutputWithContext(context.Context) HumanTaskUIMapOutput
   224  }
   225  
   226  type HumanTaskUIMap map[string]HumanTaskUIInput
   227  
   228  func (HumanTaskUIMap) ElementType() reflect.Type {
   229  	return reflect.TypeOf((*map[string]*HumanTaskUI)(nil)).Elem()
   230  }
   231  
   232  func (i HumanTaskUIMap) ToHumanTaskUIMapOutput() HumanTaskUIMapOutput {
   233  	return i.ToHumanTaskUIMapOutputWithContext(context.Background())
   234  }
   235  
   236  func (i HumanTaskUIMap) ToHumanTaskUIMapOutputWithContext(ctx context.Context) HumanTaskUIMapOutput {
   237  	return pulumi.ToOutputWithContext(ctx, i).(HumanTaskUIMapOutput)
   238  }
   239  
   240  type HumanTaskUIOutput struct{ *pulumi.OutputState }
   241  
   242  func (HumanTaskUIOutput) ElementType() reflect.Type {
   243  	return reflect.TypeOf((**HumanTaskUI)(nil)).Elem()
   244  }
   245  
   246  func (o HumanTaskUIOutput) ToHumanTaskUIOutput() HumanTaskUIOutput {
   247  	return o
   248  }
   249  
   250  func (o HumanTaskUIOutput) ToHumanTaskUIOutputWithContext(ctx context.Context) HumanTaskUIOutput {
   251  	return o
   252  }
   253  
   254  // The Amazon Resource Name (ARN) assigned by AWS to this Human Task UI.
   255  func (o HumanTaskUIOutput) Arn() pulumi.StringOutput {
   256  	return o.ApplyT(func(v *HumanTaskUI) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   257  }
   258  
   259  // The name of the Human Task UI.
   260  func (o HumanTaskUIOutput) HumanTaskUiName() pulumi.StringOutput {
   261  	return o.ApplyT(func(v *HumanTaskUI) pulumi.StringOutput { return v.HumanTaskUiName }).(pulumi.StringOutput)
   262  }
   263  
   264  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   265  func (o HumanTaskUIOutput) Tags() pulumi.StringMapOutput {
   266  	return o.ApplyT(func(v *HumanTaskUI) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   267  }
   268  
   269  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   270  //
   271  // Deprecated: Please use `tags` instead.
   272  func (o HumanTaskUIOutput) TagsAll() pulumi.StringMapOutput {
   273  	return o.ApplyT(func(v *HumanTaskUI) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   274  }
   275  
   276  // The Liquid template for the worker user interface. See UI Template below.
   277  func (o HumanTaskUIOutput) UiTemplate() HumanTaskUIUiTemplateOutput {
   278  	return o.ApplyT(func(v *HumanTaskUI) HumanTaskUIUiTemplateOutput { return v.UiTemplate }).(HumanTaskUIUiTemplateOutput)
   279  }
   280  
   281  type HumanTaskUIArrayOutput struct{ *pulumi.OutputState }
   282  
   283  func (HumanTaskUIArrayOutput) ElementType() reflect.Type {
   284  	return reflect.TypeOf((*[]*HumanTaskUI)(nil)).Elem()
   285  }
   286  
   287  func (o HumanTaskUIArrayOutput) ToHumanTaskUIArrayOutput() HumanTaskUIArrayOutput {
   288  	return o
   289  }
   290  
   291  func (o HumanTaskUIArrayOutput) ToHumanTaskUIArrayOutputWithContext(ctx context.Context) HumanTaskUIArrayOutput {
   292  	return o
   293  }
   294  
   295  func (o HumanTaskUIArrayOutput) Index(i pulumi.IntInput) HumanTaskUIOutput {
   296  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HumanTaskUI {
   297  		return vs[0].([]*HumanTaskUI)[vs[1].(int)]
   298  	}).(HumanTaskUIOutput)
   299  }
   300  
   301  type HumanTaskUIMapOutput struct{ *pulumi.OutputState }
   302  
   303  func (HumanTaskUIMapOutput) ElementType() reflect.Type {
   304  	return reflect.TypeOf((*map[string]*HumanTaskUI)(nil)).Elem()
   305  }
   306  
   307  func (o HumanTaskUIMapOutput) ToHumanTaskUIMapOutput() HumanTaskUIMapOutput {
   308  	return o
   309  }
   310  
   311  func (o HumanTaskUIMapOutput) ToHumanTaskUIMapOutputWithContext(ctx context.Context) HumanTaskUIMapOutput {
   312  	return o
   313  }
   314  
   315  func (o HumanTaskUIMapOutput) MapIndex(k pulumi.StringInput) HumanTaskUIOutput {
   316  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HumanTaskUI {
   317  		return vs[0].(map[string]*HumanTaskUI)[vs[1].(string)]
   318  	}).(HumanTaskUIOutput)
   319  }
   320  
   321  func init() {
   322  	pulumi.RegisterInputType(reflect.TypeOf((*HumanTaskUIInput)(nil)).Elem(), &HumanTaskUI{})
   323  	pulumi.RegisterInputType(reflect.TypeOf((*HumanTaskUIArrayInput)(nil)).Elem(), HumanTaskUIArray{})
   324  	pulumi.RegisterInputType(reflect.TypeOf((*HumanTaskUIMapInput)(nil)).Elem(), HumanTaskUIMap{})
   325  	pulumi.RegisterOutputType(HumanTaskUIOutput{})
   326  	pulumi.RegisterOutputType(HumanTaskUIArrayOutput{})
   327  	pulumi.RegisterOutputType(HumanTaskUIMapOutput{})
   328  }