/
botAlias.go
364 lines (309 loc) · 13.1 KB
/
botAlias.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
// 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 Bot Alias 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.NewBotAlias(ctx, "orderFlowersProd", &lex.BotAliasArgs{
// BotName: pulumi.String("OrderFlowers"),
// BotVersion: pulumi.String("1"),
// Description: pulumi.String("Production Version of the OrderFlowers Bot."),
// Name: pulumi.String("OrderFlowersProd"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Bot aliases can be imported using an ID with the format `bot_name:bot_alias_name`.
//
// ```sh
//
// $ pulumi import aws:lex/botAlias:BotAlias order_flowers_prod OrderFlowers:OrderFlowersProd
//
// ```
type BotAlias struct {
pulumi.CustomResourceState
// The ARN of the bot alias.
Arn pulumi.StringOutput `pulumi:"arn"`
// The name of the bot.
BotName pulumi.StringOutput `pulumi:"botName"`
// The name of the bot.
BotVersion pulumi.StringOutput `pulumi:"botVersion"`
// Checksum of the bot alias.
Checksum pulumi.StringOutput `pulumi:"checksum"`
// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
ConversationLogs BotAliasConversationLogsPtrOutput `pulumi:"conversationLogs"`
// The date that the bot alias was created.
CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
// A description of the alias. Must be less than or equal to 200 characters in length.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The date that the bot alias was updated. When you create a resource, the creation date and the last updated date are the same.
LastUpdatedDate pulumi.StringOutput `pulumi:"lastUpdatedDate"`
// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewBotAlias registers a new resource with the given unique name, arguments, and options.
func NewBotAlias(ctx *pulumi.Context,
name string, args *BotAliasArgs, opts ...pulumi.ResourceOption) (*BotAlias, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.BotName == nil {
return nil, errors.New("invalid value for required argument 'BotName'")
}
if args.BotVersion == nil {
return nil, errors.New("invalid value for required argument 'BotVersion'")
}
var resource BotAlias
err := ctx.RegisterResource("aws:lex/botAlias:BotAlias", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBotAlias gets an existing BotAlias 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 GetBotAlias(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BotAliasState, opts ...pulumi.ResourceOption) (*BotAlias, error) {
var resource BotAlias
err := ctx.ReadResource("aws:lex/botAlias:BotAlias", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BotAlias resources.
type botAliasState struct {
// The ARN of the bot alias.
Arn *string `pulumi:"arn"`
// The name of the bot.
BotName *string `pulumi:"botName"`
// The name of the bot.
BotVersion *string `pulumi:"botVersion"`
// Checksum of the bot alias.
Checksum *string `pulumi:"checksum"`
// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
ConversationLogs *BotAliasConversationLogs `pulumi:"conversationLogs"`
// The date that the bot alias was created.
CreatedDate *string `pulumi:"createdDate"`
// A description of the alias. Must be less than or equal to 200 characters in length.
Description *string `pulumi:"description"`
// The date that the bot alias was updated. When you create a resource, the creation date and the last updated date are the same.
LastUpdatedDate *string `pulumi:"lastUpdatedDate"`
// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name *string `pulumi:"name"`
}
type BotAliasState struct {
// The ARN of the bot alias.
Arn pulumi.StringPtrInput
// The name of the bot.
BotName pulumi.StringPtrInput
// The name of the bot.
BotVersion pulumi.StringPtrInput
// Checksum of the bot alias.
Checksum pulumi.StringPtrInput
// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
ConversationLogs BotAliasConversationLogsPtrInput
// The date that the bot alias was created.
CreatedDate pulumi.StringPtrInput
// A description of the alias. Must be less than or equal to 200 characters in length.
Description pulumi.StringPtrInput
// The date that the bot alias was updated. When you create a resource, the creation date and the last updated date are the same.
LastUpdatedDate pulumi.StringPtrInput
// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name pulumi.StringPtrInput
}
func (BotAliasState) ElementType() reflect.Type {
return reflect.TypeOf((*botAliasState)(nil)).Elem()
}
type botAliasArgs struct {
// The name of the bot.
BotName string `pulumi:"botName"`
// The name of the bot.
BotVersion string `pulumi:"botVersion"`
// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
ConversationLogs *BotAliasConversationLogs `pulumi:"conversationLogs"`
// A description of the alias. Must be less than or equal to 200 characters in length.
Description *string `pulumi:"description"`
// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a BotAlias resource.
type BotAliasArgs struct {
// The name of the bot.
BotName pulumi.StringInput
// The name of the bot.
BotVersion pulumi.StringInput
// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
ConversationLogs BotAliasConversationLogsPtrInput
// A description of the alias. Must be less than or equal to 200 characters in length.
Description pulumi.StringPtrInput
// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
Name pulumi.StringPtrInput
}
func (BotAliasArgs) ElementType() reflect.Type {
return reflect.TypeOf((*botAliasArgs)(nil)).Elem()
}
type BotAliasInput interface {
pulumi.Input
ToBotAliasOutput() BotAliasOutput
ToBotAliasOutputWithContext(ctx context.Context) BotAliasOutput
}
func (*BotAlias) ElementType() reflect.Type {
return reflect.TypeOf((**BotAlias)(nil)).Elem()
}
func (i *BotAlias) ToBotAliasOutput() BotAliasOutput {
return i.ToBotAliasOutputWithContext(context.Background())
}
func (i *BotAlias) ToBotAliasOutputWithContext(ctx context.Context) BotAliasOutput {
return pulumi.ToOutputWithContext(ctx, i).(BotAliasOutput)
}
// BotAliasArrayInput is an input type that accepts BotAliasArray and BotAliasArrayOutput values.
// You can construct a concrete instance of `BotAliasArrayInput` via:
//
// BotAliasArray{ BotAliasArgs{...} }
type BotAliasArrayInput interface {
pulumi.Input
ToBotAliasArrayOutput() BotAliasArrayOutput
ToBotAliasArrayOutputWithContext(context.Context) BotAliasArrayOutput
}
type BotAliasArray []BotAliasInput
func (BotAliasArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BotAlias)(nil)).Elem()
}
func (i BotAliasArray) ToBotAliasArrayOutput() BotAliasArrayOutput {
return i.ToBotAliasArrayOutputWithContext(context.Background())
}
func (i BotAliasArray) ToBotAliasArrayOutputWithContext(ctx context.Context) BotAliasArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BotAliasArrayOutput)
}
// BotAliasMapInput is an input type that accepts BotAliasMap and BotAliasMapOutput values.
// You can construct a concrete instance of `BotAliasMapInput` via:
//
// BotAliasMap{ "key": BotAliasArgs{...} }
type BotAliasMapInput interface {
pulumi.Input
ToBotAliasMapOutput() BotAliasMapOutput
ToBotAliasMapOutputWithContext(context.Context) BotAliasMapOutput
}
type BotAliasMap map[string]BotAliasInput
func (BotAliasMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BotAlias)(nil)).Elem()
}
func (i BotAliasMap) ToBotAliasMapOutput() BotAliasMapOutput {
return i.ToBotAliasMapOutputWithContext(context.Background())
}
func (i BotAliasMap) ToBotAliasMapOutputWithContext(ctx context.Context) BotAliasMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BotAliasMapOutput)
}
type BotAliasOutput struct{ *pulumi.OutputState }
func (BotAliasOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BotAlias)(nil)).Elem()
}
func (o BotAliasOutput) ToBotAliasOutput() BotAliasOutput {
return o
}
func (o BotAliasOutput) ToBotAliasOutputWithContext(ctx context.Context) BotAliasOutput {
return o
}
// The ARN of the bot alias.
func (o BotAliasOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// The name of the bot.
func (o BotAliasOutput) BotName() pulumi.StringOutput {
return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.BotName }).(pulumi.StringOutput)
}
// The name of the bot.
func (o BotAliasOutput) BotVersion() pulumi.StringOutput {
return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.BotVersion }).(pulumi.StringOutput)
}
// Checksum of the bot alias.
func (o BotAliasOutput) Checksum() pulumi.StringOutput {
return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.Checksum }).(pulumi.StringOutput)
}
// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
func (o BotAliasOutput) ConversationLogs() BotAliasConversationLogsPtrOutput {
return o.ApplyT(func(v *BotAlias) BotAliasConversationLogsPtrOutput { return v.ConversationLogs }).(BotAliasConversationLogsPtrOutput)
}
// The date that the bot alias was created.
func (o BotAliasOutput) CreatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
}
// A description of the alias. Must be less than or equal to 200 characters in length.
func (o BotAliasOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BotAlias) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The date that the bot alias was updated. When you create a resource, the creation date and the last updated date are the same.
func (o BotAliasOutput) LastUpdatedDate() pulumi.StringOutput {
return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.LastUpdatedDate }).(pulumi.StringOutput)
}
// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
func (o BotAliasOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type BotAliasArrayOutput struct{ *pulumi.OutputState }
func (BotAliasArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BotAlias)(nil)).Elem()
}
func (o BotAliasArrayOutput) ToBotAliasArrayOutput() BotAliasArrayOutput {
return o
}
func (o BotAliasArrayOutput) ToBotAliasArrayOutputWithContext(ctx context.Context) BotAliasArrayOutput {
return o
}
func (o BotAliasArrayOutput) Index(i pulumi.IntInput) BotAliasOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BotAlias {
return vs[0].([]*BotAlias)[vs[1].(int)]
}).(BotAliasOutput)
}
type BotAliasMapOutput struct{ *pulumi.OutputState }
func (BotAliasMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BotAlias)(nil)).Elem()
}
func (o BotAliasMapOutput) ToBotAliasMapOutput() BotAliasMapOutput {
return o
}
func (o BotAliasMapOutput) ToBotAliasMapOutputWithContext(ctx context.Context) BotAliasMapOutput {
return o
}
func (o BotAliasMapOutput) MapIndex(k pulumi.StringInput) BotAliasOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BotAlias {
return vs[0].(map[string]*BotAlias)[vs[1].(string)]
}).(BotAliasOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BotAliasInput)(nil)).Elem(), &BotAlias{})
pulumi.RegisterInputType(reflect.TypeOf((*BotAliasArrayInput)(nil)).Elem(), BotAliasArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BotAliasMapInput)(nil)).Elem(), BotAliasMap{})
pulumi.RegisterOutputType(BotAliasOutput{})
pulumi.RegisterOutputType(BotAliasArrayOutput{})
pulumi.RegisterOutputType(BotAliasMapOutput{})
}