This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
pair.go
249 lines (200 loc) · 7.65 KB
/
pair.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
// 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 key
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Pair struct {
pulumi.CustomResourceState
// The key pair's name. It is the only in one TencentCloud account.
KeyName pulumi.StringOutput `pulumi:"keyName"`
// Specifys to which project the key pair belongs.
ProjectId pulumi.IntPtrOutput `pulumi:"projectId"`
// You can import an existing public key and using TencentCloud key pair to manage it.
PublicKey pulumi.StringOutput `pulumi:"publicKey"`
}
// NewPair registers a new resource with the given unique name, arguments, and options.
func NewPair(ctx *pulumi.Context,
name string, args *PairArgs, opts ...pulumi.ResourceOption) (*Pair, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.KeyName == nil {
return nil, errors.New("invalid value for required argument 'KeyName'")
}
if args.PublicKey == nil {
return nil, errors.New("invalid value for required argument 'PublicKey'")
}
var resource Pair
err := ctx.RegisterResource("tctest:Key/pair:Pair", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetPair gets an existing Pair 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 GetPair(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *PairState, opts ...pulumi.ResourceOption) (*Pair, error) {
var resource Pair
err := ctx.ReadResource("tctest:Key/pair:Pair", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Pair resources.
type pairState struct {
// The key pair's name. It is the only in one TencentCloud account.
KeyName *string `pulumi:"keyName"`
// Specifys to which project the key pair belongs.
ProjectId *int `pulumi:"projectId"`
// You can import an existing public key and using TencentCloud key pair to manage it.
PublicKey *string `pulumi:"publicKey"`
}
type PairState struct {
// The key pair's name. It is the only in one TencentCloud account.
KeyName pulumi.StringPtrInput
// Specifys to which project the key pair belongs.
ProjectId pulumi.IntPtrInput
// You can import an existing public key and using TencentCloud key pair to manage it.
PublicKey pulumi.StringPtrInput
}
func (PairState) ElementType() reflect.Type {
return reflect.TypeOf((*pairState)(nil)).Elem()
}
type pairArgs struct {
// The key pair's name. It is the only in one TencentCloud account.
KeyName string `pulumi:"keyName"`
// Specifys to which project the key pair belongs.
ProjectId *int `pulumi:"projectId"`
// You can import an existing public key and using TencentCloud key pair to manage it.
PublicKey string `pulumi:"publicKey"`
}
// The set of arguments for constructing a Pair resource.
type PairArgs struct {
// The key pair's name. It is the only in one TencentCloud account.
KeyName pulumi.StringInput
// Specifys to which project the key pair belongs.
ProjectId pulumi.IntPtrInput
// You can import an existing public key and using TencentCloud key pair to manage it.
PublicKey pulumi.StringInput
}
func (PairArgs) ElementType() reflect.Type {
return reflect.TypeOf((*pairArgs)(nil)).Elem()
}
type PairInput interface {
pulumi.Input
ToPairOutput() PairOutput
ToPairOutputWithContext(ctx context.Context) PairOutput
}
func (*Pair) ElementType() reflect.Type {
return reflect.TypeOf((**Pair)(nil)).Elem()
}
func (i *Pair) ToPairOutput() PairOutput {
return i.ToPairOutputWithContext(context.Background())
}
func (i *Pair) ToPairOutputWithContext(ctx context.Context) PairOutput {
return pulumi.ToOutputWithContext(ctx, i).(PairOutput)
}
// PairArrayInput is an input type that accepts PairArray and PairArrayOutput values.
// You can construct a concrete instance of `PairArrayInput` via:
//
// PairArray{ PairArgs{...} }
type PairArrayInput interface {
pulumi.Input
ToPairArrayOutput() PairArrayOutput
ToPairArrayOutputWithContext(context.Context) PairArrayOutput
}
type PairArray []PairInput
func (PairArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Pair)(nil)).Elem()
}
func (i PairArray) ToPairArrayOutput() PairArrayOutput {
return i.ToPairArrayOutputWithContext(context.Background())
}
func (i PairArray) ToPairArrayOutputWithContext(ctx context.Context) PairArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(PairArrayOutput)
}
// PairMapInput is an input type that accepts PairMap and PairMapOutput values.
// You can construct a concrete instance of `PairMapInput` via:
//
// PairMap{ "key": PairArgs{...} }
type PairMapInput interface {
pulumi.Input
ToPairMapOutput() PairMapOutput
ToPairMapOutputWithContext(context.Context) PairMapOutput
}
type PairMap map[string]PairInput
func (PairMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Pair)(nil)).Elem()
}
func (i PairMap) ToPairMapOutput() PairMapOutput {
return i.ToPairMapOutputWithContext(context.Background())
}
func (i PairMap) ToPairMapOutputWithContext(ctx context.Context) PairMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(PairMapOutput)
}
type PairOutput struct{ *pulumi.OutputState }
func (PairOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Pair)(nil)).Elem()
}
func (o PairOutput) ToPairOutput() PairOutput {
return o
}
func (o PairOutput) ToPairOutputWithContext(ctx context.Context) PairOutput {
return o
}
// The key pair's name. It is the only in one TencentCloud account.
func (o PairOutput) KeyName() pulumi.StringOutput {
return o.ApplyT(func(v *Pair) pulumi.StringOutput { return v.KeyName }).(pulumi.StringOutput)
}
// Specifys to which project the key pair belongs.
func (o PairOutput) ProjectId() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Pair) pulumi.IntPtrOutput { return v.ProjectId }).(pulumi.IntPtrOutput)
}
// You can import an existing public key and using TencentCloud key pair to manage it.
func (o PairOutput) PublicKey() pulumi.StringOutput {
return o.ApplyT(func(v *Pair) pulumi.StringOutput { return v.PublicKey }).(pulumi.StringOutput)
}
type PairArrayOutput struct{ *pulumi.OutputState }
func (PairArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Pair)(nil)).Elem()
}
func (o PairArrayOutput) ToPairArrayOutput() PairArrayOutput {
return o
}
func (o PairArrayOutput) ToPairArrayOutputWithContext(ctx context.Context) PairArrayOutput {
return o
}
func (o PairArrayOutput) Index(i pulumi.IntInput) PairOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Pair {
return vs[0].([]*Pair)[vs[1].(int)]
}).(PairOutput)
}
type PairMapOutput struct{ *pulumi.OutputState }
func (PairMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Pair)(nil)).Elem()
}
func (o PairMapOutput) ToPairMapOutput() PairMapOutput {
return o
}
func (o PairMapOutput) ToPairMapOutputWithContext(ctx context.Context) PairMapOutput {
return o
}
func (o PairMapOutput) MapIndex(k pulumi.StringInput) PairOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Pair {
return vs[0].(map[string]*Pair)[vs[1].(string)]
}).(PairOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*PairInput)(nil)).Elem(), &Pair{})
pulumi.RegisterInputType(reflect.TypeOf((*PairArrayInput)(nil)).Elem(), PairArray{})
pulumi.RegisterInputType(reflect.TypeOf((*PairMapInput)(nil)).Elem(), PairMap{})
pulumi.RegisterOutputType(PairOutput{})
pulumi.RegisterOutputType(PairArrayOutput{})
pulumi.RegisterOutputType(PairMapOutput{})
}