generated from pulumi/pulumi-tf-provider-boilerplate
/
chartNamespace.go
318 lines (268 loc) · 11.2 KB
/
chartNamespace.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
// 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 cr
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a CR Chart Namespace resource.
//
// For information about CR Chart Namespace and how to use it, see [What is Chart Namespace](https://www.alibabacloud.com/help/doc-detail/145313.htm).
//
// > **NOTE:** Available in v1.149.0+.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/cr"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// defaultRegistryEnterpriseInstance, err := cr.NewRegistryEnterpriseInstance(ctx, "defaultRegistryEnterpriseInstance", &cr.RegistryEnterpriseInstanceArgs{
// PaymentType: pulumi.String("Subscription"),
// Period: pulumi.Int(1),
// InstanceType: pulumi.String("Advanced"),
// InstanceName: pulumi.String("name"),
// })
// if err != nil {
// return err
// }
// _, err = cr.NewChartNamespace(ctx, "defaultChartNamespace", &cr.ChartNamespaceArgs{
// InstanceId: defaultRegistryEnterpriseInstance.ID(),
// NamespaceName: pulumi.String("name"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// CR Chart Namespace can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:cr/chartNamespace:ChartNamespace example <instance_id>:<namespace_name>
//
// ```
type ChartNamespace struct {
pulumi.CustomResourceState
// Specifies whether to automatically create repositories in the namespace. Valid values:
AutoCreateRepo pulumi.BoolOutput `pulumi:"autoCreateRepo"`
// DefaultRepoType. Valid values: `PRIVATE`, `PUBLIC`.
DefaultRepoType pulumi.StringOutput `pulumi:"defaultRepoType"`
// The ID of the Container Registry instance.
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// The name of the namespace that you want to create.
NamespaceName pulumi.StringOutput `pulumi:"namespaceName"`
}
// NewChartNamespace registers a new resource with the given unique name, arguments, and options.
func NewChartNamespace(ctx *pulumi.Context,
name string, args *ChartNamespaceArgs, opts ...pulumi.ResourceOption) (*ChartNamespace, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
if args.NamespaceName == nil {
return nil, errors.New("invalid value for required argument 'NamespaceName'")
}
opts = pkgResourceDefaultOpts(opts)
var resource ChartNamespace
err := ctx.RegisterResource("alicloud:cr/chartNamespace:ChartNamespace", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetChartNamespace gets an existing ChartNamespace 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 GetChartNamespace(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ChartNamespaceState, opts ...pulumi.ResourceOption) (*ChartNamespace, error) {
var resource ChartNamespace
err := ctx.ReadResource("alicloud:cr/chartNamespace:ChartNamespace", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ChartNamespace resources.
type chartNamespaceState struct {
// Specifies whether to automatically create repositories in the namespace. Valid values:
AutoCreateRepo *bool `pulumi:"autoCreateRepo"`
// DefaultRepoType. Valid values: `PRIVATE`, `PUBLIC`.
DefaultRepoType *string `pulumi:"defaultRepoType"`
// The ID of the Container Registry instance.
InstanceId *string `pulumi:"instanceId"`
// The name of the namespace that you want to create.
NamespaceName *string `pulumi:"namespaceName"`
}
type ChartNamespaceState struct {
// Specifies whether to automatically create repositories in the namespace. Valid values:
AutoCreateRepo pulumi.BoolPtrInput
// DefaultRepoType. Valid values: `PRIVATE`, `PUBLIC`.
DefaultRepoType pulumi.StringPtrInput
// The ID of the Container Registry instance.
InstanceId pulumi.StringPtrInput
// The name of the namespace that you want to create.
NamespaceName pulumi.StringPtrInput
}
func (ChartNamespaceState) ElementType() reflect.Type {
return reflect.TypeOf((*chartNamespaceState)(nil)).Elem()
}
type chartNamespaceArgs struct {
// Specifies whether to automatically create repositories in the namespace. Valid values:
AutoCreateRepo *bool `pulumi:"autoCreateRepo"`
// DefaultRepoType. Valid values: `PRIVATE`, `PUBLIC`.
DefaultRepoType *string `pulumi:"defaultRepoType"`
// The ID of the Container Registry instance.
InstanceId string `pulumi:"instanceId"`
// The name of the namespace that you want to create.
NamespaceName string `pulumi:"namespaceName"`
}
// The set of arguments for constructing a ChartNamespace resource.
type ChartNamespaceArgs struct {
// Specifies whether to automatically create repositories in the namespace. Valid values:
AutoCreateRepo pulumi.BoolPtrInput
// DefaultRepoType. Valid values: `PRIVATE`, `PUBLIC`.
DefaultRepoType pulumi.StringPtrInput
// The ID of the Container Registry instance.
InstanceId pulumi.StringInput
// The name of the namespace that you want to create.
NamespaceName pulumi.StringInput
}
func (ChartNamespaceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*chartNamespaceArgs)(nil)).Elem()
}
type ChartNamespaceInput interface {
pulumi.Input
ToChartNamespaceOutput() ChartNamespaceOutput
ToChartNamespaceOutputWithContext(ctx context.Context) ChartNamespaceOutput
}
func (*ChartNamespace) ElementType() reflect.Type {
return reflect.TypeOf((**ChartNamespace)(nil)).Elem()
}
func (i *ChartNamespace) ToChartNamespaceOutput() ChartNamespaceOutput {
return i.ToChartNamespaceOutputWithContext(context.Background())
}
func (i *ChartNamespace) ToChartNamespaceOutputWithContext(ctx context.Context) ChartNamespaceOutput {
return pulumi.ToOutputWithContext(ctx, i).(ChartNamespaceOutput)
}
// ChartNamespaceArrayInput is an input type that accepts ChartNamespaceArray and ChartNamespaceArrayOutput values.
// You can construct a concrete instance of `ChartNamespaceArrayInput` via:
//
// ChartNamespaceArray{ ChartNamespaceArgs{...} }
type ChartNamespaceArrayInput interface {
pulumi.Input
ToChartNamespaceArrayOutput() ChartNamespaceArrayOutput
ToChartNamespaceArrayOutputWithContext(context.Context) ChartNamespaceArrayOutput
}
type ChartNamespaceArray []ChartNamespaceInput
func (ChartNamespaceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ChartNamespace)(nil)).Elem()
}
func (i ChartNamespaceArray) ToChartNamespaceArrayOutput() ChartNamespaceArrayOutput {
return i.ToChartNamespaceArrayOutputWithContext(context.Background())
}
func (i ChartNamespaceArray) ToChartNamespaceArrayOutputWithContext(ctx context.Context) ChartNamespaceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ChartNamespaceArrayOutput)
}
// ChartNamespaceMapInput is an input type that accepts ChartNamespaceMap and ChartNamespaceMapOutput values.
// You can construct a concrete instance of `ChartNamespaceMapInput` via:
//
// ChartNamespaceMap{ "key": ChartNamespaceArgs{...} }
type ChartNamespaceMapInput interface {
pulumi.Input
ToChartNamespaceMapOutput() ChartNamespaceMapOutput
ToChartNamespaceMapOutputWithContext(context.Context) ChartNamespaceMapOutput
}
type ChartNamespaceMap map[string]ChartNamespaceInput
func (ChartNamespaceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ChartNamespace)(nil)).Elem()
}
func (i ChartNamespaceMap) ToChartNamespaceMapOutput() ChartNamespaceMapOutput {
return i.ToChartNamespaceMapOutputWithContext(context.Background())
}
func (i ChartNamespaceMap) ToChartNamespaceMapOutputWithContext(ctx context.Context) ChartNamespaceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ChartNamespaceMapOutput)
}
type ChartNamespaceOutput struct{ *pulumi.OutputState }
func (ChartNamespaceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ChartNamespace)(nil)).Elem()
}
func (o ChartNamespaceOutput) ToChartNamespaceOutput() ChartNamespaceOutput {
return o
}
func (o ChartNamespaceOutput) ToChartNamespaceOutputWithContext(ctx context.Context) ChartNamespaceOutput {
return o
}
// Specifies whether to automatically create repositories in the namespace. Valid values:
func (o ChartNamespaceOutput) AutoCreateRepo() pulumi.BoolOutput {
return o.ApplyT(func(v *ChartNamespace) pulumi.BoolOutput { return v.AutoCreateRepo }).(pulumi.BoolOutput)
}
// DefaultRepoType. Valid values: `PRIVATE`, `PUBLIC`.
func (o ChartNamespaceOutput) DefaultRepoType() pulumi.StringOutput {
return o.ApplyT(func(v *ChartNamespace) pulumi.StringOutput { return v.DefaultRepoType }).(pulumi.StringOutput)
}
// The ID of the Container Registry instance.
func (o ChartNamespaceOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *ChartNamespace) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
// The name of the namespace that you want to create.
func (o ChartNamespaceOutput) NamespaceName() pulumi.StringOutput {
return o.ApplyT(func(v *ChartNamespace) pulumi.StringOutput { return v.NamespaceName }).(pulumi.StringOutput)
}
type ChartNamespaceArrayOutput struct{ *pulumi.OutputState }
func (ChartNamespaceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ChartNamespace)(nil)).Elem()
}
func (o ChartNamespaceArrayOutput) ToChartNamespaceArrayOutput() ChartNamespaceArrayOutput {
return o
}
func (o ChartNamespaceArrayOutput) ToChartNamespaceArrayOutputWithContext(ctx context.Context) ChartNamespaceArrayOutput {
return o
}
func (o ChartNamespaceArrayOutput) Index(i pulumi.IntInput) ChartNamespaceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ChartNamespace {
return vs[0].([]*ChartNamespace)[vs[1].(int)]
}).(ChartNamespaceOutput)
}
type ChartNamespaceMapOutput struct{ *pulumi.OutputState }
func (ChartNamespaceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ChartNamespace)(nil)).Elem()
}
func (o ChartNamespaceMapOutput) ToChartNamespaceMapOutput() ChartNamespaceMapOutput {
return o
}
func (o ChartNamespaceMapOutput) ToChartNamespaceMapOutputWithContext(ctx context.Context) ChartNamespaceMapOutput {
return o
}
func (o ChartNamespaceMapOutput) MapIndex(k pulumi.StringInput) ChartNamespaceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ChartNamespace {
return vs[0].(map[string]*ChartNamespace)[vs[1].(string)]
}).(ChartNamespaceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ChartNamespaceInput)(nil)).Elem(), &ChartNamespace{})
pulumi.RegisterInputType(reflect.TypeOf((*ChartNamespaceArrayInput)(nil)).Elem(), ChartNamespaceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ChartNamespaceMapInput)(nil)).Elem(), ChartNamespaceMap{})
pulumi.RegisterOutputType(ChartNamespaceOutput{})
pulumi.RegisterOutputType(ChartNamespaceArrayOutput{})
pulumi.RegisterOutputType(ChartNamespaceMapOutput{})
}