/
slotType.go
423 lines (368 loc) · 17.9 KB
/
slotType.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package lex
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an Amazon Lex Slot Type resource. For more information see
// [Amazon Lex: How It Works](https://docs.aws.amazon.com/lex/latest/dg/how-it-works.html)
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/lex"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := lex.NewSlotType(ctx, "flowerTypes", &lex.SlotTypeArgs{
// CreateVersion: pulumi.Bool(true),
// Description: pulumi.String("Types of flowers to order"),
// EnumerationValues: lex.SlotTypeEnumerationValueArray{
// &lex.SlotTypeEnumerationValueArgs{
// Synonyms: pulumi.StringArray{
// pulumi.String("Lirium"),
// pulumi.String("Martagon"),
// },
// Value: pulumi.String("lilies"),
// },
// &lex.SlotTypeEnumerationValueArgs{
// Synonyms: pulumi.StringArray{
// pulumi.String("Eduardoregelia"),
// pulumi.String("Podonix"),
// },
// Value: pulumi.String("tulips"),
// },
// },
// Name: pulumi.String("FlowerTypes"),
// ValueSelectionStrategy: pulumi.String("ORIGINAL_VALUE"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Slot types can be imported using their name.
//
// ```sh
//
// $ pulumi import aws:lex/slotType:SlotType flower_types FlowerTypes
//
// ```
type SlotType struct {
pulumi.CustomResourceState
// Checksum identifying the version of the slot type that was created. The checksum is
// not included as an argument because the resource will add it automatically when updating the slot type.
Checksum pulumi.StringOutput `pulumi:"checksum"`
// Determines if a new slot type version is created when the initial resource is created and on each
// update. Defaults to `false`.
CreateVersion pulumi.BoolPtrOutput `pulumi:"createVersion"`
// The date when the slot type version was created.
CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
// A description of the slot type. Must be less than or equal to 200 characters in length.
Description pulumi.StringPtrOutput `pulumi:"description"`
// A list of EnumerationValue objects that defines the values that
// the slot type can take. Each value can have a list of synonyms, which are additional values that help
// train the machine learning model about the values that it resolves for a slot. Attributes are
// documented under enumeration_value.
EnumerationValues SlotTypeEnumerationValueArrayOutput `pulumi:"enumerationValues"`
// The date when the `$LATEST` version of this slot type was updated.
LastUpdatedDate pulumi.StringOutput `pulumi:"lastUpdatedDate"`
// The name of the slot type. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name pulumi.StringOutput `pulumi:"name"`
// Determines the slot resolution strategy that Amazon Lex
// uses to return slot type values. `ORIGINAL_VALUE` returns the value entered by the user if the user
// value is similar to the slot value. `TOP_RESOLUTION` returns the first value in the resolution list
// if there is a resolution list for the slot, otherwise null is returned. Defaults to `ORIGINAL_VALUE`.
ValueSelectionStrategy pulumi.StringPtrOutput `pulumi:"valueSelectionStrategy"`
// The version of the slot type.
Version pulumi.StringOutput `pulumi:"version"`
}
// NewSlotType registers a new resource with the given unique name, arguments, and options.
func NewSlotType(ctx *pulumi.Context,
name string, args *SlotTypeArgs, opts ...pulumi.ResourceOption) (*SlotType, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.EnumerationValues == nil {
return nil, errors.New("invalid value for required argument 'EnumerationValues'")
}
var resource SlotType
err := ctx.RegisterResource("aws:lex/slotType:SlotType", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSlotType gets an existing SlotType resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSlotType(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SlotTypeState, opts ...pulumi.ResourceOption) (*SlotType, error) {
var resource SlotType
err := ctx.ReadResource("aws:lex/slotType:SlotType", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SlotType resources.
type slotTypeState struct {
// Checksum identifying the version of the slot type that was created. The checksum is
// not included as an argument because the resource will add it automatically when updating the slot type.
Checksum *string `pulumi:"checksum"`
// Determines if a new slot type version is created when the initial resource is created and on each
// update. Defaults to `false`.
CreateVersion *bool `pulumi:"createVersion"`
// The date when the slot type version was created.
CreatedDate *string `pulumi:"createdDate"`
// A description of the slot type. Must be less than or equal to 200 characters in length.
Description *string `pulumi:"description"`
// A list of EnumerationValue objects that defines the values that
// the slot type can take. Each value can have a list of synonyms, which are additional values that help
// train the machine learning model about the values that it resolves for a slot. Attributes are
// documented under enumeration_value.
EnumerationValues []SlotTypeEnumerationValue `pulumi:"enumerationValues"`
// The date when the `$LATEST` version of this slot type was updated.
LastUpdatedDate *string `pulumi:"lastUpdatedDate"`
// The name of the slot type. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name *string `pulumi:"name"`
// Determines the slot resolution strategy that Amazon Lex
// uses to return slot type values. `ORIGINAL_VALUE` returns the value entered by the user if the user
// value is similar to the slot value. `TOP_RESOLUTION` returns the first value in the resolution list
// if there is a resolution list for the slot, otherwise null is returned. Defaults to `ORIGINAL_VALUE`.
ValueSelectionStrategy *string `pulumi:"valueSelectionStrategy"`
// The version of the slot type.
Version *string `pulumi:"version"`
}
type SlotTypeState struct {
// Checksum identifying the version of the slot type that was created. The checksum is
// not included as an argument because the resource will add it automatically when updating the slot type.
Checksum pulumi.StringPtrInput
// Determines if a new slot type version is created when the initial resource is created and on each
// update. Defaults to `false`.
CreateVersion pulumi.BoolPtrInput
// The date when the slot type version was created.
CreatedDate pulumi.StringPtrInput
// A description of the slot type. Must be less than or equal to 200 characters in length.
Description pulumi.StringPtrInput
// A list of EnumerationValue objects that defines the values that
// the slot type can take. Each value can have a list of synonyms, which are additional values that help
// train the machine learning model about the values that it resolves for a slot. Attributes are
// documented under enumeration_value.
EnumerationValues SlotTypeEnumerationValueArrayInput
// The date when the `$LATEST` version of this slot type was updated.
LastUpdatedDate pulumi.StringPtrInput
// The name of the slot type. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name pulumi.StringPtrInput
// Determines the slot resolution strategy that Amazon Lex
// uses to return slot type values. `ORIGINAL_VALUE` returns the value entered by the user if the user
// value is similar to the slot value. `TOP_RESOLUTION` returns the first value in the resolution list
// if there is a resolution list for the slot, otherwise null is returned. Defaults to `ORIGINAL_VALUE`.
ValueSelectionStrategy pulumi.StringPtrInput
// The version of the slot type.
Version pulumi.StringPtrInput
}
func (SlotTypeState) ElementType() reflect.Type {
return reflect.TypeOf((*slotTypeState)(nil)).Elem()
}
type slotTypeArgs struct {
// Determines if a new slot type version is created when the initial resource is created and on each
// update. Defaults to `false`.
CreateVersion *bool `pulumi:"createVersion"`
// A description of the slot type. Must be less than or equal to 200 characters in length.
Description *string `pulumi:"description"`
// A list of EnumerationValue objects that defines the values that
// the slot type can take. Each value can have a list of synonyms, which are additional values that help
// train the machine learning model about the values that it resolves for a slot. Attributes are
// documented under enumeration_value.
EnumerationValues []SlotTypeEnumerationValue `pulumi:"enumerationValues"`
// The name of the slot type. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name *string `pulumi:"name"`
// Determines the slot resolution strategy that Amazon Lex
// uses to return slot type values. `ORIGINAL_VALUE` returns the value entered by the user if the user
// value is similar to the slot value. `TOP_RESOLUTION` returns the first value in the resolution list
// if there is a resolution list for the slot, otherwise null is returned. Defaults to `ORIGINAL_VALUE`.
ValueSelectionStrategy *string `pulumi:"valueSelectionStrategy"`
}
// The set of arguments for constructing a SlotType resource.
type SlotTypeArgs struct {
// Determines if a new slot type version is created when the initial resource is created and on each
// update. Defaults to `false`.
CreateVersion pulumi.BoolPtrInput
// A description of the slot type. Must be less than or equal to 200 characters in length.
Description pulumi.StringPtrInput
// A list of EnumerationValue objects that defines the values that
// the slot type can take. Each value can have a list of synonyms, which are additional values that help
// train the machine learning model about the values that it resolves for a slot. Attributes are
// documented under enumeration_value.
EnumerationValues SlotTypeEnumerationValueArrayInput
// The name of the slot type. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name pulumi.StringPtrInput
// Determines the slot resolution strategy that Amazon Lex
// uses to return slot type values. `ORIGINAL_VALUE` returns the value entered by the user if the user
// value is similar to the slot value. `TOP_RESOLUTION` returns the first value in the resolution list
// if there is a resolution list for the slot, otherwise null is returned. Defaults to `ORIGINAL_VALUE`.
ValueSelectionStrategy pulumi.StringPtrInput
}
func (SlotTypeArgs) ElementType() reflect.Type {
return reflect.TypeOf((*slotTypeArgs)(nil)).Elem()
}
type SlotTypeInput interface {
pulumi.Input
ToSlotTypeOutput() SlotTypeOutput
ToSlotTypeOutputWithContext(ctx context.Context) SlotTypeOutput
}
func (*SlotType) ElementType() reflect.Type {
return reflect.TypeOf((**SlotType)(nil)).Elem()
}
func (i *SlotType) ToSlotTypeOutput() SlotTypeOutput {
return i.ToSlotTypeOutputWithContext(context.Background())
}
func (i *SlotType) ToSlotTypeOutputWithContext(ctx context.Context) SlotTypeOutput {
return pulumi.ToOutputWithContext(ctx, i).(SlotTypeOutput)
}
// SlotTypeArrayInput is an input type that accepts SlotTypeArray and SlotTypeArrayOutput values.
// You can construct a concrete instance of `SlotTypeArrayInput` via:
//
// SlotTypeArray{ SlotTypeArgs{...} }
type SlotTypeArrayInput interface {
pulumi.Input
ToSlotTypeArrayOutput() SlotTypeArrayOutput
ToSlotTypeArrayOutputWithContext(context.Context) SlotTypeArrayOutput
}
type SlotTypeArray []SlotTypeInput
func (SlotTypeArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SlotType)(nil)).Elem()
}
func (i SlotTypeArray) ToSlotTypeArrayOutput() SlotTypeArrayOutput {
return i.ToSlotTypeArrayOutputWithContext(context.Background())
}
func (i SlotTypeArray) ToSlotTypeArrayOutputWithContext(ctx context.Context) SlotTypeArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SlotTypeArrayOutput)
}
// SlotTypeMapInput is an input type that accepts SlotTypeMap and SlotTypeMapOutput values.
// You can construct a concrete instance of `SlotTypeMapInput` via:
//
// SlotTypeMap{ "key": SlotTypeArgs{...} }
type SlotTypeMapInput interface {
pulumi.Input
ToSlotTypeMapOutput() SlotTypeMapOutput
ToSlotTypeMapOutputWithContext(context.Context) SlotTypeMapOutput
}
type SlotTypeMap map[string]SlotTypeInput
func (SlotTypeMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SlotType)(nil)).Elem()
}
func (i SlotTypeMap) ToSlotTypeMapOutput() SlotTypeMapOutput {
return i.ToSlotTypeMapOutputWithContext(context.Background())
}
func (i SlotTypeMap) ToSlotTypeMapOutputWithContext(ctx context.Context) SlotTypeMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SlotTypeMapOutput)
}
type SlotTypeOutput struct{ *pulumi.OutputState }
func (SlotTypeOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SlotType)(nil)).Elem()
}
func (o SlotTypeOutput) ToSlotTypeOutput() SlotTypeOutput {
return o
}
func (o SlotTypeOutput) ToSlotTypeOutputWithContext(ctx context.Context) SlotTypeOutput {
return o
}
// Checksum identifying the version of the slot type that was created. The checksum is
// not included as an argument because the resource will add it automatically when updating the slot type.
func (o SlotTypeOutput) Checksum() pulumi.StringOutput {
return o.ApplyT(func(v *SlotType) pulumi.StringOutput { return v.Checksum }).(pulumi.StringOutput)
}
// Determines if a new slot type version is created when the initial resource is created and on each
// update. Defaults to `false`.
func (o SlotTypeOutput) CreateVersion() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *SlotType) pulumi.BoolPtrOutput { return v.CreateVersion }).(pulumi.BoolPtrOutput)
}
// The date when the slot type version was created.
func (o SlotTypeOutput) CreatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *SlotType) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
}
// A description of the slot type. Must be less than or equal to 200 characters in length.
func (o SlotTypeOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SlotType) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// A list of EnumerationValue objects that defines the values that
// the slot type can take. Each value can have a list of synonyms, which are additional values that help
// train the machine learning model about the values that it resolves for a slot. Attributes are
// documented under enumeration_value.
func (o SlotTypeOutput) EnumerationValues() SlotTypeEnumerationValueArrayOutput {
return o.ApplyT(func(v *SlotType) SlotTypeEnumerationValueArrayOutput { return v.EnumerationValues }).(SlotTypeEnumerationValueArrayOutput)
}
// The date when the `$LATEST` version of this slot type was updated.
func (o SlotTypeOutput) LastUpdatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *SlotType) pulumi.StringOutput { return v.LastUpdatedDate }).(pulumi.StringOutput)
}
// The name of the slot type. The name is not case sensitive. Must be less than or equal to 100 characters in length.
func (o SlotTypeOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SlotType) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Determines the slot resolution strategy that Amazon Lex
// uses to return slot type values. `ORIGINAL_VALUE` returns the value entered by the user if the user
// value is similar to the slot value. `TOP_RESOLUTION` returns the first value in the resolution list
// if there is a resolution list for the slot, otherwise null is returned. Defaults to `ORIGINAL_VALUE`.
func (o SlotTypeOutput) ValueSelectionStrategy() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SlotType) pulumi.StringPtrOutput { return v.ValueSelectionStrategy }).(pulumi.StringPtrOutput)
}
// The version of the slot type.
func (o SlotTypeOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v *SlotType) pulumi.StringOutput { return v.Version }).(pulumi.StringOutput)
}
type SlotTypeArrayOutput struct{ *pulumi.OutputState }
func (SlotTypeArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SlotType)(nil)).Elem()
}
func (o SlotTypeArrayOutput) ToSlotTypeArrayOutput() SlotTypeArrayOutput {
return o
}
func (o SlotTypeArrayOutput) ToSlotTypeArrayOutputWithContext(ctx context.Context) SlotTypeArrayOutput {
return o
}
func (o SlotTypeArrayOutput) Index(i pulumi.IntInput) SlotTypeOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SlotType {
return vs[0].([]*SlotType)[vs[1].(int)]
}).(SlotTypeOutput)
}
type SlotTypeMapOutput struct{ *pulumi.OutputState }
func (SlotTypeMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SlotType)(nil)).Elem()
}
func (o SlotTypeMapOutput) ToSlotTypeMapOutput() SlotTypeMapOutput {
return o
}
func (o SlotTypeMapOutput) ToSlotTypeMapOutputWithContext(ctx context.Context) SlotTypeMapOutput {
return o
}
func (o SlotTypeMapOutput) MapIndex(k pulumi.StringInput) SlotTypeOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SlotType {
return vs[0].(map[string]*SlotType)[vs[1].(string)]
}).(SlotTypeOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SlotTypeInput)(nil)).Elem(), &SlotType{})
pulumi.RegisterInputType(reflect.TypeOf((*SlotTypeArrayInput)(nil)).Elem(), SlotTypeArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SlotTypeMapInput)(nil)).Elem(), SlotTypeMap{})
pulumi.RegisterOutputType(SlotTypeOutput{})
pulumi.RegisterOutputType(SlotTypeArrayOutput{})
pulumi.RegisterOutputType(SlotTypeMapOutput{})
}