generated from pulumi/pulumi-tf-provider-boilerplate
/
eventBus.go
284 lines (233 loc) · 9.68 KB
/
eventBus.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
// 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 eb
import (
"context"
"reflect"
"errors"
"github.com/mergtil/pulumi-tencentcloud/sdk/go/tencentcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type EventBus struct {
pulumi.CustomResourceState
// Event set description, unlimited character type, description within 200 characters.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Whether the EB storage is enabled.
EnableStore pulumi.BoolPtrOutput `pulumi:"enableStore"`
// Event set name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a
// number or letter, 2~60 characters.
EventBusName pulumi.StringOutput `pulumi:"eventBusName"`
// EB storage duration.
SaveDays pulumi.IntPtrOutput `pulumi:"saveDays"`
// Tag description list.
Tags pulumi.MapOutput `pulumi:"tags"`
}
// NewEventBus registers a new resource with the given unique name, arguments, and options.
func NewEventBus(ctx *pulumi.Context,
name string, args *EventBusArgs, opts ...pulumi.ResourceOption) (*EventBus, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.EventBusName == nil {
return nil, errors.New("invalid value for required argument 'EventBusName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource EventBus
err := ctx.RegisterResource("tencentcloud:Eb/eventBus:EventBus", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEventBus gets an existing EventBus 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 GetEventBus(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EventBusState, opts ...pulumi.ResourceOption) (*EventBus, error) {
var resource EventBus
err := ctx.ReadResource("tencentcloud:Eb/eventBus:EventBus", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EventBus resources.
type eventBusState struct {
// Event set description, unlimited character type, description within 200 characters.
Description *string `pulumi:"description"`
// Whether the EB storage is enabled.
EnableStore *bool `pulumi:"enableStore"`
// Event set name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a
// number or letter, 2~60 characters.
EventBusName *string `pulumi:"eventBusName"`
// EB storage duration.
SaveDays *int `pulumi:"saveDays"`
// Tag description list.
Tags map[string]interface{} `pulumi:"tags"`
}
type EventBusState struct {
// Event set description, unlimited character type, description within 200 characters.
Description pulumi.StringPtrInput
// Whether the EB storage is enabled.
EnableStore pulumi.BoolPtrInput
// Event set name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a
// number or letter, 2~60 characters.
EventBusName pulumi.StringPtrInput
// EB storage duration.
SaveDays pulumi.IntPtrInput
// Tag description list.
Tags pulumi.MapInput
}
func (EventBusState) ElementType() reflect.Type {
return reflect.TypeOf((*eventBusState)(nil)).Elem()
}
type eventBusArgs struct {
// Event set description, unlimited character type, description within 200 characters.
Description *string `pulumi:"description"`
// Whether the EB storage is enabled.
EnableStore *bool `pulumi:"enableStore"`
// Event set name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a
// number or letter, 2~60 characters.
EventBusName string `pulumi:"eventBusName"`
// EB storage duration.
SaveDays *int `pulumi:"saveDays"`
// Tag description list.
Tags map[string]interface{} `pulumi:"tags"`
}
// The set of arguments for constructing a EventBus resource.
type EventBusArgs struct {
// Event set description, unlimited character type, description within 200 characters.
Description pulumi.StringPtrInput
// Whether the EB storage is enabled.
EnableStore pulumi.BoolPtrInput
// Event set name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a
// number or letter, 2~60 characters.
EventBusName pulumi.StringInput
// EB storage duration.
SaveDays pulumi.IntPtrInput
// Tag description list.
Tags pulumi.MapInput
}
func (EventBusArgs) ElementType() reflect.Type {
return reflect.TypeOf((*eventBusArgs)(nil)).Elem()
}
type EventBusInput interface {
pulumi.Input
ToEventBusOutput() EventBusOutput
ToEventBusOutputWithContext(ctx context.Context) EventBusOutput
}
func (*EventBus) ElementType() reflect.Type {
return reflect.TypeOf((**EventBus)(nil)).Elem()
}
func (i *EventBus) ToEventBusOutput() EventBusOutput {
return i.ToEventBusOutputWithContext(context.Background())
}
func (i *EventBus) ToEventBusOutputWithContext(ctx context.Context) EventBusOutput {
return pulumi.ToOutputWithContext(ctx, i).(EventBusOutput)
}
// EventBusArrayInput is an input type that accepts EventBusArray and EventBusArrayOutput values.
// You can construct a concrete instance of `EventBusArrayInput` via:
//
// EventBusArray{ EventBusArgs{...} }
type EventBusArrayInput interface {
pulumi.Input
ToEventBusArrayOutput() EventBusArrayOutput
ToEventBusArrayOutputWithContext(context.Context) EventBusArrayOutput
}
type EventBusArray []EventBusInput
func (EventBusArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EventBus)(nil)).Elem()
}
func (i EventBusArray) ToEventBusArrayOutput() EventBusArrayOutput {
return i.ToEventBusArrayOutputWithContext(context.Background())
}
func (i EventBusArray) ToEventBusArrayOutputWithContext(ctx context.Context) EventBusArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EventBusArrayOutput)
}
// EventBusMapInput is an input type that accepts EventBusMap and EventBusMapOutput values.
// You can construct a concrete instance of `EventBusMapInput` via:
//
// EventBusMap{ "key": EventBusArgs{...} }
type EventBusMapInput interface {
pulumi.Input
ToEventBusMapOutput() EventBusMapOutput
ToEventBusMapOutputWithContext(context.Context) EventBusMapOutput
}
type EventBusMap map[string]EventBusInput
func (EventBusMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EventBus)(nil)).Elem()
}
func (i EventBusMap) ToEventBusMapOutput() EventBusMapOutput {
return i.ToEventBusMapOutputWithContext(context.Background())
}
func (i EventBusMap) ToEventBusMapOutputWithContext(ctx context.Context) EventBusMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(EventBusMapOutput)
}
type EventBusOutput struct{ *pulumi.OutputState }
func (EventBusOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EventBus)(nil)).Elem()
}
func (o EventBusOutput) ToEventBusOutput() EventBusOutput {
return o
}
func (o EventBusOutput) ToEventBusOutputWithContext(ctx context.Context) EventBusOutput {
return o
}
// Event set description, unlimited character type, description within 200 characters.
func (o EventBusOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *EventBus) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Whether the EB storage is enabled.
func (o EventBusOutput) EnableStore() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *EventBus) pulumi.BoolPtrOutput { return v.EnableStore }).(pulumi.BoolPtrOutput)
}
// Event set name, which can only contain letters, numbers, underscores, hyphens, starts with a letter and ends with a
// number or letter, 2~60 characters.
func (o EventBusOutput) EventBusName() pulumi.StringOutput {
return o.ApplyT(func(v *EventBus) pulumi.StringOutput { return v.EventBusName }).(pulumi.StringOutput)
}
// EB storage duration.
func (o EventBusOutput) SaveDays() pulumi.IntPtrOutput {
return o.ApplyT(func(v *EventBus) pulumi.IntPtrOutput { return v.SaveDays }).(pulumi.IntPtrOutput)
}
// Tag description list.
func (o EventBusOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v *EventBus) pulumi.MapOutput { return v.Tags }).(pulumi.MapOutput)
}
type EventBusArrayOutput struct{ *pulumi.OutputState }
func (EventBusArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EventBus)(nil)).Elem()
}
func (o EventBusArrayOutput) ToEventBusArrayOutput() EventBusArrayOutput {
return o
}
func (o EventBusArrayOutput) ToEventBusArrayOutputWithContext(ctx context.Context) EventBusArrayOutput {
return o
}
func (o EventBusArrayOutput) Index(i pulumi.IntInput) EventBusOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EventBus {
return vs[0].([]*EventBus)[vs[1].(int)]
}).(EventBusOutput)
}
type EventBusMapOutput struct{ *pulumi.OutputState }
func (EventBusMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EventBus)(nil)).Elem()
}
func (o EventBusMapOutput) ToEventBusMapOutput() EventBusMapOutput {
return o
}
func (o EventBusMapOutput) ToEventBusMapOutputWithContext(ctx context.Context) EventBusMapOutput {
return o
}
func (o EventBusMapOutput) MapIndex(k pulumi.StringInput) EventBusOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EventBus {
return vs[0].(map[string]*EventBus)[vs[1].(string)]
}).(EventBusOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EventBusInput)(nil)).Elem(), &EventBus{})
pulumi.RegisterInputType(reflect.TypeOf((*EventBusArrayInput)(nil)).Elem(), EventBusArray{})
pulumi.RegisterInputType(reflect.TypeOf((*EventBusMapInput)(nil)).Elem(), EventBusMap{})
pulumi.RegisterOutputType(EventBusOutput{})
pulumi.RegisterOutputType(EventBusArrayOutput{})
pulumi.RegisterOutputType(EventBusMapOutput{})
}