This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
usagePlan.go
305 lines (251 loc) · 11.7 KB
/
usagePlan.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
// 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 apigateway
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type UsagePlan struct {
pulumi.CustomResourceState
// Attach API keys list.
AttachApiKeys pulumi.StringArrayOutput `pulumi:"attachApiKeys"`
// Attach service and API list.
AttachLists UsagePlanAttachListArrayOutput `pulumi:"attachLists"`
// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
MaxRequestNum pulumi.IntPtrOutput `pulumi:"maxRequestNum"`
// Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
MaxRequestNumPreSec pulumi.IntPtrOutput `pulumi:"maxRequestNumPreSec"`
// Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
ModifyTime pulumi.StringOutput `pulumi:"modifyTime"`
// Custom usage plan description.
UsagePlanDesc pulumi.StringPtrOutput `pulumi:"usagePlanDesc"`
// Custom usage plan name.
UsagePlanName pulumi.StringOutput `pulumi:"usagePlanName"`
}
// NewUsagePlan registers a new resource with the given unique name, arguments, and options.
func NewUsagePlan(ctx *pulumi.Context,
name string, args *UsagePlanArgs, opts ...pulumi.ResourceOption) (*UsagePlan, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.UsagePlanName == nil {
return nil, errors.New("invalid value for required argument 'UsagePlanName'")
}
var resource UsagePlan
err := ctx.RegisterResource("tctest:APIGateway/usagePlan:UsagePlan", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUsagePlan gets an existing UsagePlan 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 GetUsagePlan(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UsagePlanState, opts ...pulumi.ResourceOption) (*UsagePlan, error) {
var resource UsagePlan
err := ctx.ReadResource("tctest:APIGateway/usagePlan:UsagePlan", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UsagePlan resources.
type usagePlanState struct {
// Attach API keys list.
AttachApiKeys []string `pulumi:"attachApiKeys"`
// Attach service and API list.
AttachLists []UsagePlanAttachList `pulumi:"attachLists"`
// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
CreateTime *string `pulumi:"createTime"`
// Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
MaxRequestNum *int `pulumi:"maxRequestNum"`
// Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
MaxRequestNumPreSec *int `pulumi:"maxRequestNumPreSec"`
// Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
ModifyTime *string `pulumi:"modifyTime"`
// Custom usage plan description.
UsagePlanDesc *string `pulumi:"usagePlanDesc"`
// Custom usage plan name.
UsagePlanName *string `pulumi:"usagePlanName"`
}
type UsagePlanState struct {
// Attach API keys list.
AttachApiKeys pulumi.StringArrayInput
// Attach service and API list.
AttachLists UsagePlanAttachListArrayInput
// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
CreateTime pulumi.StringPtrInput
// Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
MaxRequestNum pulumi.IntPtrInput
// Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
MaxRequestNumPreSec pulumi.IntPtrInput
// Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
ModifyTime pulumi.StringPtrInput
// Custom usage plan description.
UsagePlanDesc pulumi.StringPtrInput
// Custom usage plan name.
UsagePlanName pulumi.StringPtrInput
}
func (UsagePlanState) ElementType() reflect.Type {
return reflect.TypeOf((*usagePlanState)(nil)).Elem()
}
type usagePlanArgs struct {
// Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
MaxRequestNum *int `pulumi:"maxRequestNum"`
// Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
MaxRequestNumPreSec *int `pulumi:"maxRequestNumPreSec"`
// Custom usage plan description.
UsagePlanDesc *string `pulumi:"usagePlanDesc"`
// Custom usage plan name.
UsagePlanName string `pulumi:"usagePlanName"`
}
// The set of arguments for constructing a UsagePlan resource.
type UsagePlanArgs struct {
// Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
MaxRequestNum pulumi.IntPtrInput
// Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
MaxRequestNumPreSec pulumi.IntPtrInput
// Custom usage plan description.
UsagePlanDesc pulumi.StringPtrInput
// Custom usage plan name.
UsagePlanName pulumi.StringInput
}
func (UsagePlanArgs) ElementType() reflect.Type {
return reflect.TypeOf((*usagePlanArgs)(nil)).Elem()
}
type UsagePlanInput interface {
pulumi.Input
ToUsagePlanOutput() UsagePlanOutput
ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput
}
func (*UsagePlan) ElementType() reflect.Type {
return reflect.TypeOf((**UsagePlan)(nil)).Elem()
}
func (i *UsagePlan) ToUsagePlanOutput() UsagePlanOutput {
return i.ToUsagePlanOutputWithContext(context.Background())
}
func (i *UsagePlan) ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput {
return pulumi.ToOutputWithContext(ctx, i).(UsagePlanOutput)
}
// UsagePlanArrayInput is an input type that accepts UsagePlanArray and UsagePlanArrayOutput values.
// You can construct a concrete instance of `UsagePlanArrayInput` via:
//
// UsagePlanArray{ UsagePlanArgs{...} }
type UsagePlanArrayInput interface {
pulumi.Input
ToUsagePlanArrayOutput() UsagePlanArrayOutput
ToUsagePlanArrayOutputWithContext(context.Context) UsagePlanArrayOutput
}
type UsagePlanArray []UsagePlanInput
func (UsagePlanArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UsagePlan)(nil)).Elem()
}
func (i UsagePlanArray) ToUsagePlanArrayOutput() UsagePlanArrayOutput {
return i.ToUsagePlanArrayOutputWithContext(context.Background())
}
func (i UsagePlanArray) ToUsagePlanArrayOutputWithContext(ctx context.Context) UsagePlanArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(UsagePlanArrayOutput)
}
// UsagePlanMapInput is an input type that accepts UsagePlanMap and UsagePlanMapOutput values.
// You can construct a concrete instance of `UsagePlanMapInput` via:
//
// UsagePlanMap{ "key": UsagePlanArgs{...} }
type UsagePlanMapInput interface {
pulumi.Input
ToUsagePlanMapOutput() UsagePlanMapOutput
ToUsagePlanMapOutputWithContext(context.Context) UsagePlanMapOutput
}
type UsagePlanMap map[string]UsagePlanInput
func (UsagePlanMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UsagePlan)(nil)).Elem()
}
func (i UsagePlanMap) ToUsagePlanMapOutput() UsagePlanMapOutput {
return i.ToUsagePlanMapOutputWithContext(context.Background())
}
func (i UsagePlanMap) ToUsagePlanMapOutputWithContext(ctx context.Context) UsagePlanMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(UsagePlanMapOutput)
}
type UsagePlanOutput struct{ *pulumi.OutputState }
func (UsagePlanOutput) ElementType() reflect.Type {
return reflect.TypeOf((**UsagePlan)(nil)).Elem()
}
func (o UsagePlanOutput) ToUsagePlanOutput() UsagePlanOutput {
return o
}
func (o UsagePlanOutput) ToUsagePlanOutputWithContext(ctx context.Context) UsagePlanOutput {
return o
}
// Attach API keys list.
func (o UsagePlanOutput) AttachApiKeys() pulumi.StringArrayOutput {
return o.ApplyT(func(v *UsagePlan) pulumi.StringArrayOutput { return v.AttachApiKeys }).(pulumi.StringArrayOutput)
}
// Attach service and API list.
func (o UsagePlanOutput) AttachLists() UsagePlanAttachListArrayOutput {
return o.ApplyT(func(v *UsagePlan) UsagePlanAttachListArrayOutput { return v.AttachLists }).(UsagePlanAttachListArrayOutput)
}
// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
func (o UsagePlanOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *UsagePlan) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Total number of requests allowed. Valid values: -1, [1,99999999]. The default value is -1, which indicates no limit.
func (o UsagePlanOutput) MaxRequestNum() pulumi.IntPtrOutput {
return o.ApplyT(func(v *UsagePlan) pulumi.IntPtrOutput { return v.MaxRequestNum }).(pulumi.IntPtrOutput)
}
// Limit of requests per second. Valid values: -1, [1,2000]. The default value is -1, which indicates no limit.
func (o UsagePlanOutput) MaxRequestNumPreSec() pulumi.IntPtrOutput {
return o.ApplyT(func(v *UsagePlan) pulumi.IntPtrOutput { return v.MaxRequestNumPreSec }).(pulumi.IntPtrOutput)
}
// Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
func (o UsagePlanOutput) ModifyTime() pulumi.StringOutput {
return o.ApplyT(func(v *UsagePlan) pulumi.StringOutput { return v.ModifyTime }).(pulumi.StringOutput)
}
// Custom usage plan description.
func (o UsagePlanOutput) UsagePlanDesc() pulumi.StringPtrOutput {
return o.ApplyT(func(v *UsagePlan) pulumi.StringPtrOutput { return v.UsagePlanDesc }).(pulumi.StringPtrOutput)
}
// Custom usage plan name.
func (o UsagePlanOutput) UsagePlanName() pulumi.StringOutput {
return o.ApplyT(func(v *UsagePlan) pulumi.StringOutput { return v.UsagePlanName }).(pulumi.StringOutput)
}
type UsagePlanArrayOutput struct{ *pulumi.OutputState }
func (UsagePlanArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UsagePlan)(nil)).Elem()
}
func (o UsagePlanArrayOutput) ToUsagePlanArrayOutput() UsagePlanArrayOutput {
return o
}
func (o UsagePlanArrayOutput) ToUsagePlanArrayOutputWithContext(ctx context.Context) UsagePlanArrayOutput {
return o
}
func (o UsagePlanArrayOutput) Index(i pulumi.IntInput) UsagePlanOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UsagePlan {
return vs[0].([]*UsagePlan)[vs[1].(int)]
}).(UsagePlanOutput)
}
type UsagePlanMapOutput struct{ *pulumi.OutputState }
func (UsagePlanMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UsagePlan)(nil)).Elem()
}
func (o UsagePlanMapOutput) ToUsagePlanMapOutput() UsagePlanMapOutput {
return o
}
func (o UsagePlanMapOutput) ToUsagePlanMapOutputWithContext(ctx context.Context) UsagePlanMapOutput {
return o
}
func (o UsagePlanMapOutput) MapIndex(k pulumi.StringInput) UsagePlanOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UsagePlan {
return vs[0].(map[string]*UsagePlan)[vs[1].(string)]
}).(UsagePlanOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*UsagePlanInput)(nil)).Elem(), &UsagePlan{})
pulumi.RegisterInputType(reflect.TypeOf((*UsagePlanArrayInput)(nil)).Elem(), UsagePlanArray{})
pulumi.RegisterInputType(reflect.TypeOf((*UsagePlanMapInput)(nil)).Elem(), UsagePlanMap{})
pulumi.RegisterOutputType(UsagePlanOutput{})
pulumi.RegisterOutputType(UsagePlanArrayOutput{})
pulumi.RegisterOutputType(UsagePlanMapOutput{})
}