github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lex/v2modelsBotVersion.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 lex
     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 an AWS Lex V2 Models Bot Version.
    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/lex"
    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 := lex.NewV2modelsBotVersion(ctx, "test", &lex.V2modelsBotVersionArgs{
    35  //				BotId: pulumi.Any(testAwsLexv2models.Id),
    36  //				LocaleSpecification: lex.V2modelsBotVersionLocaleSpecificationMap{
    37  //					"en_US": &lex.V2modelsBotVersionLocaleSpecificationArgs{
    38  //						SourceBotVersion: pulumi.String("DRAFT"),
    39  //					},
    40  //				},
    41  //			})
    42  //			if err != nil {
    43  //				return err
    44  //			}
    45  //			return nil
    46  //		})
    47  //	}
    48  //
    49  // ```
    50  // <!--End PulumiCodeChooser -->
    51  //
    52  // ## Import
    53  //
    54  // Using `pulumi import`, import Lex V2 Models Bot Version using the `id`. For example:
    55  //
    56  // ```sh
    57  // $ pulumi import aws:lex/v2modelsBotVersion:V2modelsBotVersion example id-12345678,1
    58  // ```
    59  type V2modelsBotVersion struct {
    60  	pulumi.CustomResourceState
    61  
    62  	// Idientifier of the bot to create the version for.
    63  	BotId pulumi.StringOutput `pulumi:"botId"`
    64  	// Version number assigned to the version.
    65  	BotVersion pulumi.StringOutput `pulumi:"botVersion"`
    66  	// A description of the version. Use the description to help identify the version in lists.
    67  	Description pulumi.StringPtrOutput `pulumi:"description"`
    68  	// Specifies the locales that Amazon Lex adds to this version. You can choose the draft version or any other previously published version for each locale. When you specify a source version, the locale data is copied from the source version to the new version.
    69  	//
    70  	// The attribute value is a map with one or more entries, each of which has a locale name as the key and an object with the following attribute as the value:
    71  	LocaleSpecification V2modelsBotVersionLocaleSpecificationMapOutput `pulumi:"localeSpecification"`
    72  	Timeouts            V2modelsBotVersionTimeoutsPtrOutput            `pulumi:"timeouts"`
    73  }
    74  
    75  // NewV2modelsBotVersion registers a new resource with the given unique name, arguments, and options.
    76  func NewV2modelsBotVersion(ctx *pulumi.Context,
    77  	name string, args *V2modelsBotVersionArgs, opts ...pulumi.ResourceOption) (*V2modelsBotVersion, error) {
    78  	if args == nil {
    79  		return nil, errors.New("missing one or more required arguments")
    80  	}
    81  
    82  	if args.BotId == nil {
    83  		return nil, errors.New("invalid value for required argument 'BotId'")
    84  	}
    85  	if args.LocaleSpecification == nil {
    86  		return nil, errors.New("invalid value for required argument 'LocaleSpecification'")
    87  	}
    88  	opts = internal.PkgResourceDefaultOpts(opts)
    89  	var resource V2modelsBotVersion
    90  	err := ctx.RegisterResource("aws:lex/v2modelsBotVersion:V2modelsBotVersion", name, args, &resource, opts...)
    91  	if err != nil {
    92  		return nil, err
    93  	}
    94  	return &resource, nil
    95  }
    96  
    97  // GetV2modelsBotVersion gets an existing V2modelsBotVersion resource's state with the given name, ID, and optional
    98  // state properties that are used to uniquely qualify the lookup (nil if not required).
    99  func GetV2modelsBotVersion(ctx *pulumi.Context,
   100  	name string, id pulumi.IDInput, state *V2modelsBotVersionState, opts ...pulumi.ResourceOption) (*V2modelsBotVersion, error) {
   101  	var resource V2modelsBotVersion
   102  	err := ctx.ReadResource("aws:lex/v2modelsBotVersion:V2modelsBotVersion", name, id, state, &resource, opts...)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	return &resource, nil
   107  }
   108  
   109  // Input properties used for looking up and filtering V2modelsBotVersion resources.
   110  type v2modelsBotVersionState struct {
   111  	// Idientifier of the bot to create the version for.
   112  	BotId *string `pulumi:"botId"`
   113  	// Version number assigned to the version.
   114  	BotVersion *string `pulumi:"botVersion"`
   115  	// A description of the version. Use the description to help identify the version in lists.
   116  	Description *string `pulumi:"description"`
   117  	// Specifies the locales that Amazon Lex adds to this version. You can choose the draft version or any other previously published version for each locale. When you specify a source version, the locale data is copied from the source version to the new version.
   118  	//
   119  	// The attribute value is a map with one or more entries, each of which has a locale name as the key and an object with the following attribute as the value:
   120  	LocaleSpecification map[string]V2modelsBotVersionLocaleSpecification `pulumi:"localeSpecification"`
   121  	Timeouts            *V2modelsBotVersionTimeouts                      `pulumi:"timeouts"`
   122  }
   123  
   124  type V2modelsBotVersionState struct {
   125  	// Idientifier of the bot to create the version for.
   126  	BotId pulumi.StringPtrInput
   127  	// Version number assigned to the version.
   128  	BotVersion pulumi.StringPtrInput
   129  	// A description of the version. Use the description to help identify the version in lists.
   130  	Description pulumi.StringPtrInput
   131  	// Specifies the locales that Amazon Lex adds to this version. You can choose the draft version or any other previously published version for each locale. When you specify a source version, the locale data is copied from the source version to the new version.
   132  	//
   133  	// The attribute value is a map with one or more entries, each of which has a locale name as the key and an object with the following attribute as the value:
   134  	LocaleSpecification V2modelsBotVersionLocaleSpecificationMapInput
   135  	Timeouts            V2modelsBotVersionTimeoutsPtrInput
   136  }
   137  
   138  func (V2modelsBotVersionState) ElementType() reflect.Type {
   139  	return reflect.TypeOf((*v2modelsBotVersionState)(nil)).Elem()
   140  }
   141  
   142  type v2modelsBotVersionArgs struct {
   143  	// Idientifier of the bot to create the version for.
   144  	BotId string `pulumi:"botId"`
   145  	// Version number assigned to the version.
   146  	BotVersion *string `pulumi:"botVersion"`
   147  	// A description of the version. Use the description to help identify the version in lists.
   148  	Description *string `pulumi:"description"`
   149  	// Specifies the locales that Amazon Lex adds to this version. You can choose the draft version or any other previously published version for each locale. When you specify a source version, the locale data is copied from the source version to the new version.
   150  	//
   151  	// The attribute value is a map with one or more entries, each of which has a locale name as the key and an object with the following attribute as the value:
   152  	LocaleSpecification map[string]V2modelsBotVersionLocaleSpecification `pulumi:"localeSpecification"`
   153  	Timeouts            *V2modelsBotVersionTimeouts                      `pulumi:"timeouts"`
   154  }
   155  
   156  // The set of arguments for constructing a V2modelsBotVersion resource.
   157  type V2modelsBotVersionArgs struct {
   158  	// Idientifier of the bot to create the version for.
   159  	BotId pulumi.StringInput
   160  	// Version number assigned to the version.
   161  	BotVersion pulumi.StringPtrInput
   162  	// A description of the version. Use the description to help identify the version in lists.
   163  	Description pulumi.StringPtrInput
   164  	// Specifies the locales that Amazon Lex adds to this version. You can choose the draft version or any other previously published version for each locale. When you specify a source version, the locale data is copied from the source version to the new version.
   165  	//
   166  	// The attribute value is a map with one or more entries, each of which has a locale name as the key and an object with the following attribute as the value:
   167  	LocaleSpecification V2modelsBotVersionLocaleSpecificationMapInput
   168  	Timeouts            V2modelsBotVersionTimeoutsPtrInput
   169  }
   170  
   171  func (V2modelsBotVersionArgs) ElementType() reflect.Type {
   172  	return reflect.TypeOf((*v2modelsBotVersionArgs)(nil)).Elem()
   173  }
   174  
   175  type V2modelsBotVersionInput interface {
   176  	pulumi.Input
   177  
   178  	ToV2modelsBotVersionOutput() V2modelsBotVersionOutput
   179  	ToV2modelsBotVersionOutputWithContext(ctx context.Context) V2modelsBotVersionOutput
   180  }
   181  
   182  func (*V2modelsBotVersion) ElementType() reflect.Type {
   183  	return reflect.TypeOf((**V2modelsBotVersion)(nil)).Elem()
   184  }
   185  
   186  func (i *V2modelsBotVersion) ToV2modelsBotVersionOutput() V2modelsBotVersionOutput {
   187  	return i.ToV2modelsBotVersionOutputWithContext(context.Background())
   188  }
   189  
   190  func (i *V2modelsBotVersion) ToV2modelsBotVersionOutputWithContext(ctx context.Context) V2modelsBotVersionOutput {
   191  	return pulumi.ToOutputWithContext(ctx, i).(V2modelsBotVersionOutput)
   192  }
   193  
   194  // V2modelsBotVersionArrayInput is an input type that accepts V2modelsBotVersionArray and V2modelsBotVersionArrayOutput values.
   195  // You can construct a concrete instance of `V2modelsBotVersionArrayInput` via:
   196  //
   197  //	V2modelsBotVersionArray{ V2modelsBotVersionArgs{...} }
   198  type V2modelsBotVersionArrayInput interface {
   199  	pulumi.Input
   200  
   201  	ToV2modelsBotVersionArrayOutput() V2modelsBotVersionArrayOutput
   202  	ToV2modelsBotVersionArrayOutputWithContext(context.Context) V2modelsBotVersionArrayOutput
   203  }
   204  
   205  type V2modelsBotVersionArray []V2modelsBotVersionInput
   206  
   207  func (V2modelsBotVersionArray) ElementType() reflect.Type {
   208  	return reflect.TypeOf((*[]*V2modelsBotVersion)(nil)).Elem()
   209  }
   210  
   211  func (i V2modelsBotVersionArray) ToV2modelsBotVersionArrayOutput() V2modelsBotVersionArrayOutput {
   212  	return i.ToV2modelsBotVersionArrayOutputWithContext(context.Background())
   213  }
   214  
   215  func (i V2modelsBotVersionArray) ToV2modelsBotVersionArrayOutputWithContext(ctx context.Context) V2modelsBotVersionArrayOutput {
   216  	return pulumi.ToOutputWithContext(ctx, i).(V2modelsBotVersionArrayOutput)
   217  }
   218  
   219  // V2modelsBotVersionMapInput is an input type that accepts V2modelsBotVersionMap and V2modelsBotVersionMapOutput values.
   220  // You can construct a concrete instance of `V2modelsBotVersionMapInput` via:
   221  //
   222  //	V2modelsBotVersionMap{ "key": V2modelsBotVersionArgs{...} }
   223  type V2modelsBotVersionMapInput interface {
   224  	pulumi.Input
   225  
   226  	ToV2modelsBotVersionMapOutput() V2modelsBotVersionMapOutput
   227  	ToV2modelsBotVersionMapOutputWithContext(context.Context) V2modelsBotVersionMapOutput
   228  }
   229  
   230  type V2modelsBotVersionMap map[string]V2modelsBotVersionInput
   231  
   232  func (V2modelsBotVersionMap) ElementType() reflect.Type {
   233  	return reflect.TypeOf((*map[string]*V2modelsBotVersion)(nil)).Elem()
   234  }
   235  
   236  func (i V2modelsBotVersionMap) ToV2modelsBotVersionMapOutput() V2modelsBotVersionMapOutput {
   237  	return i.ToV2modelsBotVersionMapOutputWithContext(context.Background())
   238  }
   239  
   240  func (i V2modelsBotVersionMap) ToV2modelsBotVersionMapOutputWithContext(ctx context.Context) V2modelsBotVersionMapOutput {
   241  	return pulumi.ToOutputWithContext(ctx, i).(V2modelsBotVersionMapOutput)
   242  }
   243  
   244  type V2modelsBotVersionOutput struct{ *pulumi.OutputState }
   245  
   246  func (V2modelsBotVersionOutput) ElementType() reflect.Type {
   247  	return reflect.TypeOf((**V2modelsBotVersion)(nil)).Elem()
   248  }
   249  
   250  func (o V2modelsBotVersionOutput) ToV2modelsBotVersionOutput() V2modelsBotVersionOutput {
   251  	return o
   252  }
   253  
   254  func (o V2modelsBotVersionOutput) ToV2modelsBotVersionOutputWithContext(ctx context.Context) V2modelsBotVersionOutput {
   255  	return o
   256  }
   257  
   258  // Idientifier of the bot to create the version for.
   259  func (o V2modelsBotVersionOutput) BotId() pulumi.StringOutput {
   260  	return o.ApplyT(func(v *V2modelsBotVersion) pulumi.StringOutput { return v.BotId }).(pulumi.StringOutput)
   261  }
   262  
   263  // Version number assigned to the version.
   264  func (o V2modelsBotVersionOutput) BotVersion() pulumi.StringOutput {
   265  	return o.ApplyT(func(v *V2modelsBotVersion) pulumi.StringOutput { return v.BotVersion }).(pulumi.StringOutput)
   266  }
   267  
   268  // A description of the version. Use the description to help identify the version in lists.
   269  func (o V2modelsBotVersionOutput) Description() pulumi.StringPtrOutput {
   270  	return o.ApplyT(func(v *V2modelsBotVersion) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   271  }
   272  
   273  // Specifies the locales that Amazon Lex adds to this version. You can choose the draft version or any other previously published version for each locale. When you specify a source version, the locale data is copied from the source version to the new version.
   274  //
   275  // The attribute value is a map with one or more entries, each of which has a locale name as the key and an object with the following attribute as the value:
   276  func (o V2modelsBotVersionOutput) LocaleSpecification() V2modelsBotVersionLocaleSpecificationMapOutput {
   277  	return o.ApplyT(func(v *V2modelsBotVersion) V2modelsBotVersionLocaleSpecificationMapOutput {
   278  		return v.LocaleSpecification
   279  	}).(V2modelsBotVersionLocaleSpecificationMapOutput)
   280  }
   281  
   282  func (o V2modelsBotVersionOutput) Timeouts() V2modelsBotVersionTimeoutsPtrOutput {
   283  	return o.ApplyT(func(v *V2modelsBotVersion) V2modelsBotVersionTimeoutsPtrOutput { return v.Timeouts }).(V2modelsBotVersionTimeoutsPtrOutput)
   284  }
   285  
   286  type V2modelsBotVersionArrayOutput struct{ *pulumi.OutputState }
   287  
   288  func (V2modelsBotVersionArrayOutput) ElementType() reflect.Type {
   289  	return reflect.TypeOf((*[]*V2modelsBotVersion)(nil)).Elem()
   290  }
   291  
   292  func (o V2modelsBotVersionArrayOutput) ToV2modelsBotVersionArrayOutput() V2modelsBotVersionArrayOutput {
   293  	return o
   294  }
   295  
   296  func (o V2modelsBotVersionArrayOutput) ToV2modelsBotVersionArrayOutputWithContext(ctx context.Context) V2modelsBotVersionArrayOutput {
   297  	return o
   298  }
   299  
   300  func (o V2modelsBotVersionArrayOutput) Index(i pulumi.IntInput) V2modelsBotVersionOutput {
   301  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *V2modelsBotVersion {
   302  		return vs[0].([]*V2modelsBotVersion)[vs[1].(int)]
   303  	}).(V2modelsBotVersionOutput)
   304  }
   305  
   306  type V2modelsBotVersionMapOutput struct{ *pulumi.OutputState }
   307  
   308  func (V2modelsBotVersionMapOutput) ElementType() reflect.Type {
   309  	return reflect.TypeOf((*map[string]*V2modelsBotVersion)(nil)).Elem()
   310  }
   311  
   312  func (o V2modelsBotVersionMapOutput) ToV2modelsBotVersionMapOutput() V2modelsBotVersionMapOutput {
   313  	return o
   314  }
   315  
   316  func (o V2modelsBotVersionMapOutput) ToV2modelsBotVersionMapOutputWithContext(ctx context.Context) V2modelsBotVersionMapOutput {
   317  	return o
   318  }
   319  
   320  func (o V2modelsBotVersionMapOutput) MapIndex(k pulumi.StringInput) V2modelsBotVersionOutput {
   321  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *V2modelsBotVersion {
   322  		return vs[0].(map[string]*V2modelsBotVersion)[vs[1].(string)]
   323  	}).(V2modelsBotVersionOutput)
   324  }
   325  
   326  func init() {
   327  	pulumi.RegisterInputType(reflect.TypeOf((*V2modelsBotVersionInput)(nil)).Elem(), &V2modelsBotVersion{})
   328  	pulumi.RegisterInputType(reflect.TypeOf((*V2modelsBotVersionArrayInput)(nil)).Elem(), V2modelsBotVersionArray{})
   329  	pulumi.RegisterInputType(reflect.TypeOf((*V2modelsBotVersionMapInput)(nil)).Elem(), V2modelsBotVersionMap{})
   330  	pulumi.RegisterOutputType(V2modelsBotVersionOutput{})
   331  	pulumi.RegisterOutputType(V2modelsBotVersionArrayOutput{})
   332  	pulumi.RegisterOutputType(V2modelsBotVersionMapOutput{})
   333  }