generated from pulumi/pulumi-tf-provider-boilerplate
/
sign.go
367 lines (313 loc) · 14.7 KB
/
sign.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
// 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 sms
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to create a sms sign
//
// ## Example Usage
// ### Create a sms sign instance
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/Sms"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Sms.NewSign(ctx, "example", &Sms.SignArgs{
// DocumentType: pulumi.Int(4),
// International: pulumi.Int(0),
// ProofImage: pulumi.String("your_proof_image"),
// SignName: pulumi.String("tf_example_sms_sign"),
// SignPurpose: pulumi.Int(0),
// SignType: pulumi.Int(1),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type Sign struct {
pulumi.CustomResourceState
// Power of attorney, which should be submitted if SignPurpose is for use by others. You should Base64-encode the image first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter. Note: this field will take effect only when SignPurpose is 1 (for user by others).
CommissionImage pulumi.StringPtrOutput `pulumi:"commissionImage"`
// DocumentType is used for enterprise authentication, or website, app authentication, etc. DocumentType: 0, 1, 2, 3, 4, 5, 6, 7, 8.
DocumentType pulumi.IntOutput `pulumi:"documentType"`
// Whether it is Global SMS: 0: Mainland China SMS; 1: Global SMS.
International pulumi.IntOutput `pulumi:"international"`
// You should Base64-encode the image of the identity certificate corresponding to the signature first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter.
ProofImage pulumi.StringOutput `pulumi:"proofImage"`
// Signature application remarks.
Remark pulumi.StringPtrOutput `pulumi:"remark"`
// Sms sign name, unique.
SignName pulumi.StringOutput `pulumi:"signName"`
// Signature purpose: 0: for personal use; 1: for others.
SignPurpose pulumi.IntOutput `pulumi:"signPurpose"`
// Sms sign type: 0, 1, 2, 3, 4, 5, 6.
SignType pulumi.IntOutput `pulumi:"signType"`
}
// NewSign registers a new resource with the given unique name, arguments, and options.
func NewSign(ctx *pulumi.Context,
name string, args *SignArgs, opts ...pulumi.ResourceOption) (*Sign, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DocumentType == nil {
return nil, errors.New("invalid value for required argument 'DocumentType'")
}
if args.International == nil {
return nil, errors.New("invalid value for required argument 'International'")
}
if args.ProofImage == nil {
return nil, errors.New("invalid value for required argument 'ProofImage'")
}
if args.SignName == nil {
return nil, errors.New("invalid value for required argument 'SignName'")
}
if args.SignPurpose == nil {
return nil, errors.New("invalid value for required argument 'SignPurpose'")
}
if args.SignType == nil {
return nil, errors.New("invalid value for required argument 'SignType'")
}
opts = pkgResourceDefaultOpts(opts)
var resource Sign
err := ctx.RegisterResource("tencentcloud:Sms/sign:Sign", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSign gets an existing Sign 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 GetSign(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SignState, opts ...pulumi.ResourceOption) (*Sign, error) {
var resource Sign
err := ctx.ReadResource("tencentcloud:Sms/sign:Sign", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Sign resources.
type signState struct {
// Power of attorney, which should be submitted if SignPurpose is for use by others. You should Base64-encode the image first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter. Note: this field will take effect only when SignPurpose is 1 (for user by others).
CommissionImage *string `pulumi:"commissionImage"`
// DocumentType is used for enterprise authentication, or website, app authentication, etc. DocumentType: 0, 1, 2, 3, 4, 5, 6, 7, 8.
DocumentType *int `pulumi:"documentType"`
// Whether it is Global SMS: 0: Mainland China SMS; 1: Global SMS.
International *int `pulumi:"international"`
// You should Base64-encode the image of the identity certificate corresponding to the signature first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter.
ProofImage *string `pulumi:"proofImage"`
// Signature application remarks.
Remark *string `pulumi:"remark"`
// Sms sign name, unique.
SignName *string `pulumi:"signName"`
// Signature purpose: 0: for personal use; 1: for others.
SignPurpose *int `pulumi:"signPurpose"`
// Sms sign type: 0, 1, 2, 3, 4, 5, 6.
SignType *int `pulumi:"signType"`
}
type SignState struct {
// Power of attorney, which should be submitted if SignPurpose is for use by others. You should Base64-encode the image first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter. Note: this field will take effect only when SignPurpose is 1 (for user by others).
CommissionImage pulumi.StringPtrInput
// DocumentType is used for enterprise authentication, or website, app authentication, etc. DocumentType: 0, 1, 2, 3, 4, 5, 6, 7, 8.
DocumentType pulumi.IntPtrInput
// Whether it is Global SMS: 0: Mainland China SMS; 1: Global SMS.
International pulumi.IntPtrInput
// You should Base64-encode the image of the identity certificate corresponding to the signature first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter.
ProofImage pulumi.StringPtrInput
// Signature application remarks.
Remark pulumi.StringPtrInput
// Sms sign name, unique.
SignName pulumi.StringPtrInput
// Signature purpose: 0: for personal use; 1: for others.
SignPurpose pulumi.IntPtrInput
// Sms sign type: 0, 1, 2, 3, 4, 5, 6.
SignType pulumi.IntPtrInput
}
func (SignState) ElementType() reflect.Type {
return reflect.TypeOf((*signState)(nil)).Elem()
}
type signArgs struct {
// Power of attorney, which should be submitted if SignPurpose is for use by others. You should Base64-encode the image first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter. Note: this field will take effect only when SignPurpose is 1 (for user by others).
CommissionImage *string `pulumi:"commissionImage"`
// DocumentType is used for enterprise authentication, or website, app authentication, etc. DocumentType: 0, 1, 2, 3, 4, 5, 6, 7, 8.
DocumentType int `pulumi:"documentType"`
// Whether it is Global SMS: 0: Mainland China SMS; 1: Global SMS.
International int `pulumi:"international"`
// You should Base64-encode the image of the identity certificate corresponding to the signature first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter.
ProofImage string `pulumi:"proofImage"`
// Signature application remarks.
Remark *string `pulumi:"remark"`
// Sms sign name, unique.
SignName string `pulumi:"signName"`
// Signature purpose: 0: for personal use; 1: for others.
SignPurpose int `pulumi:"signPurpose"`
// Sms sign type: 0, 1, 2, 3, 4, 5, 6.
SignType int `pulumi:"signType"`
}
// The set of arguments for constructing a Sign resource.
type SignArgs struct {
// Power of attorney, which should be submitted if SignPurpose is for use by others. You should Base64-encode the image first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter. Note: this field will take effect only when SignPurpose is 1 (for user by others).
CommissionImage pulumi.StringPtrInput
// DocumentType is used for enterprise authentication, or website, app authentication, etc. DocumentType: 0, 1, 2, 3, 4, 5, 6, 7, 8.
DocumentType pulumi.IntInput
// Whether it is Global SMS: 0: Mainland China SMS; 1: Global SMS.
International pulumi.IntInput
// You should Base64-encode the image of the identity certificate corresponding to the signature first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter.
ProofImage pulumi.StringInput
// Signature application remarks.
Remark pulumi.StringPtrInput
// Sms sign name, unique.
SignName pulumi.StringInput
// Signature purpose: 0: for personal use; 1: for others.
SignPurpose pulumi.IntInput
// Sms sign type: 0, 1, 2, 3, 4, 5, 6.
SignType pulumi.IntInput
}
func (SignArgs) ElementType() reflect.Type {
return reflect.TypeOf((*signArgs)(nil)).Elem()
}
type SignInput interface {
pulumi.Input
ToSignOutput() SignOutput
ToSignOutputWithContext(ctx context.Context) SignOutput
}
func (*Sign) ElementType() reflect.Type {
return reflect.TypeOf((**Sign)(nil)).Elem()
}
func (i *Sign) ToSignOutput() SignOutput {
return i.ToSignOutputWithContext(context.Background())
}
func (i *Sign) ToSignOutputWithContext(ctx context.Context) SignOutput {
return pulumi.ToOutputWithContext(ctx, i).(SignOutput)
}
// SignArrayInput is an input type that accepts SignArray and SignArrayOutput values.
// You can construct a concrete instance of `SignArrayInput` via:
//
// SignArray{ SignArgs{...} }
type SignArrayInput interface {
pulumi.Input
ToSignArrayOutput() SignArrayOutput
ToSignArrayOutputWithContext(context.Context) SignArrayOutput
}
type SignArray []SignInput
func (SignArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Sign)(nil)).Elem()
}
func (i SignArray) ToSignArrayOutput() SignArrayOutput {
return i.ToSignArrayOutputWithContext(context.Background())
}
func (i SignArray) ToSignArrayOutputWithContext(ctx context.Context) SignArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SignArrayOutput)
}
// SignMapInput is an input type that accepts SignMap and SignMapOutput values.
// You can construct a concrete instance of `SignMapInput` via:
//
// SignMap{ "key": SignArgs{...} }
type SignMapInput interface {
pulumi.Input
ToSignMapOutput() SignMapOutput
ToSignMapOutputWithContext(context.Context) SignMapOutput
}
type SignMap map[string]SignInput
func (SignMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Sign)(nil)).Elem()
}
func (i SignMap) ToSignMapOutput() SignMapOutput {
return i.ToSignMapOutputWithContext(context.Background())
}
func (i SignMap) ToSignMapOutputWithContext(ctx context.Context) SignMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SignMapOutput)
}
type SignOutput struct{ *pulumi.OutputState }
func (SignOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Sign)(nil)).Elem()
}
func (o SignOutput) ToSignOutput() SignOutput {
return o
}
func (o SignOutput) ToSignOutputWithContext(ctx context.Context) SignOutput {
return o
}
// Power of attorney, which should be submitted if SignPurpose is for use by others. You should Base64-encode the image first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter. Note: this field will take effect only when SignPurpose is 1 (for user by others).
func (o SignOutput) CommissionImage() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Sign) pulumi.StringPtrOutput { return v.CommissionImage }).(pulumi.StringPtrOutput)
}
// DocumentType is used for enterprise authentication, or website, app authentication, etc. DocumentType: 0, 1, 2, 3, 4, 5, 6, 7, 8.
func (o SignOutput) DocumentType() pulumi.IntOutput {
return o.ApplyT(func(v *Sign) pulumi.IntOutput { return v.DocumentType }).(pulumi.IntOutput)
}
// Whether it is Global SMS: 0: Mainland China SMS; 1: Global SMS.
func (o SignOutput) International() pulumi.IntOutput {
return o.ApplyT(func(v *Sign) pulumi.IntOutput { return v.International }).(pulumi.IntOutput)
}
// You should Base64-encode the image of the identity certificate corresponding to the signature first, remove the prefix data:image/jpeg;base64, from the resulted string, and then use it as the value of this parameter.
func (o SignOutput) ProofImage() pulumi.StringOutput {
return o.ApplyT(func(v *Sign) pulumi.StringOutput { return v.ProofImage }).(pulumi.StringOutput)
}
// Signature application remarks.
func (o SignOutput) Remark() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Sign) pulumi.StringPtrOutput { return v.Remark }).(pulumi.StringPtrOutput)
}
// Sms sign name, unique.
func (o SignOutput) SignName() pulumi.StringOutput {
return o.ApplyT(func(v *Sign) pulumi.StringOutput { return v.SignName }).(pulumi.StringOutput)
}
// Signature purpose: 0: for personal use; 1: for others.
func (o SignOutput) SignPurpose() pulumi.IntOutput {
return o.ApplyT(func(v *Sign) pulumi.IntOutput { return v.SignPurpose }).(pulumi.IntOutput)
}
// Sms sign type: 0, 1, 2, 3, 4, 5, 6.
func (o SignOutput) SignType() pulumi.IntOutput {
return o.ApplyT(func(v *Sign) pulumi.IntOutput { return v.SignType }).(pulumi.IntOutput)
}
type SignArrayOutput struct{ *pulumi.OutputState }
func (SignArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Sign)(nil)).Elem()
}
func (o SignArrayOutput) ToSignArrayOutput() SignArrayOutput {
return o
}
func (o SignArrayOutput) ToSignArrayOutputWithContext(ctx context.Context) SignArrayOutput {
return o
}
func (o SignArrayOutput) Index(i pulumi.IntInput) SignOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Sign {
return vs[0].([]*Sign)[vs[1].(int)]
}).(SignOutput)
}
type SignMapOutput struct{ *pulumi.OutputState }
func (SignMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Sign)(nil)).Elem()
}
func (o SignMapOutput) ToSignMapOutput() SignMapOutput {
return o
}
func (o SignMapOutput) ToSignMapOutputWithContext(ctx context.Context) SignMapOutput {
return o
}
func (o SignMapOutput) MapIndex(k pulumi.StringInput) SignOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Sign {
return vs[0].(map[string]*Sign)[vs[1].(string)]
}).(SignOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SignInput)(nil)).Elem(), &Sign{})
pulumi.RegisterInputType(reflect.TypeOf((*SignArrayInput)(nil)).Elem(), SignArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SignMapInput)(nil)).Elem(), SignMap{})
pulumi.RegisterOutputType(SignOutput{})
pulumi.RegisterOutputType(SignArrayOutput{})
pulumi.RegisterOutputType(SignMapOutput{})
}