generated from pulumi/pulumi-tf-provider-boilerplate
/
quotaApplication.go
473 lines (411 loc) · 17.7 KB
/
quotaApplication.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
// 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 quotas
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Quotas Quota Application resource.
//
// For information about Quotas Quota Application and how to use it, see [What is Quota Application](https://help.aliyun.com/document_detail/171289.html).
//
// > **NOTE:** Available in v1.117.0+.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/go/alicloud/quotas"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/quotas"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := quotas.NewQuotaApplication(ctx, "example", "as.QuotaApplicationArgs{
// DesireValue: pulumi.Float64(100),
// Dimensions: quotas.QuotaApplicationDimensionArray{
// "as.QuotaApplicationDimensionArgs{
// Key: pulumi.String("regionId"),
// Value: pulumi.String("cn-hangzhou"),
// },
// },
// NoticeType: pulumi.Int(0),
// ProductCode: pulumi.String("ess"),
// QuotaActionCode: pulumi.String("q_db_instance"),
// Reason: pulumi.String("For Terraform Test"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Quotas Application Info can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:quotas/quotaApplication:QuotaApplication example <id>
//
// ```
type QuotaApplication struct {
pulumi.CustomResourceState
// The approve value of the quota application.
ApproveValue pulumi.StringOutput `pulumi:"approveValue"`
// The audit mode. Valid values: `Async`, `Sync`. Default to: `Async`.
AuditMode pulumi.StringPtrOutput `pulumi:"auditMode"`
// The audit reason.
AuditReason pulumi.StringOutput `pulumi:"auditReason"`
// The desire value of the quota application.
DesireValue pulumi.Float64Output `pulumi:"desireValue"`
// The quota dimensions.
Dimensions QuotaApplicationDimensionArrayOutput `pulumi:"dimensions"`
// The effective time of the quota application.
EffectiveTime pulumi.StringOutput `pulumi:"effectiveTime"`
// The expire time of the quota application.
ExpireTime pulumi.StringOutput `pulumi:"expireTime"`
// The notice type. Valid values: `0`, `1`, `2`, `3`.
NoticeType pulumi.IntPtrOutput `pulumi:"noticeType"`
// The product code.
ProductCode pulumi.StringOutput `pulumi:"productCode"`
// The ID of quota action.
QuotaActionCode pulumi.StringOutput `pulumi:"quotaActionCode"`
// The quota category. Valid values: `CommonQuota`, `FlowControl`.
QuotaCategory pulumi.StringPtrOutput `pulumi:"quotaCategory"`
// The description of the quota application.
QuotaDescription pulumi.StringOutput `pulumi:"quotaDescription"`
// The name of the quota application.
QuotaName pulumi.StringOutput `pulumi:"quotaName"`
// The unit of the quota application.
QuotaUnit pulumi.StringOutput `pulumi:"quotaUnit"`
// The reason of the quota application.
Reason pulumi.StringOutput `pulumi:"reason"`
// The status of the quota application.
Status pulumi.StringOutput `pulumi:"status"`
}
// NewQuotaApplication registers a new resource with the given unique name, arguments, and options.
func NewQuotaApplication(ctx *pulumi.Context,
name string, args *QuotaApplicationArgs, opts ...pulumi.ResourceOption) (*QuotaApplication, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DesireValue == nil {
return nil, errors.New("invalid value for required argument 'DesireValue'")
}
if args.ProductCode == nil {
return nil, errors.New("invalid value for required argument 'ProductCode'")
}
if args.QuotaActionCode == nil {
return nil, errors.New("invalid value for required argument 'QuotaActionCode'")
}
if args.Reason == nil {
return nil, errors.New("invalid value for required argument 'Reason'")
}
opts = pkgResourceDefaultOpts(opts)
var resource QuotaApplication
err := ctx.RegisterResource("alicloud:quotas/quotaApplication:QuotaApplication", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetQuotaApplication gets an existing QuotaApplication 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 GetQuotaApplication(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *QuotaApplicationState, opts ...pulumi.ResourceOption) (*QuotaApplication, error) {
var resource QuotaApplication
err := ctx.ReadResource("alicloud:quotas/quotaApplication:QuotaApplication", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering QuotaApplication resources.
type quotaApplicationState struct {
// The approve value of the quota application.
ApproveValue *string `pulumi:"approveValue"`
// The audit mode. Valid values: `Async`, `Sync`. Default to: `Async`.
AuditMode *string `pulumi:"auditMode"`
// The audit reason.
AuditReason *string `pulumi:"auditReason"`
// The desire value of the quota application.
DesireValue *float64 `pulumi:"desireValue"`
// The quota dimensions.
Dimensions []QuotaApplicationDimension `pulumi:"dimensions"`
// The effective time of the quota application.
EffectiveTime *string `pulumi:"effectiveTime"`
// The expire time of the quota application.
ExpireTime *string `pulumi:"expireTime"`
// The notice type. Valid values: `0`, `1`, `2`, `3`.
NoticeType *int `pulumi:"noticeType"`
// The product code.
ProductCode *string `pulumi:"productCode"`
// The ID of quota action.
QuotaActionCode *string `pulumi:"quotaActionCode"`
// The quota category. Valid values: `CommonQuota`, `FlowControl`.
QuotaCategory *string `pulumi:"quotaCategory"`
// The description of the quota application.
QuotaDescription *string `pulumi:"quotaDescription"`
// The name of the quota application.
QuotaName *string `pulumi:"quotaName"`
// The unit of the quota application.
QuotaUnit *string `pulumi:"quotaUnit"`
// The reason of the quota application.
Reason *string `pulumi:"reason"`
// The status of the quota application.
Status *string `pulumi:"status"`
}
type QuotaApplicationState struct {
// The approve value of the quota application.
ApproveValue pulumi.StringPtrInput
// The audit mode. Valid values: `Async`, `Sync`. Default to: `Async`.
AuditMode pulumi.StringPtrInput
// The audit reason.
AuditReason pulumi.StringPtrInput
// The desire value of the quota application.
DesireValue pulumi.Float64PtrInput
// The quota dimensions.
Dimensions QuotaApplicationDimensionArrayInput
// The effective time of the quota application.
EffectiveTime pulumi.StringPtrInput
// The expire time of the quota application.
ExpireTime pulumi.StringPtrInput
// The notice type. Valid values: `0`, `1`, `2`, `3`.
NoticeType pulumi.IntPtrInput
// The product code.
ProductCode pulumi.StringPtrInput
// The ID of quota action.
QuotaActionCode pulumi.StringPtrInput
// The quota category. Valid values: `CommonQuota`, `FlowControl`.
QuotaCategory pulumi.StringPtrInput
// The description of the quota application.
QuotaDescription pulumi.StringPtrInput
// The name of the quota application.
QuotaName pulumi.StringPtrInput
// The unit of the quota application.
QuotaUnit pulumi.StringPtrInput
// The reason of the quota application.
Reason pulumi.StringPtrInput
// The status of the quota application.
Status pulumi.StringPtrInput
}
func (QuotaApplicationState) ElementType() reflect.Type {
return reflect.TypeOf((*quotaApplicationState)(nil)).Elem()
}
type quotaApplicationArgs struct {
// The audit mode. Valid values: `Async`, `Sync`. Default to: `Async`.
AuditMode *string `pulumi:"auditMode"`
// The desire value of the quota application.
DesireValue float64 `pulumi:"desireValue"`
// The quota dimensions.
Dimensions []QuotaApplicationDimension `pulumi:"dimensions"`
// The notice type. Valid values: `0`, `1`, `2`, `3`.
NoticeType *int `pulumi:"noticeType"`
// The product code.
ProductCode string `pulumi:"productCode"`
// The ID of quota action.
QuotaActionCode string `pulumi:"quotaActionCode"`
// The quota category. Valid values: `CommonQuota`, `FlowControl`.
QuotaCategory *string `pulumi:"quotaCategory"`
// The reason of the quota application.
Reason string `pulumi:"reason"`
}
// The set of arguments for constructing a QuotaApplication resource.
type QuotaApplicationArgs struct {
// The audit mode. Valid values: `Async`, `Sync`. Default to: `Async`.
AuditMode pulumi.StringPtrInput
// The desire value of the quota application.
DesireValue pulumi.Float64Input
// The quota dimensions.
Dimensions QuotaApplicationDimensionArrayInput
// The notice type. Valid values: `0`, `1`, `2`, `3`.
NoticeType pulumi.IntPtrInput
// The product code.
ProductCode pulumi.StringInput
// The ID of quota action.
QuotaActionCode pulumi.StringInput
// The quota category. Valid values: `CommonQuota`, `FlowControl`.
QuotaCategory pulumi.StringPtrInput
// The reason of the quota application.
Reason pulumi.StringInput
}
func (QuotaApplicationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*quotaApplicationArgs)(nil)).Elem()
}
type QuotaApplicationInput interface {
pulumi.Input
ToQuotaApplicationOutput() QuotaApplicationOutput
ToQuotaApplicationOutputWithContext(ctx context.Context) QuotaApplicationOutput
}
func (*QuotaApplication) ElementType() reflect.Type {
return reflect.TypeOf((**QuotaApplication)(nil)).Elem()
}
func (i *QuotaApplication) ToQuotaApplicationOutput() QuotaApplicationOutput {
return i.ToQuotaApplicationOutputWithContext(context.Background())
}
func (i *QuotaApplication) ToQuotaApplicationOutputWithContext(ctx context.Context) QuotaApplicationOutput {
return pulumi.ToOutputWithContext(ctx, i).(QuotaApplicationOutput)
}
// QuotaApplicationArrayInput is an input type that accepts QuotaApplicationArray and QuotaApplicationArrayOutput values.
// You can construct a concrete instance of `QuotaApplicationArrayInput` via:
//
// QuotaApplicationArray{ QuotaApplicationArgs{...} }
type QuotaApplicationArrayInput interface {
pulumi.Input
ToQuotaApplicationArrayOutput() QuotaApplicationArrayOutput
ToQuotaApplicationArrayOutputWithContext(context.Context) QuotaApplicationArrayOutput
}
type QuotaApplicationArray []QuotaApplicationInput
func (QuotaApplicationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*QuotaApplication)(nil)).Elem()
}
func (i QuotaApplicationArray) ToQuotaApplicationArrayOutput() QuotaApplicationArrayOutput {
return i.ToQuotaApplicationArrayOutputWithContext(context.Background())
}
func (i QuotaApplicationArray) ToQuotaApplicationArrayOutputWithContext(ctx context.Context) QuotaApplicationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(QuotaApplicationArrayOutput)
}
// QuotaApplicationMapInput is an input type that accepts QuotaApplicationMap and QuotaApplicationMapOutput values.
// You can construct a concrete instance of `QuotaApplicationMapInput` via:
//
// QuotaApplicationMap{ "key": QuotaApplicationArgs{...} }
type QuotaApplicationMapInput interface {
pulumi.Input
ToQuotaApplicationMapOutput() QuotaApplicationMapOutput
ToQuotaApplicationMapOutputWithContext(context.Context) QuotaApplicationMapOutput
}
type QuotaApplicationMap map[string]QuotaApplicationInput
func (QuotaApplicationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*QuotaApplication)(nil)).Elem()
}
func (i QuotaApplicationMap) ToQuotaApplicationMapOutput() QuotaApplicationMapOutput {
return i.ToQuotaApplicationMapOutputWithContext(context.Background())
}
func (i QuotaApplicationMap) ToQuotaApplicationMapOutputWithContext(ctx context.Context) QuotaApplicationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(QuotaApplicationMapOutput)
}
type QuotaApplicationOutput struct{ *pulumi.OutputState }
func (QuotaApplicationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**QuotaApplication)(nil)).Elem()
}
func (o QuotaApplicationOutput) ToQuotaApplicationOutput() QuotaApplicationOutput {
return o
}
func (o QuotaApplicationOutput) ToQuotaApplicationOutputWithContext(ctx context.Context) QuotaApplicationOutput {
return o
}
// The approve value of the quota application.
func (o QuotaApplicationOutput) ApproveValue() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.ApproveValue }).(pulumi.StringOutput)
}
// The audit mode. Valid values: `Async`, `Sync`. Default to: `Async`.
func (o QuotaApplicationOutput) AuditMode() pulumi.StringPtrOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringPtrOutput { return v.AuditMode }).(pulumi.StringPtrOutput)
}
// The audit reason.
func (o QuotaApplicationOutput) AuditReason() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.AuditReason }).(pulumi.StringOutput)
}
// The desire value of the quota application.
func (o QuotaApplicationOutput) DesireValue() pulumi.Float64Output {
return o.ApplyT(func(v *QuotaApplication) pulumi.Float64Output { return v.DesireValue }).(pulumi.Float64Output)
}
// The quota dimensions.
func (o QuotaApplicationOutput) Dimensions() QuotaApplicationDimensionArrayOutput {
return o.ApplyT(func(v *QuotaApplication) QuotaApplicationDimensionArrayOutput { return v.Dimensions }).(QuotaApplicationDimensionArrayOutput)
}
// The effective time of the quota application.
func (o QuotaApplicationOutput) EffectiveTime() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.EffectiveTime }).(pulumi.StringOutput)
}
// The expire time of the quota application.
func (o QuotaApplicationOutput) ExpireTime() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.ExpireTime }).(pulumi.StringOutput)
}
// The notice type. Valid values: `0`, `1`, `2`, `3`.
func (o QuotaApplicationOutput) NoticeType() pulumi.IntPtrOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.IntPtrOutput { return v.NoticeType }).(pulumi.IntPtrOutput)
}
// The product code.
func (o QuotaApplicationOutput) ProductCode() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.ProductCode }).(pulumi.StringOutput)
}
// The ID of quota action.
func (o QuotaApplicationOutput) QuotaActionCode() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.QuotaActionCode }).(pulumi.StringOutput)
}
// The quota category. Valid values: `CommonQuota`, `FlowControl`.
func (o QuotaApplicationOutput) QuotaCategory() pulumi.StringPtrOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringPtrOutput { return v.QuotaCategory }).(pulumi.StringPtrOutput)
}
// The description of the quota application.
func (o QuotaApplicationOutput) QuotaDescription() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.QuotaDescription }).(pulumi.StringOutput)
}
// The name of the quota application.
func (o QuotaApplicationOutput) QuotaName() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.QuotaName }).(pulumi.StringOutput)
}
// The unit of the quota application.
func (o QuotaApplicationOutput) QuotaUnit() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.QuotaUnit }).(pulumi.StringOutput)
}
// The reason of the quota application.
func (o QuotaApplicationOutput) Reason() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.Reason }).(pulumi.StringOutput)
}
// The status of the quota application.
func (o QuotaApplicationOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *QuotaApplication) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
type QuotaApplicationArrayOutput struct{ *pulumi.OutputState }
func (QuotaApplicationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*QuotaApplication)(nil)).Elem()
}
func (o QuotaApplicationArrayOutput) ToQuotaApplicationArrayOutput() QuotaApplicationArrayOutput {
return o
}
func (o QuotaApplicationArrayOutput) ToQuotaApplicationArrayOutputWithContext(ctx context.Context) QuotaApplicationArrayOutput {
return o
}
func (o QuotaApplicationArrayOutput) Index(i pulumi.IntInput) QuotaApplicationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *QuotaApplication {
return vs[0].([]*QuotaApplication)[vs[1].(int)]
}).(QuotaApplicationOutput)
}
type QuotaApplicationMapOutput struct{ *pulumi.OutputState }
func (QuotaApplicationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*QuotaApplication)(nil)).Elem()
}
func (o QuotaApplicationMapOutput) ToQuotaApplicationMapOutput() QuotaApplicationMapOutput {
return o
}
func (o QuotaApplicationMapOutput) ToQuotaApplicationMapOutputWithContext(ctx context.Context) QuotaApplicationMapOutput {
return o
}
func (o QuotaApplicationMapOutput) MapIndex(k pulumi.StringInput) QuotaApplicationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *QuotaApplication {
return vs[0].(map[string]*QuotaApplication)[vs[1].(string)]
}).(QuotaApplicationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*QuotaApplicationInput)(nil)).Elem(), &QuotaApplication{})
pulumi.RegisterInputType(reflect.TypeOf((*QuotaApplicationArrayInput)(nil)).Elem(), QuotaApplicationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*QuotaApplicationMapInput)(nil)).Elem(), QuotaApplicationMap{})
pulumi.RegisterOutputType(QuotaApplicationOutput{})
pulumi.RegisterOutputType(QuotaApplicationArrayOutput{})
pulumi.RegisterOutputType(QuotaApplicationMapOutput{})
}