/
thingType.go
326 lines (274 loc) · 11.8 KB
/
thingType.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
// 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 iot
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates and manages an AWS IoT Thing Type.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iot"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := iot.NewThingType(ctx, "foo", &iot.ThingTypeArgs{
// Name: pulumi.String("my_iot_thing"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import IOT Thing Types using the name. For example:
//
// ```sh
// $ pulumi import aws:iot/thingType:ThingType example example
// ```
type ThingType struct {
pulumi.CustomResourceState
// The ARN of the created AWS IoT Thing Type.
Arn pulumi.StringOutput `pulumi:"arn"`
// Whether the thing type is deprecated. If true, no new things could be associated with this type.
Deprecated pulumi.BoolPtrOutput `pulumi:"deprecated"`
// The name of the thing type.
Name pulumi.StringOutput `pulumi:"name"`
// , Configuration block that can contain the following properties of the thing type:
Properties ThingTypePropertiesPtrOutput `pulumi:"properties"`
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewThingType registers a new resource with the given unique name, arguments, and options.
func NewThingType(ctx *pulumi.Context,
name string, args *ThingTypeArgs, opts ...pulumi.ResourceOption) (*ThingType, error) {
if args == nil {
args = &ThingTypeArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ThingType
err := ctx.RegisterResource("aws:iot/thingType:ThingType", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetThingType gets an existing ThingType 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 GetThingType(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ThingTypeState, opts ...pulumi.ResourceOption) (*ThingType, error) {
var resource ThingType
err := ctx.ReadResource("aws:iot/thingType:ThingType", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ThingType resources.
type thingTypeState struct {
// The ARN of the created AWS IoT Thing Type.
Arn *string `pulumi:"arn"`
// Whether the thing type is deprecated. If true, no new things could be associated with this type.
Deprecated *bool `pulumi:"deprecated"`
// The name of the thing type.
Name *string `pulumi:"name"`
// , Configuration block that can contain the following properties of the thing type:
Properties *ThingTypeProperties `pulumi:"properties"`
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
Tags map[string]string `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll map[string]string `pulumi:"tagsAll"`
}
type ThingTypeState struct {
// The ARN of the created AWS IoT Thing Type.
Arn pulumi.StringPtrInput
// Whether the thing type is deprecated. If true, no new things could be associated with this type.
Deprecated pulumi.BoolPtrInput
// The name of the thing type.
Name pulumi.StringPtrInput
// , Configuration block that can contain the following properties of the thing type:
Properties ThingTypePropertiesPtrInput
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
Tags pulumi.StringMapInput
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapInput
}
func (ThingTypeState) ElementType() reflect.Type {
return reflect.TypeOf((*thingTypeState)(nil)).Elem()
}
type thingTypeArgs struct {
// Whether the thing type is deprecated. If true, no new things could be associated with this type.
Deprecated *bool `pulumi:"deprecated"`
// The name of the thing type.
Name *string `pulumi:"name"`
// , Configuration block that can contain the following properties of the thing type:
Properties *ThingTypeProperties `pulumi:"properties"`
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a ThingType resource.
type ThingTypeArgs struct {
// Whether the thing type is deprecated. If true, no new things could be associated with this type.
Deprecated pulumi.BoolPtrInput
// The name of the thing type.
Name pulumi.StringPtrInput
// , Configuration block that can contain the following properties of the thing type:
Properties ThingTypePropertiesPtrInput
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
Tags pulumi.StringMapInput
}
func (ThingTypeArgs) ElementType() reflect.Type {
return reflect.TypeOf((*thingTypeArgs)(nil)).Elem()
}
type ThingTypeInput interface {
pulumi.Input
ToThingTypeOutput() ThingTypeOutput
ToThingTypeOutputWithContext(ctx context.Context) ThingTypeOutput
}
func (*ThingType) ElementType() reflect.Type {
return reflect.TypeOf((**ThingType)(nil)).Elem()
}
func (i *ThingType) ToThingTypeOutput() ThingTypeOutput {
return i.ToThingTypeOutputWithContext(context.Background())
}
func (i *ThingType) ToThingTypeOutputWithContext(ctx context.Context) ThingTypeOutput {
return pulumi.ToOutputWithContext(ctx, i).(ThingTypeOutput)
}
// ThingTypeArrayInput is an input type that accepts ThingTypeArray and ThingTypeArrayOutput values.
// You can construct a concrete instance of `ThingTypeArrayInput` via:
//
// ThingTypeArray{ ThingTypeArgs{...} }
type ThingTypeArrayInput interface {
pulumi.Input
ToThingTypeArrayOutput() ThingTypeArrayOutput
ToThingTypeArrayOutputWithContext(context.Context) ThingTypeArrayOutput
}
type ThingTypeArray []ThingTypeInput
func (ThingTypeArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ThingType)(nil)).Elem()
}
func (i ThingTypeArray) ToThingTypeArrayOutput() ThingTypeArrayOutput {
return i.ToThingTypeArrayOutputWithContext(context.Background())
}
func (i ThingTypeArray) ToThingTypeArrayOutputWithContext(ctx context.Context) ThingTypeArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ThingTypeArrayOutput)
}
// ThingTypeMapInput is an input type that accepts ThingTypeMap and ThingTypeMapOutput values.
// You can construct a concrete instance of `ThingTypeMapInput` via:
//
// ThingTypeMap{ "key": ThingTypeArgs{...} }
type ThingTypeMapInput interface {
pulumi.Input
ToThingTypeMapOutput() ThingTypeMapOutput
ToThingTypeMapOutputWithContext(context.Context) ThingTypeMapOutput
}
type ThingTypeMap map[string]ThingTypeInput
func (ThingTypeMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ThingType)(nil)).Elem()
}
func (i ThingTypeMap) ToThingTypeMapOutput() ThingTypeMapOutput {
return i.ToThingTypeMapOutputWithContext(context.Background())
}
func (i ThingTypeMap) ToThingTypeMapOutputWithContext(ctx context.Context) ThingTypeMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ThingTypeMapOutput)
}
type ThingTypeOutput struct{ *pulumi.OutputState }
func (ThingTypeOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ThingType)(nil)).Elem()
}
func (o ThingTypeOutput) ToThingTypeOutput() ThingTypeOutput {
return o
}
func (o ThingTypeOutput) ToThingTypeOutputWithContext(ctx context.Context) ThingTypeOutput {
return o
}
// The ARN of the created AWS IoT Thing Type.
func (o ThingTypeOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *ThingType) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// Whether the thing type is deprecated. If true, no new things could be associated with this type.
func (o ThingTypeOutput) Deprecated() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *ThingType) pulumi.BoolPtrOutput { return v.Deprecated }).(pulumi.BoolPtrOutput)
}
// The name of the thing type.
func (o ThingTypeOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ThingType) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// , Configuration block that can contain the following properties of the thing type:
func (o ThingTypeOutput) Properties() ThingTypePropertiesPtrOutput {
return o.ApplyT(func(v *ThingType) ThingTypePropertiesPtrOutput { return v.Properties }).(ThingTypePropertiesPtrOutput)
}
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level
func (o ThingTypeOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *ThingType) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o ThingTypeOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *ThingType) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
type ThingTypeArrayOutput struct{ *pulumi.OutputState }
func (ThingTypeArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ThingType)(nil)).Elem()
}
func (o ThingTypeArrayOutput) ToThingTypeArrayOutput() ThingTypeArrayOutput {
return o
}
func (o ThingTypeArrayOutput) ToThingTypeArrayOutputWithContext(ctx context.Context) ThingTypeArrayOutput {
return o
}
func (o ThingTypeArrayOutput) Index(i pulumi.IntInput) ThingTypeOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ThingType {
return vs[0].([]*ThingType)[vs[1].(int)]
}).(ThingTypeOutput)
}
type ThingTypeMapOutput struct{ *pulumi.OutputState }
func (ThingTypeMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ThingType)(nil)).Elem()
}
func (o ThingTypeMapOutput) ToThingTypeMapOutput() ThingTypeMapOutput {
return o
}
func (o ThingTypeMapOutput) ToThingTypeMapOutputWithContext(ctx context.Context) ThingTypeMapOutput {
return o
}
func (o ThingTypeMapOutput) MapIndex(k pulumi.StringInput) ThingTypeOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ThingType {
return vs[0].(map[string]*ThingType)[vs[1].(string)]
}).(ThingTypeOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ThingTypeInput)(nil)).Elem(), &ThingType{})
pulumi.RegisterInputType(reflect.TypeOf((*ThingTypeArrayInput)(nil)).Elem(), ThingTypeArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ThingTypeMapInput)(nil)).Elem(), ThingTypeMap{})
pulumi.RegisterOutputType(ThingTypeOutput{})
pulumi.RegisterOutputType(ThingTypeArrayOutput{})
pulumi.RegisterOutputType(ThingTypeMapOutput{})
}