generated from pulumi/pulumi-tf-provider-boilerplate
/
apiKey.go
312 lines (259 loc) · 11.7 KB
/
apiKey.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
// 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"
"errors"
"github.com/mergtil/pulumi-tencentcloud/sdk/go/tencentcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type ApiKey struct {
pulumi.CustomResourceState
// User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters,
// numbers, and English underscores.
AccessKeyId pulumi.StringOutput `pulumi:"accessKeyId"`
// The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of
// letters, numbers, and English underscores.
AccessKeySecret pulumi.StringOutput `pulumi:"accessKeySecret"`
// Key type, supports both auto and manual (custom keys), defaults to auto.
AccessKeyType pulumi.StringPtrOutput `pulumi:"accessKeyType"`
// 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"`
// 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 key name.
SecretName pulumi.StringOutput `pulumi:"secretName"`
// Key status. Valid values: `on`, `off`.
Status pulumi.StringPtrOutput `pulumi:"status"`
}
// NewApiKey registers a new resource with the given unique name, arguments, and options.
func NewApiKey(ctx *pulumi.Context,
name string, args *ApiKeyArgs, opts ...pulumi.ResourceOption) (*ApiKey, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SecretName == nil {
return nil, errors.New("invalid value for required argument 'SecretName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ApiKey
err := ctx.RegisterResource("tencentcloud:ApiGateway/apiKey:ApiKey", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetApiKey gets an existing ApiKey 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 GetApiKey(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ApiKeyState, opts ...pulumi.ResourceOption) (*ApiKey, error) {
var resource ApiKey
err := ctx.ReadResource("tencentcloud:ApiGateway/apiKey:ApiKey", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ApiKey resources.
type apiKeyState struct {
// User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters,
// numbers, and English underscores.
AccessKeyId *string `pulumi:"accessKeyId"`
// The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of
// letters, numbers, and English underscores.
AccessKeySecret *string `pulumi:"accessKeySecret"`
// Key type, supports both auto and manual (custom keys), defaults to auto.
AccessKeyType *string `pulumi:"accessKeyType"`
// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
CreateTime *string `pulumi:"createTime"`
// 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 key name.
SecretName *string `pulumi:"secretName"`
// Key status. Valid values: `on`, `off`.
Status *string `pulumi:"status"`
}
type ApiKeyState struct {
// User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters,
// numbers, and English underscores.
AccessKeyId pulumi.StringPtrInput
// The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of
// letters, numbers, and English underscores.
AccessKeySecret pulumi.StringPtrInput
// Key type, supports both auto and manual (custom keys), defaults to auto.
AccessKeyType pulumi.StringPtrInput
// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
CreateTime pulumi.StringPtrInput
// 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 key name.
SecretName pulumi.StringPtrInput
// Key status. Valid values: `on`, `off`.
Status pulumi.StringPtrInput
}
func (ApiKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*apiKeyState)(nil)).Elem()
}
type apiKeyArgs struct {
// User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters,
// numbers, and English underscores.
AccessKeyId *string `pulumi:"accessKeyId"`
// The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of
// letters, numbers, and English underscores.
AccessKeySecret *string `pulumi:"accessKeySecret"`
// Key type, supports both auto and manual (custom keys), defaults to auto.
AccessKeyType *string `pulumi:"accessKeyType"`
// Custom key name.
SecretName string `pulumi:"secretName"`
// Key status. Valid values: `on`, `off`.
Status *string `pulumi:"status"`
}
// The set of arguments for constructing a ApiKey resource.
type ApiKeyArgs struct {
// User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters,
// numbers, and English underscores.
AccessKeyId pulumi.StringPtrInput
// The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of
// letters, numbers, and English underscores.
AccessKeySecret pulumi.StringPtrInput
// Key type, supports both auto and manual (custom keys), defaults to auto.
AccessKeyType pulumi.StringPtrInput
// Custom key name.
SecretName pulumi.StringInput
// Key status. Valid values: `on`, `off`.
Status pulumi.StringPtrInput
}
func (ApiKeyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*apiKeyArgs)(nil)).Elem()
}
type ApiKeyInput interface {
pulumi.Input
ToApiKeyOutput() ApiKeyOutput
ToApiKeyOutputWithContext(ctx context.Context) ApiKeyOutput
}
func (*ApiKey) ElementType() reflect.Type {
return reflect.TypeOf((**ApiKey)(nil)).Elem()
}
func (i *ApiKey) ToApiKeyOutput() ApiKeyOutput {
return i.ToApiKeyOutputWithContext(context.Background())
}
func (i *ApiKey) ToApiKeyOutputWithContext(ctx context.Context) ApiKeyOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiKeyOutput)
}
// ApiKeyArrayInput is an input type that accepts ApiKeyArray and ApiKeyArrayOutput values.
// You can construct a concrete instance of `ApiKeyArrayInput` via:
//
// ApiKeyArray{ ApiKeyArgs{...} }
type ApiKeyArrayInput interface {
pulumi.Input
ToApiKeyArrayOutput() ApiKeyArrayOutput
ToApiKeyArrayOutputWithContext(context.Context) ApiKeyArrayOutput
}
type ApiKeyArray []ApiKeyInput
func (ApiKeyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApiKey)(nil)).Elem()
}
func (i ApiKeyArray) ToApiKeyArrayOutput() ApiKeyArrayOutput {
return i.ToApiKeyArrayOutputWithContext(context.Background())
}
func (i ApiKeyArray) ToApiKeyArrayOutputWithContext(ctx context.Context) ApiKeyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiKeyArrayOutput)
}
// ApiKeyMapInput is an input type that accepts ApiKeyMap and ApiKeyMapOutput values.
// You can construct a concrete instance of `ApiKeyMapInput` via:
//
// ApiKeyMap{ "key": ApiKeyArgs{...} }
type ApiKeyMapInput interface {
pulumi.Input
ToApiKeyMapOutput() ApiKeyMapOutput
ToApiKeyMapOutputWithContext(context.Context) ApiKeyMapOutput
}
type ApiKeyMap map[string]ApiKeyInput
func (ApiKeyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApiKey)(nil)).Elem()
}
func (i ApiKeyMap) ToApiKeyMapOutput() ApiKeyMapOutput {
return i.ToApiKeyMapOutputWithContext(context.Background())
}
func (i ApiKeyMap) ToApiKeyMapOutputWithContext(ctx context.Context) ApiKeyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ApiKeyMapOutput)
}
type ApiKeyOutput struct{ *pulumi.OutputState }
func (ApiKeyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ApiKey)(nil)).Elem()
}
func (o ApiKeyOutput) ToApiKeyOutput() ApiKeyOutput {
return o
}
func (o ApiKeyOutput) ToApiKeyOutputWithContext(ctx context.Context) ApiKeyOutput {
return o
}
// User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters,
// numbers, and English underscores.
func (o ApiKeyOutput) AccessKeyId() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.AccessKeyId }).(pulumi.StringOutput)
}
// The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of
// letters, numbers, and English underscores.
func (o ApiKeyOutput) AccessKeySecret() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.AccessKeySecret }).(pulumi.StringOutput)
}
// Key type, supports both auto and manual (custom keys), defaults to auto.
func (o ApiKeyOutput) AccessKeyType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringPtrOutput { return v.AccessKeyType }).(pulumi.StringPtrOutput)
}
// Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
func (o ApiKeyOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
func (o ApiKeyOutput) ModifyTime() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.ModifyTime }).(pulumi.StringOutput)
}
// Custom key name.
func (o ApiKeyOutput) SecretName() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.SecretName }).(pulumi.StringOutput)
}
// Key status. Valid values: `on`, `off`.
func (o ApiKeyOutput) Status() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringPtrOutput { return v.Status }).(pulumi.StringPtrOutput)
}
type ApiKeyArrayOutput struct{ *pulumi.OutputState }
func (ApiKeyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ApiKey)(nil)).Elem()
}
func (o ApiKeyArrayOutput) ToApiKeyArrayOutput() ApiKeyArrayOutput {
return o
}
func (o ApiKeyArrayOutput) ToApiKeyArrayOutputWithContext(ctx context.Context) ApiKeyArrayOutput {
return o
}
func (o ApiKeyArrayOutput) Index(i pulumi.IntInput) ApiKeyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApiKey {
return vs[0].([]*ApiKey)[vs[1].(int)]
}).(ApiKeyOutput)
}
type ApiKeyMapOutput struct{ *pulumi.OutputState }
func (ApiKeyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ApiKey)(nil)).Elem()
}
func (o ApiKeyMapOutput) ToApiKeyMapOutput() ApiKeyMapOutput {
return o
}
func (o ApiKeyMapOutput) ToApiKeyMapOutputWithContext(ctx context.Context) ApiKeyMapOutput {
return o
}
func (o ApiKeyMapOutput) MapIndex(k pulumi.StringInput) ApiKeyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApiKey {
return vs[0].(map[string]*ApiKey)[vs[1].(string)]
}).(ApiKeyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ApiKeyInput)(nil)).Elem(), &ApiKey{})
pulumi.RegisterInputType(reflect.TypeOf((*ApiKeyArrayInput)(nil)).Elem(), ApiKeyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ApiKeyMapInput)(nil)).Elem(), ApiKeyMap{})
pulumi.RegisterOutputType(ApiKeyOutput{})
pulumi.RegisterOutputType(ApiKeyArrayOutput{})
pulumi.RegisterOutputType(ApiKeyMapOutput{})
}