generated from pulumi/pulumi-tf-provider-boilerplate
/
apiKey.go
265 lines (218 loc) · 9.14 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
// 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 artifactory
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an Artifactory API key resource. This can be used to create and manage Artifactory API keys.
//
// > **Note:** API keys will be stored in the raw state as plain-text. Read more about sensitive data in state.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-artifactory/sdk/v3/go/artifactory"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := artifactory.NewApiKey(ctx, "ci", nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// A user's API key can be imported using any identifier, e.g.
//
// ```sh
//
// $ pulumi import artifactory:index/apiKey:ApiKey test import
//
// ```
type ApiKey struct {
pulumi.CustomResourceState
// The API key. Deprecated. An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).
// In September 2022, the option to block the usage/creation of API Keys will be enabled by default, with the option for admins to change it back to enable API Keys.
// In January 2023, API Keys will be deprecated all together and the option to use them will no longer be available.
// It is recommended to use scoped tokens instead - `ScopedToken` resource.
// Please check the [release notes](https://www.jfrog.com/confluence/display/JFROG/Artifactory+Release+Notes#ArtifactoryReleaseNotes-Artifactory7.38.4).
ApiKey pulumi.StringOutput `pulumi:"apiKey"`
}
// 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 {
args = &ApiKeyArgs{}
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"apiKey",
})
opts = append(opts, secrets)
var resource ApiKey
err := ctx.RegisterResource("artifactory:index/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("artifactory:index/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 {
// The API key. Deprecated. An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).
// In September 2022, the option to block the usage/creation of API Keys will be enabled by default, with the option for admins to change it back to enable API Keys.
// In January 2023, API Keys will be deprecated all together and the option to use them will no longer be available.
// It is recommended to use scoped tokens instead - `ScopedToken` resource.
// Please check the [release notes](https://www.jfrog.com/confluence/display/JFROG/Artifactory+Release+Notes#ArtifactoryReleaseNotes-Artifactory7.38.4).
ApiKey *string `pulumi:"apiKey"`
}
type ApiKeyState struct {
// The API key. Deprecated. An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).
// In September 2022, the option to block the usage/creation of API Keys will be enabled by default, with the option for admins to change it back to enable API Keys.
// In January 2023, API Keys will be deprecated all together and the option to use them will no longer be available.
// It is recommended to use scoped tokens instead - `ScopedToken` resource.
// Please check the [release notes](https://www.jfrog.com/confluence/display/JFROG/Artifactory+Release+Notes#ArtifactoryReleaseNotes-Artifactory7.38.4).
ApiKey pulumi.StringPtrInput
}
func (ApiKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*apiKeyState)(nil)).Elem()
}
type apiKeyArgs struct {
}
// The set of arguments for constructing a ApiKey resource.
type ApiKeyArgs struct {
}
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
}
// The API key. Deprecated. An upcoming version will support the option to block the usage/creation of API Keys (for admins to set on their platform).
// In September 2022, the option to block the usage/creation of API Keys will be enabled by default, with the option for admins to change it back to enable API Keys.
// In January 2023, API Keys will be deprecated all together and the option to use them will no longer be available.
// It is recommended to use scoped tokens instead - `ScopedToken` resource.
// Please check the [release notes](https://www.jfrog.com/confluence/display/JFROG/Artifactory+Release+Notes#ArtifactoryReleaseNotes-Artifactory7.38.4).
func (o ApiKeyOutput) ApiKey() pulumi.StringOutput {
return o.ApplyT(func(v *ApiKey) pulumi.StringOutput { return v.ApiKey }).(pulumi.StringOutput)
}
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{})
}