generated from pulumi/pulumi-tf-provider-boilerplate
/
function.go
503 lines (442 loc) · 16.9 KB
/
function.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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
// 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 wedata
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to create a wedata function
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-tencentcloud/sdk/go/tencentcloud/Wedata"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/Wedata"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Wedata.NewFunction(ctx, "example", &Wedata.FunctionArgs{
// ClassName: pulumi.String("tf_class_example"),
// ClusterIdentifier: pulumi.String("emr-m6u3qgk0"),
// Comment: pulumi.String("V1"),
// DbName: pulumi.String("tf_db_example"),
// Description: pulumi.String("description."),
// Example: pulumi.String("example info."),
// Kind: pulumi.String("ANALYSIS"),
// ParamDesc: pulumi.String("param info."),
// ProjectId: pulumi.String("1612982498218618880"),
// ResourceLists: wedata.FunctionResourceListArray{
// &wedata.FunctionResourceListArgs{
// Id: pulumi.String("5b28bcdf-a0e6-4022-927d-927d399c4593"),
// Name: pulumi.String("untitled3-1.0-SNAPSHOT.jar"),
// Path: pulumi.String("/wedata-demo-1314991481/untitled3-1.0-SNAPSHOT.jar"),
// Type: pulumi.String("cos"),
// },
// },
// ReturnDesc: pulumi.String("return value info."),
// Type: pulumi.String("HIVE"),
// Usage: pulumi.String("usage info."),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type Function struct {
pulumi.CustomResourceState
// Class name of function entry.
ClassName pulumi.StringOutput `pulumi:"className"`
// Cluster ID.
ClusterIdentifier pulumi.StringOutput `pulumi:"clusterIdentifier"`
// Comment.
Comment pulumi.StringOutput `pulumi:"comment"`
// Database name.
DbName pulumi.StringOutput `pulumi:"dbName"`
// Description of the function.
Description pulumi.StringOutput `pulumi:"description"`
// Example of the function.
Example pulumi.StringOutput `pulumi:"example"`
// Function ID.
FunctionId pulumi.StringOutput `pulumi:"functionId"`
// Function Kind, Enum: ANALYSIS, ENCRYPTION, AGGREGATE, LOGIC, DATE_AND_TIME, MATH, CONVERSION, STRING, IP_AND_DOMAIN, WINDOW, OTHER.
Kind pulumi.StringOutput `pulumi:"kind"`
// Function Name.
Name pulumi.StringOutput `pulumi:"name"`
// Description of the Parameter.
ParamDesc pulumi.StringOutput `pulumi:"paramDesc"`
// Project ID.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// Resource of the function, stored in WeData COS(.jar,...).
ResourceLists FunctionResourceListArrayOutput `pulumi:"resourceLists"`
// Description of the Return value.
ReturnDesc pulumi.StringOutput `pulumi:"returnDesc"`
// Function Type, Enum: HIVE, SPARK, DLC.
Type pulumi.StringOutput `pulumi:"type"`
// Usage of the function.
Usage pulumi.StringOutput `pulumi:"usage"`
}
// NewFunction registers a new resource with the given unique name, arguments, and options.
func NewFunction(ctx *pulumi.Context,
name string, args *FunctionArgs, opts ...pulumi.ResourceOption) (*Function, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClassName == nil {
return nil, errors.New("invalid value for required argument 'ClassName'")
}
if args.ClusterIdentifier == nil {
return nil, errors.New("invalid value for required argument 'ClusterIdentifier'")
}
if args.Comment == nil {
return nil, errors.New("invalid value for required argument 'Comment'")
}
if args.DbName == nil {
return nil, errors.New("invalid value for required argument 'DbName'")
}
if args.Description == nil {
return nil, errors.New("invalid value for required argument 'Description'")
}
if args.Example == nil {
return nil, errors.New("invalid value for required argument 'Example'")
}
if args.Kind == nil {
return nil, errors.New("invalid value for required argument 'Kind'")
}
if args.ParamDesc == nil {
return nil, errors.New("invalid value for required argument 'ParamDesc'")
}
if args.ProjectId == nil {
return nil, errors.New("invalid value for required argument 'ProjectId'")
}
if args.ResourceLists == nil {
return nil, errors.New("invalid value for required argument 'ResourceLists'")
}
if args.ReturnDesc == nil {
return nil, errors.New("invalid value for required argument 'ReturnDesc'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
if args.Usage == nil {
return nil, errors.New("invalid value for required argument 'Usage'")
}
opts = pkgResourceDefaultOpts(opts)
var resource Function
err := ctx.RegisterResource("tencentcloud:Wedata/function:Function", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFunction gets an existing Function 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 GetFunction(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FunctionState, opts ...pulumi.ResourceOption) (*Function, error) {
var resource Function
err := ctx.ReadResource("tencentcloud:Wedata/function:Function", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Function resources.
type functionState struct {
// Class name of function entry.
ClassName *string `pulumi:"className"`
// Cluster ID.
ClusterIdentifier *string `pulumi:"clusterIdentifier"`
// Comment.
Comment *string `pulumi:"comment"`
// Database name.
DbName *string `pulumi:"dbName"`
// Description of the function.
Description *string `pulumi:"description"`
// Example of the function.
Example *string `pulumi:"example"`
// Function ID.
FunctionId *string `pulumi:"functionId"`
// Function Kind, Enum: ANALYSIS, ENCRYPTION, AGGREGATE, LOGIC, DATE_AND_TIME, MATH, CONVERSION, STRING, IP_AND_DOMAIN, WINDOW, OTHER.
Kind *string `pulumi:"kind"`
// Function Name.
Name *string `pulumi:"name"`
// Description of the Parameter.
ParamDesc *string `pulumi:"paramDesc"`
// Project ID.
ProjectId *string `pulumi:"projectId"`
// Resource of the function, stored in WeData COS(.jar,...).
ResourceLists []FunctionResourceList `pulumi:"resourceLists"`
// Description of the Return value.
ReturnDesc *string `pulumi:"returnDesc"`
// Function Type, Enum: HIVE, SPARK, DLC.
Type *string `pulumi:"type"`
// Usage of the function.
Usage *string `pulumi:"usage"`
}
type FunctionState struct {
// Class name of function entry.
ClassName pulumi.StringPtrInput
// Cluster ID.
ClusterIdentifier pulumi.StringPtrInput
// Comment.
Comment pulumi.StringPtrInput
// Database name.
DbName pulumi.StringPtrInput
// Description of the function.
Description pulumi.StringPtrInput
// Example of the function.
Example pulumi.StringPtrInput
// Function ID.
FunctionId pulumi.StringPtrInput
// Function Kind, Enum: ANALYSIS, ENCRYPTION, AGGREGATE, LOGIC, DATE_AND_TIME, MATH, CONVERSION, STRING, IP_AND_DOMAIN, WINDOW, OTHER.
Kind pulumi.StringPtrInput
// Function Name.
Name pulumi.StringPtrInput
// Description of the Parameter.
ParamDesc pulumi.StringPtrInput
// Project ID.
ProjectId pulumi.StringPtrInput
// Resource of the function, stored in WeData COS(.jar,...).
ResourceLists FunctionResourceListArrayInput
// Description of the Return value.
ReturnDesc pulumi.StringPtrInput
// Function Type, Enum: HIVE, SPARK, DLC.
Type pulumi.StringPtrInput
// Usage of the function.
Usage pulumi.StringPtrInput
}
func (FunctionState) ElementType() reflect.Type {
return reflect.TypeOf((*functionState)(nil)).Elem()
}
type functionArgs struct {
// Class name of function entry.
ClassName string `pulumi:"className"`
// Cluster ID.
ClusterIdentifier string `pulumi:"clusterIdentifier"`
// Comment.
Comment string `pulumi:"comment"`
// Database name.
DbName string `pulumi:"dbName"`
// Description of the function.
Description string `pulumi:"description"`
// Example of the function.
Example string `pulumi:"example"`
// Function Kind, Enum: ANALYSIS, ENCRYPTION, AGGREGATE, LOGIC, DATE_AND_TIME, MATH, CONVERSION, STRING, IP_AND_DOMAIN, WINDOW, OTHER.
Kind string `pulumi:"kind"`
// Function Name.
Name *string `pulumi:"name"`
// Description of the Parameter.
ParamDesc string `pulumi:"paramDesc"`
// Project ID.
ProjectId string `pulumi:"projectId"`
// Resource of the function, stored in WeData COS(.jar,...).
ResourceLists []FunctionResourceList `pulumi:"resourceLists"`
// Description of the Return value.
ReturnDesc string `pulumi:"returnDesc"`
// Function Type, Enum: HIVE, SPARK, DLC.
Type string `pulumi:"type"`
// Usage of the function.
Usage string `pulumi:"usage"`
}
// The set of arguments for constructing a Function resource.
type FunctionArgs struct {
// Class name of function entry.
ClassName pulumi.StringInput
// Cluster ID.
ClusterIdentifier pulumi.StringInput
// Comment.
Comment pulumi.StringInput
// Database name.
DbName pulumi.StringInput
// Description of the function.
Description pulumi.StringInput
// Example of the function.
Example pulumi.StringInput
// Function Kind, Enum: ANALYSIS, ENCRYPTION, AGGREGATE, LOGIC, DATE_AND_TIME, MATH, CONVERSION, STRING, IP_AND_DOMAIN, WINDOW, OTHER.
Kind pulumi.StringInput
// Function Name.
Name pulumi.StringPtrInput
// Description of the Parameter.
ParamDesc pulumi.StringInput
// Project ID.
ProjectId pulumi.StringInput
// Resource of the function, stored in WeData COS(.jar,...).
ResourceLists FunctionResourceListArrayInput
// Description of the Return value.
ReturnDesc pulumi.StringInput
// Function Type, Enum: HIVE, SPARK, DLC.
Type pulumi.StringInput
// Usage of the function.
Usage pulumi.StringInput
}
func (FunctionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*functionArgs)(nil)).Elem()
}
type FunctionInput interface {
pulumi.Input
ToFunctionOutput() FunctionOutput
ToFunctionOutputWithContext(ctx context.Context) FunctionOutput
}
func (*Function) ElementType() reflect.Type {
return reflect.TypeOf((**Function)(nil)).Elem()
}
func (i *Function) ToFunctionOutput() FunctionOutput {
return i.ToFunctionOutputWithContext(context.Background())
}
func (i *Function) ToFunctionOutputWithContext(ctx context.Context) FunctionOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionOutput)
}
// FunctionArrayInput is an input type that accepts FunctionArray and FunctionArrayOutput values.
// You can construct a concrete instance of `FunctionArrayInput` via:
//
// FunctionArray{ FunctionArgs{...} }
type FunctionArrayInput interface {
pulumi.Input
ToFunctionArrayOutput() FunctionArrayOutput
ToFunctionArrayOutputWithContext(context.Context) FunctionArrayOutput
}
type FunctionArray []FunctionInput
func (FunctionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Function)(nil)).Elem()
}
func (i FunctionArray) ToFunctionArrayOutput() FunctionArrayOutput {
return i.ToFunctionArrayOutputWithContext(context.Background())
}
func (i FunctionArray) ToFunctionArrayOutputWithContext(ctx context.Context) FunctionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionArrayOutput)
}
// FunctionMapInput is an input type that accepts FunctionMap and FunctionMapOutput values.
// You can construct a concrete instance of `FunctionMapInput` via:
//
// FunctionMap{ "key": FunctionArgs{...} }
type FunctionMapInput interface {
pulumi.Input
ToFunctionMapOutput() FunctionMapOutput
ToFunctionMapOutputWithContext(context.Context) FunctionMapOutput
}
type FunctionMap map[string]FunctionInput
func (FunctionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Function)(nil)).Elem()
}
func (i FunctionMap) ToFunctionMapOutput() FunctionMapOutput {
return i.ToFunctionMapOutputWithContext(context.Background())
}
func (i FunctionMap) ToFunctionMapOutputWithContext(ctx context.Context) FunctionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(FunctionMapOutput)
}
type FunctionOutput struct{ *pulumi.OutputState }
func (FunctionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Function)(nil)).Elem()
}
func (o FunctionOutput) ToFunctionOutput() FunctionOutput {
return o
}
func (o FunctionOutput) ToFunctionOutputWithContext(ctx context.Context) FunctionOutput {
return o
}
// Class name of function entry.
func (o FunctionOutput) ClassName() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.ClassName }).(pulumi.StringOutput)
}
// Cluster ID.
func (o FunctionOutput) ClusterIdentifier() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.ClusterIdentifier }).(pulumi.StringOutput)
}
// Comment.
func (o FunctionOutput) Comment() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Comment }).(pulumi.StringOutput)
}
// Database name.
func (o FunctionOutput) DbName() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.DbName }).(pulumi.StringOutput)
}
// Description of the function.
func (o FunctionOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// Example of the function.
func (o FunctionOutput) Example() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Example }).(pulumi.StringOutput)
}
// Function ID.
func (o FunctionOutput) FunctionId() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.FunctionId }).(pulumi.StringOutput)
}
// Function Kind, Enum: ANALYSIS, ENCRYPTION, AGGREGATE, LOGIC, DATE_AND_TIME, MATH, CONVERSION, STRING, IP_AND_DOMAIN, WINDOW, OTHER.
func (o FunctionOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Kind }).(pulumi.StringOutput)
}
// Function Name.
func (o FunctionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Description of the Parameter.
func (o FunctionOutput) ParamDesc() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.ParamDesc }).(pulumi.StringOutput)
}
// Project ID.
func (o FunctionOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
// Resource of the function, stored in WeData COS(.jar,...).
func (o FunctionOutput) ResourceLists() FunctionResourceListArrayOutput {
return o.ApplyT(func(v *Function) FunctionResourceListArrayOutput { return v.ResourceLists }).(FunctionResourceListArrayOutput)
}
// Description of the Return value.
func (o FunctionOutput) ReturnDesc() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.ReturnDesc }).(pulumi.StringOutput)
}
// Function Type, Enum: HIVE, SPARK, DLC.
func (o FunctionOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// Usage of the function.
func (o FunctionOutput) Usage() pulumi.StringOutput {
return o.ApplyT(func(v *Function) pulumi.StringOutput { return v.Usage }).(pulumi.StringOutput)
}
type FunctionArrayOutput struct{ *pulumi.OutputState }
func (FunctionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Function)(nil)).Elem()
}
func (o FunctionArrayOutput) ToFunctionArrayOutput() FunctionArrayOutput {
return o
}
func (o FunctionArrayOutput) ToFunctionArrayOutputWithContext(ctx context.Context) FunctionArrayOutput {
return o
}
func (o FunctionArrayOutput) Index(i pulumi.IntInput) FunctionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Function {
return vs[0].([]*Function)[vs[1].(int)]
}).(FunctionOutput)
}
type FunctionMapOutput struct{ *pulumi.OutputState }
func (FunctionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Function)(nil)).Elem()
}
func (o FunctionMapOutput) ToFunctionMapOutput() FunctionMapOutput {
return o
}
func (o FunctionMapOutput) ToFunctionMapOutputWithContext(ctx context.Context) FunctionMapOutput {
return o
}
func (o FunctionMapOutput) MapIndex(k pulumi.StringInput) FunctionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Function {
return vs[0].(map[string]*Function)[vs[1].(string)]
}).(FunctionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FunctionInput)(nil)).Elem(), &Function{})
pulumi.RegisterInputType(reflect.TypeOf((*FunctionArrayInput)(nil)).Elem(), FunctionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*FunctionMapInput)(nil)).Elem(), FunctionMap{})
pulumi.RegisterOutputType(FunctionOutput{})
pulumi.RegisterOutputType(FunctionArrayOutput{})
pulumi.RegisterOutputType(FunctionMapOutput{})
}