generated from pulumi/pulumi-tf-provider-boilerplate
/
iotRoute.go
321 lines (267 loc) · 10.1 KB
/
iotRoute.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
// 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 scaleway
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type IotRoute struct {
pulumi.CustomResourceState
// The date and time of the creation of the IoT Route
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// Database Route parameters
Database IotRouteDatabasePtrOutput `pulumi:"database"`
// The ID of the route's hub
HubId pulumi.StringOutput `pulumi:"hubId"`
// The name of the route
Name pulumi.StringOutput `pulumi:"name"`
// The region you want to attach the resource to
Region pulumi.StringOutput `pulumi:"region"`
// Rest Route parameters
Rest IotRouteRestPtrOutput `pulumi:"rest"`
// S3 Route parameters
S3 IotRouteS3PtrOutput `pulumi:"s3"`
// The Topic the route subscribes to (wildcards allowed)
Topic pulumi.StringOutput `pulumi:"topic"`
}
// NewIotRoute registers a new resource with the given unique name, arguments, and options.
func NewIotRoute(ctx *pulumi.Context,
name string, args *IotRouteArgs, opts ...pulumi.ResourceOption) (*IotRoute, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.HubId == nil {
return nil, errors.New("invalid value for required argument 'HubId'")
}
if args.Topic == nil {
return nil, errors.New("invalid value for required argument 'Topic'")
}
opts = pkgResourceDefaultOpts(opts)
var resource IotRoute
err := ctx.RegisterResource("scaleway:index/iotRoute:IotRoute", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetIotRoute gets an existing IotRoute 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 GetIotRoute(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *IotRouteState, opts ...pulumi.ResourceOption) (*IotRoute, error) {
var resource IotRoute
err := ctx.ReadResource("scaleway:index/iotRoute:IotRoute", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering IotRoute resources.
type iotRouteState struct {
// The date and time of the creation of the IoT Route
CreatedAt *string `pulumi:"createdAt"`
// Database Route parameters
Database *IotRouteDatabase `pulumi:"database"`
// The ID of the route's hub
HubId *string `pulumi:"hubId"`
// The name of the route
Name *string `pulumi:"name"`
// The region you want to attach the resource to
Region *string `pulumi:"region"`
// Rest Route parameters
Rest *IotRouteRest `pulumi:"rest"`
// S3 Route parameters
S3 *IotRouteS3 `pulumi:"s3"`
// The Topic the route subscribes to (wildcards allowed)
Topic *string `pulumi:"topic"`
}
type IotRouteState struct {
// The date and time of the creation of the IoT Route
CreatedAt pulumi.StringPtrInput
// Database Route parameters
Database IotRouteDatabasePtrInput
// The ID of the route's hub
HubId pulumi.StringPtrInput
// The name of the route
Name pulumi.StringPtrInput
// The region you want to attach the resource to
Region pulumi.StringPtrInput
// Rest Route parameters
Rest IotRouteRestPtrInput
// S3 Route parameters
S3 IotRouteS3PtrInput
// The Topic the route subscribes to (wildcards allowed)
Topic pulumi.StringPtrInput
}
func (IotRouteState) ElementType() reflect.Type {
return reflect.TypeOf((*iotRouteState)(nil)).Elem()
}
type iotRouteArgs struct {
// Database Route parameters
Database *IotRouteDatabase `pulumi:"database"`
// The ID of the route's hub
HubId string `pulumi:"hubId"`
// The name of the route
Name *string `pulumi:"name"`
// The region you want to attach the resource to
Region *string `pulumi:"region"`
// Rest Route parameters
Rest *IotRouteRest `pulumi:"rest"`
// S3 Route parameters
S3 *IotRouteS3 `pulumi:"s3"`
// The Topic the route subscribes to (wildcards allowed)
Topic string `pulumi:"topic"`
}
// The set of arguments for constructing a IotRoute resource.
type IotRouteArgs struct {
// Database Route parameters
Database IotRouteDatabasePtrInput
// The ID of the route's hub
HubId pulumi.StringInput
// The name of the route
Name pulumi.StringPtrInput
// The region you want to attach the resource to
Region pulumi.StringPtrInput
// Rest Route parameters
Rest IotRouteRestPtrInput
// S3 Route parameters
S3 IotRouteS3PtrInput
// The Topic the route subscribes to (wildcards allowed)
Topic pulumi.StringInput
}
func (IotRouteArgs) ElementType() reflect.Type {
return reflect.TypeOf((*iotRouteArgs)(nil)).Elem()
}
type IotRouteInput interface {
pulumi.Input
ToIotRouteOutput() IotRouteOutput
ToIotRouteOutputWithContext(ctx context.Context) IotRouteOutput
}
func (*IotRoute) ElementType() reflect.Type {
return reflect.TypeOf((**IotRoute)(nil)).Elem()
}
func (i *IotRoute) ToIotRouteOutput() IotRouteOutput {
return i.ToIotRouteOutputWithContext(context.Background())
}
func (i *IotRoute) ToIotRouteOutputWithContext(ctx context.Context) IotRouteOutput {
return pulumi.ToOutputWithContext(ctx, i).(IotRouteOutput)
}
// IotRouteArrayInput is an input type that accepts IotRouteArray and IotRouteArrayOutput values.
// You can construct a concrete instance of `IotRouteArrayInput` via:
//
// IotRouteArray{ IotRouteArgs{...} }
type IotRouteArrayInput interface {
pulumi.Input
ToIotRouteArrayOutput() IotRouteArrayOutput
ToIotRouteArrayOutputWithContext(context.Context) IotRouteArrayOutput
}
type IotRouteArray []IotRouteInput
func (IotRouteArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IotRoute)(nil)).Elem()
}
func (i IotRouteArray) ToIotRouteArrayOutput() IotRouteArrayOutput {
return i.ToIotRouteArrayOutputWithContext(context.Background())
}
func (i IotRouteArray) ToIotRouteArrayOutputWithContext(ctx context.Context) IotRouteArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(IotRouteArrayOutput)
}
// IotRouteMapInput is an input type that accepts IotRouteMap and IotRouteMapOutput values.
// You can construct a concrete instance of `IotRouteMapInput` via:
//
// IotRouteMap{ "key": IotRouteArgs{...} }
type IotRouteMapInput interface {
pulumi.Input
ToIotRouteMapOutput() IotRouteMapOutput
ToIotRouteMapOutputWithContext(context.Context) IotRouteMapOutput
}
type IotRouteMap map[string]IotRouteInput
func (IotRouteMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IotRoute)(nil)).Elem()
}
func (i IotRouteMap) ToIotRouteMapOutput() IotRouteMapOutput {
return i.ToIotRouteMapOutputWithContext(context.Background())
}
func (i IotRouteMap) ToIotRouteMapOutputWithContext(ctx context.Context) IotRouteMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(IotRouteMapOutput)
}
type IotRouteOutput struct{ *pulumi.OutputState }
func (IotRouteOutput) ElementType() reflect.Type {
return reflect.TypeOf((**IotRoute)(nil)).Elem()
}
func (o IotRouteOutput) ToIotRouteOutput() IotRouteOutput {
return o
}
func (o IotRouteOutput) ToIotRouteOutputWithContext(ctx context.Context) IotRouteOutput {
return o
}
// The date and time of the creation of the IoT Route
func (o IotRouteOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *IotRoute) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// Database Route parameters
func (o IotRouteOutput) Database() IotRouteDatabasePtrOutput {
return o.ApplyT(func(v *IotRoute) IotRouteDatabasePtrOutput { return v.Database }).(IotRouteDatabasePtrOutput)
}
// The ID of the route's hub
func (o IotRouteOutput) HubId() pulumi.StringOutput {
return o.ApplyT(func(v *IotRoute) pulumi.StringOutput { return v.HubId }).(pulumi.StringOutput)
}
// The name of the route
func (o IotRouteOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *IotRoute) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The region you want to attach the resource to
func (o IotRouteOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *IotRoute) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// Rest Route parameters
func (o IotRouteOutput) Rest() IotRouteRestPtrOutput {
return o.ApplyT(func(v *IotRoute) IotRouteRestPtrOutput { return v.Rest }).(IotRouteRestPtrOutput)
}
// S3 Route parameters
func (o IotRouteOutput) S3() IotRouteS3PtrOutput {
return o.ApplyT(func(v *IotRoute) IotRouteS3PtrOutput { return v.S3 }).(IotRouteS3PtrOutput)
}
// The Topic the route subscribes to (wildcards allowed)
func (o IotRouteOutput) Topic() pulumi.StringOutput {
return o.ApplyT(func(v *IotRoute) pulumi.StringOutput { return v.Topic }).(pulumi.StringOutput)
}
type IotRouteArrayOutput struct{ *pulumi.OutputState }
func (IotRouteArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*IotRoute)(nil)).Elem()
}
func (o IotRouteArrayOutput) ToIotRouteArrayOutput() IotRouteArrayOutput {
return o
}
func (o IotRouteArrayOutput) ToIotRouteArrayOutputWithContext(ctx context.Context) IotRouteArrayOutput {
return o
}
func (o IotRouteArrayOutput) Index(i pulumi.IntInput) IotRouteOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IotRoute {
return vs[0].([]*IotRoute)[vs[1].(int)]
}).(IotRouteOutput)
}
type IotRouteMapOutput struct{ *pulumi.OutputState }
func (IotRouteMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*IotRoute)(nil)).Elem()
}
func (o IotRouteMapOutput) ToIotRouteMapOutput() IotRouteMapOutput {
return o
}
func (o IotRouteMapOutput) ToIotRouteMapOutputWithContext(ctx context.Context) IotRouteMapOutput {
return o
}
func (o IotRouteMapOutput) MapIndex(k pulumi.StringInput) IotRouteOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IotRoute {
return vs[0].(map[string]*IotRoute)[vs[1].(string)]
}).(IotRouteOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*IotRouteInput)(nil)).Elem(), &IotRoute{})
pulumi.RegisterInputType(reflect.TypeOf((*IotRouteArrayInput)(nil)).Elem(), IotRouteArray{})
pulumi.RegisterInputType(reflect.TypeOf((*IotRouteMapInput)(nil)).Elem(), IotRouteMap{})
pulumi.RegisterOutputType(IotRouteOutput{})
pulumi.RegisterOutputType(IotRouteArrayOutput{})
pulumi.RegisterOutputType(IotRouteMapOutput{})
}