generated from pulumi/pulumi-tf-provider-boilerplate
/
invoker.go
358 lines (301 loc) · 11.8 KB
/
invoker.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
// 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 tat
import (
"context"
"reflect"
"errors"
"github.com/mergtil/pulumi-tencentcloud/sdk/go/tencentcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Invoker struct {
pulumi.CustomResourceState
// Remote command ID.
CommandId pulumi.StringOutput `pulumi:"commandId"`
// Creation time.
CreatedTime pulumi.StringOutput `pulumi:"createdTime"`
// Whether to enable the invoker.
Enable pulumi.BoolOutput `pulumi:"enable"`
// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
InstanceIds pulumi.StringArrayOutput `pulumi:"instanceIds"`
// Invoker ID.
InvokerId pulumi.StringOutput `pulumi:"invokerId"`
// Invoker name.
Name pulumi.StringOutput `pulumi:"name"`
// Custom parameters of the command.
Parameters pulumi.StringPtrOutput `pulumi:"parameters"`
// Settings required for a recurring invoker.
ScheduleSettings InvokerScheduleSettingsPtrOutput `pulumi:"scheduleSettings"`
// Invoker type. It can only be `SCHEDULE` (recurring invokers).
Type pulumi.StringOutput `pulumi:"type"`
// Modification time.
UpdatedTime pulumi.StringOutput `pulumi:"updatedTime"`
// The user who executes the command.
Username pulumi.StringPtrOutput `pulumi:"username"`
}
// NewInvoker registers a new resource with the given unique name, arguments, and options.
func NewInvoker(ctx *pulumi.Context,
name string, args *InvokerArgs, opts ...pulumi.ResourceOption) (*Invoker, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CommandId == nil {
return nil, errors.New("invalid value for required argument 'CommandId'")
}
if args.InstanceIds == nil {
return nil, errors.New("invalid value for required argument 'InstanceIds'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Invoker
err := ctx.RegisterResource("tencentcloud:Tat/invoker:Invoker", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInvoker gets an existing Invoker 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 GetInvoker(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InvokerState, opts ...pulumi.ResourceOption) (*Invoker, error) {
var resource Invoker
err := ctx.ReadResource("tencentcloud:Tat/invoker:Invoker", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Invoker resources.
type invokerState struct {
// Remote command ID.
CommandId *string `pulumi:"commandId"`
// Creation time.
CreatedTime *string `pulumi:"createdTime"`
// Whether to enable the invoker.
Enable *bool `pulumi:"enable"`
// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
InstanceIds []string `pulumi:"instanceIds"`
// Invoker ID.
InvokerId *string `pulumi:"invokerId"`
// Invoker name.
Name *string `pulumi:"name"`
// Custom parameters of the command.
Parameters *string `pulumi:"parameters"`
// Settings required for a recurring invoker.
ScheduleSettings *InvokerScheduleSettings `pulumi:"scheduleSettings"`
// Invoker type. It can only be `SCHEDULE` (recurring invokers).
Type *string `pulumi:"type"`
// Modification time.
UpdatedTime *string `pulumi:"updatedTime"`
// The user who executes the command.
Username *string `pulumi:"username"`
}
type InvokerState struct {
// Remote command ID.
CommandId pulumi.StringPtrInput
// Creation time.
CreatedTime pulumi.StringPtrInput
// Whether to enable the invoker.
Enable pulumi.BoolPtrInput
// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
InstanceIds pulumi.StringArrayInput
// Invoker ID.
InvokerId pulumi.StringPtrInput
// Invoker name.
Name pulumi.StringPtrInput
// Custom parameters of the command.
Parameters pulumi.StringPtrInput
// Settings required for a recurring invoker.
ScheduleSettings InvokerScheduleSettingsPtrInput
// Invoker type. It can only be `SCHEDULE` (recurring invokers).
Type pulumi.StringPtrInput
// Modification time.
UpdatedTime pulumi.StringPtrInput
// The user who executes the command.
Username pulumi.StringPtrInput
}
func (InvokerState) ElementType() reflect.Type {
return reflect.TypeOf((*invokerState)(nil)).Elem()
}
type invokerArgs struct {
// Remote command ID.
CommandId string `pulumi:"commandId"`
// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
InstanceIds []string `pulumi:"instanceIds"`
// Invoker name.
Name *string `pulumi:"name"`
// Custom parameters of the command.
Parameters *string `pulumi:"parameters"`
// Settings required for a recurring invoker.
ScheduleSettings *InvokerScheduleSettings `pulumi:"scheduleSettings"`
// Invoker type. It can only be `SCHEDULE` (recurring invokers).
Type string `pulumi:"type"`
// The user who executes the command.
Username *string `pulumi:"username"`
}
// The set of arguments for constructing a Invoker resource.
type InvokerArgs struct {
// Remote command ID.
CommandId pulumi.StringInput
// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
InstanceIds pulumi.StringArrayInput
// Invoker name.
Name pulumi.StringPtrInput
// Custom parameters of the command.
Parameters pulumi.StringPtrInput
// Settings required for a recurring invoker.
ScheduleSettings InvokerScheduleSettingsPtrInput
// Invoker type. It can only be `SCHEDULE` (recurring invokers).
Type pulumi.StringInput
// The user who executes the command.
Username pulumi.StringPtrInput
}
func (InvokerArgs) ElementType() reflect.Type {
return reflect.TypeOf((*invokerArgs)(nil)).Elem()
}
type InvokerInput interface {
pulumi.Input
ToInvokerOutput() InvokerOutput
ToInvokerOutputWithContext(ctx context.Context) InvokerOutput
}
func (*Invoker) ElementType() reflect.Type {
return reflect.TypeOf((**Invoker)(nil)).Elem()
}
func (i *Invoker) ToInvokerOutput() InvokerOutput {
return i.ToInvokerOutputWithContext(context.Background())
}
func (i *Invoker) ToInvokerOutputWithContext(ctx context.Context) InvokerOutput {
return pulumi.ToOutputWithContext(ctx, i).(InvokerOutput)
}
// InvokerArrayInput is an input type that accepts InvokerArray and InvokerArrayOutput values.
// You can construct a concrete instance of `InvokerArrayInput` via:
//
// InvokerArray{ InvokerArgs{...} }
type InvokerArrayInput interface {
pulumi.Input
ToInvokerArrayOutput() InvokerArrayOutput
ToInvokerArrayOutputWithContext(context.Context) InvokerArrayOutput
}
type InvokerArray []InvokerInput
func (InvokerArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Invoker)(nil)).Elem()
}
func (i InvokerArray) ToInvokerArrayOutput() InvokerArrayOutput {
return i.ToInvokerArrayOutputWithContext(context.Background())
}
func (i InvokerArray) ToInvokerArrayOutputWithContext(ctx context.Context) InvokerArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(InvokerArrayOutput)
}
// InvokerMapInput is an input type that accepts InvokerMap and InvokerMapOutput values.
// You can construct a concrete instance of `InvokerMapInput` via:
//
// InvokerMap{ "key": InvokerArgs{...} }
type InvokerMapInput interface {
pulumi.Input
ToInvokerMapOutput() InvokerMapOutput
ToInvokerMapOutputWithContext(context.Context) InvokerMapOutput
}
type InvokerMap map[string]InvokerInput
func (InvokerMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Invoker)(nil)).Elem()
}
func (i InvokerMap) ToInvokerMapOutput() InvokerMapOutput {
return i.ToInvokerMapOutputWithContext(context.Background())
}
func (i InvokerMap) ToInvokerMapOutputWithContext(ctx context.Context) InvokerMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(InvokerMapOutput)
}
type InvokerOutput struct{ *pulumi.OutputState }
func (InvokerOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Invoker)(nil)).Elem()
}
func (o InvokerOutput) ToInvokerOutput() InvokerOutput {
return o
}
func (o InvokerOutput) ToInvokerOutputWithContext(ctx context.Context) InvokerOutput {
return o
}
// Remote command ID.
func (o InvokerOutput) CommandId() pulumi.StringOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringOutput { return v.CommandId }).(pulumi.StringOutput)
}
// Creation time.
func (o InvokerOutput) CreatedTime() pulumi.StringOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringOutput { return v.CreatedTime }).(pulumi.StringOutput)
}
// Whether to enable the invoker.
func (o InvokerOutput) Enable() pulumi.BoolOutput {
return o.ApplyT(func(v *Invoker) pulumi.BoolOutput { return v.Enable }).(pulumi.BoolOutput)
}
// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
func (o InvokerOutput) InstanceIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringArrayOutput { return v.InstanceIds }).(pulumi.StringArrayOutput)
}
// Invoker ID.
func (o InvokerOutput) InvokerId() pulumi.StringOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringOutput { return v.InvokerId }).(pulumi.StringOutput)
}
// Invoker name.
func (o InvokerOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Custom parameters of the command.
func (o InvokerOutput) Parameters() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringPtrOutput { return v.Parameters }).(pulumi.StringPtrOutput)
}
// Settings required for a recurring invoker.
func (o InvokerOutput) ScheduleSettings() InvokerScheduleSettingsPtrOutput {
return o.ApplyT(func(v *Invoker) InvokerScheduleSettingsPtrOutput { return v.ScheduleSettings }).(InvokerScheduleSettingsPtrOutput)
}
// Invoker type. It can only be `SCHEDULE` (recurring invokers).
func (o InvokerOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// Modification time.
func (o InvokerOutput) UpdatedTime() pulumi.StringOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringOutput { return v.UpdatedTime }).(pulumi.StringOutput)
}
// The user who executes the command.
func (o InvokerOutput) Username() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Invoker) pulumi.StringPtrOutput { return v.Username }).(pulumi.StringPtrOutput)
}
type InvokerArrayOutput struct{ *pulumi.OutputState }
func (InvokerArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Invoker)(nil)).Elem()
}
func (o InvokerArrayOutput) ToInvokerArrayOutput() InvokerArrayOutput {
return o
}
func (o InvokerArrayOutput) ToInvokerArrayOutputWithContext(ctx context.Context) InvokerArrayOutput {
return o
}
func (o InvokerArrayOutput) Index(i pulumi.IntInput) InvokerOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Invoker {
return vs[0].([]*Invoker)[vs[1].(int)]
}).(InvokerOutput)
}
type InvokerMapOutput struct{ *pulumi.OutputState }
func (InvokerMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Invoker)(nil)).Elem()
}
func (o InvokerMapOutput) ToInvokerMapOutput() InvokerMapOutput {
return o
}
func (o InvokerMapOutput) ToInvokerMapOutputWithContext(ctx context.Context) InvokerMapOutput {
return o
}
func (o InvokerMapOutput) MapIndex(k pulumi.StringInput) InvokerOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Invoker {
return vs[0].(map[string]*Invoker)[vs[1].(string)]
}).(InvokerOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*InvokerInput)(nil)).Elem(), &Invoker{})
pulumi.RegisterInputType(reflect.TypeOf((*InvokerArrayInput)(nil)).Elem(), InvokerArray{})
pulumi.RegisterInputType(reflect.TypeOf((*InvokerMapInput)(nil)).Elem(), InvokerMap{})
pulumi.RegisterOutputType(InvokerOutput{})
pulumi.RegisterOutputType(InvokerArrayOutput{})
pulumi.RegisterOutputType(InvokerMapOutput{})
}