generated from pulumi/pulumi-tf-provider-boilerplate
/
legacyEnvironment.go
389 lines (332 loc) · 16.3 KB
/
legacyEnvironment.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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
// 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 dbtcloud
import (
"context"
"reflect"
"errors"
"github.com/a-schot/pulumi-dbtcloud/sdk/go/dbtcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Deprecated: Do not use! This resource is mapped from the legacy Terraform `dbt_cloud_`-prefixed resource/datasource
type LegacyEnvironment struct {
pulumi.CustomResourceState
// Credential ID to create the environment with. A credential is not required for development environments but is required
// for deployment environments
CredentialId pulumi.IntPtrOutput `pulumi:"credentialId"`
// Which custom branch to use in this environment
CustomBranch pulumi.StringPtrOutput `pulumi:"customBranch"`
// Version number of dbt to use in this environment. It needs to be in the format `major.minor.0-latest` or
// `major.minor.0-pre`, e.g. `1.5.0-latest`
DbtVersion pulumi.StringOutput `pulumi:"dbtVersion"`
// The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to
// 'production'
DeploymentType pulumi.StringPtrOutput `pulumi:"deploymentType"`
// Environment ID within the project
EnvironmentId pulumi.IntOutput `pulumi:"environmentId"`
// ID of the extended attributes for the environment
ExtendedAttributesId pulumi.IntPtrOutput `pulumi:"extendedAttributesId"`
// Whether the environment is active
IsActive pulumi.BoolPtrOutput `pulumi:"isActive"`
// Environment name
Name pulumi.StringOutput `pulumi:"name"`
// Project ID to create the environment in
ProjectId pulumi.IntOutput `pulumi:"projectId"`
// The type of environment (must be either development or deployment)
Type pulumi.StringOutput `pulumi:"type"`
// Whether to use a custom git branch in this environment
UseCustomBranch pulumi.BoolPtrOutput `pulumi:"useCustomBranch"`
}
// NewLegacyEnvironment registers a new resource with the given unique name, arguments, and options.
func NewLegacyEnvironment(ctx *pulumi.Context,
name string, args *LegacyEnvironmentArgs, opts ...pulumi.ResourceOption) (*LegacyEnvironment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DbtVersion == nil {
return nil, errors.New("invalid value for required argument 'DbtVersion'")
}
if args.ProjectId == nil {
return nil, errors.New("invalid value for required argument 'ProjectId'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource LegacyEnvironment
err := ctx.RegisterResource("dbtcloud:index/legacyEnvironment:LegacyEnvironment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLegacyEnvironment gets an existing LegacyEnvironment 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 GetLegacyEnvironment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LegacyEnvironmentState, opts ...pulumi.ResourceOption) (*LegacyEnvironment, error) {
var resource LegacyEnvironment
err := ctx.ReadResource("dbtcloud:index/legacyEnvironment:LegacyEnvironment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LegacyEnvironment resources.
type legacyEnvironmentState struct {
// Credential ID to create the environment with. A credential is not required for development environments but is required
// for deployment environments
CredentialId *int `pulumi:"credentialId"`
// Which custom branch to use in this environment
CustomBranch *string `pulumi:"customBranch"`
// Version number of dbt to use in this environment. It needs to be in the format `major.minor.0-latest` or
// `major.minor.0-pre`, e.g. `1.5.0-latest`
DbtVersion *string `pulumi:"dbtVersion"`
// The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to
// 'production'
DeploymentType *string `pulumi:"deploymentType"`
// Environment ID within the project
EnvironmentId *int `pulumi:"environmentId"`
// ID of the extended attributes for the environment
ExtendedAttributesId *int `pulumi:"extendedAttributesId"`
// Whether the environment is active
IsActive *bool `pulumi:"isActive"`
// Environment name
Name *string `pulumi:"name"`
// Project ID to create the environment in
ProjectId *int `pulumi:"projectId"`
// The type of environment (must be either development or deployment)
Type *string `pulumi:"type"`
// Whether to use a custom git branch in this environment
UseCustomBranch *bool `pulumi:"useCustomBranch"`
}
type LegacyEnvironmentState struct {
// Credential ID to create the environment with. A credential is not required for development environments but is required
// for deployment environments
CredentialId pulumi.IntPtrInput
// Which custom branch to use in this environment
CustomBranch pulumi.StringPtrInput
// Version number of dbt to use in this environment. It needs to be in the format `major.minor.0-latest` or
// `major.minor.0-pre`, e.g. `1.5.0-latest`
DbtVersion pulumi.StringPtrInput
// The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to
// 'production'
DeploymentType pulumi.StringPtrInput
// Environment ID within the project
EnvironmentId pulumi.IntPtrInput
// ID of the extended attributes for the environment
ExtendedAttributesId pulumi.IntPtrInput
// Whether the environment is active
IsActive pulumi.BoolPtrInput
// Environment name
Name pulumi.StringPtrInput
// Project ID to create the environment in
ProjectId pulumi.IntPtrInput
// The type of environment (must be either development or deployment)
Type pulumi.StringPtrInput
// Whether to use a custom git branch in this environment
UseCustomBranch pulumi.BoolPtrInput
}
func (LegacyEnvironmentState) ElementType() reflect.Type {
return reflect.TypeOf((*legacyEnvironmentState)(nil)).Elem()
}
type legacyEnvironmentArgs struct {
// Credential ID to create the environment with. A credential is not required for development environments but is required
// for deployment environments
CredentialId *int `pulumi:"credentialId"`
// Which custom branch to use in this environment
CustomBranch *string `pulumi:"customBranch"`
// Version number of dbt to use in this environment. It needs to be in the format `major.minor.0-latest` or
// `major.minor.0-pre`, e.g. `1.5.0-latest`
DbtVersion string `pulumi:"dbtVersion"`
// The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to
// 'production'
DeploymentType *string `pulumi:"deploymentType"`
// ID of the extended attributes for the environment
ExtendedAttributesId *int `pulumi:"extendedAttributesId"`
// Whether the environment is active
IsActive *bool `pulumi:"isActive"`
// Environment name
Name *string `pulumi:"name"`
// Project ID to create the environment in
ProjectId int `pulumi:"projectId"`
// The type of environment (must be either development or deployment)
Type string `pulumi:"type"`
// Whether to use a custom git branch in this environment
UseCustomBranch *bool `pulumi:"useCustomBranch"`
}
// The set of arguments for constructing a LegacyEnvironment resource.
type LegacyEnvironmentArgs struct {
// Credential ID to create the environment with. A credential is not required for development environments but is required
// for deployment environments
CredentialId pulumi.IntPtrInput
// Which custom branch to use in this environment
CustomBranch pulumi.StringPtrInput
// Version number of dbt to use in this environment. It needs to be in the format `major.minor.0-latest` or
// `major.minor.0-pre`, e.g. `1.5.0-latest`
DbtVersion pulumi.StringInput
// The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to
// 'production'
DeploymentType pulumi.StringPtrInput
// ID of the extended attributes for the environment
ExtendedAttributesId pulumi.IntPtrInput
// Whether the environment is active
IsActive pulumi.BoolPtrInput
// Environment name
Name pulumi.StringPtrInput
// Project ID to create the environment in
ProjectId pulumi.IntInput
// The type of environment (must be either development or deployment)
Type pulumi.StringInput
// Whether to use a custom git branch in this environment
UseCustomBranch pulumi.BoolPtrInput
}
func (LegacyEnvironmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*legacyEnvironmentArgs)(nil)).Elem()
}
type LegacyEnvironmentInput interface {
pulumi.Input
ToLegacyEnvironmentOutput() LegacyEnvironmentOutput
ToLegacyEnvironmentOutputWithContext(ctx context.Context) LegacyEnvironmentOutput
}
func (*LegacyEnvironment) ElementType() reflect.Type {
return reflect.TypeOf((**LegacyEnvironment)(nil)).Elem()
}
func (i *LegacyEnvironment) ToLegacyEnvironmentOutput() LegacyEnvironmentOutput {
return i.ToLegacyEnvironmentOutputWithContext(context.Background())
}
func (i *LegacyEnvironment) ToLegacyEnvironmentOutputWithContext(ctx context.Context) LegacyEnvironmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(LegacyEnvironmentOutput)
}
// LegacyEnvironmentArrayInput is an input type that accepts LegacyEnvironmentArray and LegacyEnvironmentArrayOutput values.
// You can construct a concrete instance of `LegacyEnvironmentArrayInput` via:
//
// LegacyEnvironmentArray{ LegacyEnvironmentArgs{...} }
type LegacyEnvironmentArrayInput interface {
pulumi.Input
ToLegacyEnvironmentArrayOutput() LegacyEnvironmentArrayOutput
ToLegacyEnvironmentArrayOutputWithContext(context.Context) LegacyEnvironmentArrayOutput
}
type LegacyEnvironmentArray []LegacyEnvironmentInput
func (LegacyEnvironmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LegacyEnvironment)(nil)).Elem()
}
func (i LegacyEnvironmentArray) ToLegacyEnvironmentArrayOutput() LegacyEnvironmentArrayOutput {
return i.ToLegacyEnvironmentArrayOutputWithContext(context.Background())
}
func (i LegacyEnvironmentArray) ToLegacyEnvironmentArrayOutputWithContext(ctx context.Context) LegacyEnvironmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(LegacyEnvironmentArrayOutput)
}
// LegacyEnvironmentMapInput is an input type that accepts LegacyEnvironmentMap and LegacyEnvironmentMapOutput values.
// You can construct a concrete instance of `LegacyEnvironmentMapInput` via:
//
// LegacyEnvironmentMap{ "key": LegacyEnvironmentArgs{...} }
type LegacyEnvironmentMapInput interface {
pulumi.Input
ToLegacyEnvironmentMapOutput() LegacyEnvironmentMapOutput
ToLegacyEnvironmentMapOutputWithContext(context.Context) LegacyEnvironmentMapOutput
}
type LegacyEnvironmentMap map[string]LegacyEnvironmentInput
func (LegacyEnvironmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LegacyEnvironment)(nil)).Elem()
}
func (i LegacyEnvironmentMap) ToLegacyEnvironmentMapOutput() LegacyEnvironmentMapOutput {
return i.ToLegacyEnvironmentMapOutputWithContext(context.Background())
}
func (i LegacyEnvironmentMap) ToLegacyEnvironmentMapOutputWithContext(ctx context.Context) LegacyEnvironmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(LegacyEnvironmentMapOutput)
}
type LegacyEnvironmentOutput struct{ *pulumi.OutputState }
func (LegacyEnvironmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**LegacyEnvironment)(nil)).Elem()
}
func (o LegacyEnvironmentOutput) ToLegacyEnvironmentOutput() LegacyEnvironmentOutput {
return o
}
func (o LegacyEnvironmentOutput) ToLegacyEnvironmentOutputWithContext(ctx context.Context) LegacyEnvironmentOutput {
return o
}
// Credential ID to create the environment with. A credential is not required for development environments but is required
// for deployment environments
func (o LegacyEnvironmentOutput) CredentialId() pulumi.IntPtrOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.IntPtrOutput { return v.CredentialId }).(pulumi.IntPtrOutput)
}
// Which custom branch to use in this environment
func (o LegacyEnvironmentOutput) CustomBranch() pulumi.StringPtrOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.StringPtrOutput { return v.CustomBranch }).(pulumi.StringPtrOutput)
}
// Version number of dbt to use in this environment. It needs to be in the format `major.minor.0-latest` or
// `major.minor.0-pre`, e.g. `1.5.0-latest`
func (o LegacyEnvironmentOutput) DbtVersion() pulumi.StringOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.StringOutput { return v.DbtVersion }).(pulumi.StringOutput)
}
// The type of environment. Only valid for environments of type 'deployment' and for now can only be empty or set to
// 'production'
func (o LegacyEnvironmentOutput) DeploymentType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.StringPtrOutput { return v.DeploymentType }).(pulumi.StringPtrOutput)
}
// Environment ID within the project
func (o LegacyEnvironmentOutput) EnvironmentId() pulumi.IntOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.IntOutput { return v.EnvironmentId }).(pulumi.IntOutput)
}
// ID of the extended attributes for the environment
func (o LegacyEnvironmentOutput) ExtendedAttributesId() pulumi.IntPtrOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.IntPtrOutput { return v.ExtendedAttributesId }).(pulumi.IntPtrOutput)
}
// Whether the environment is active
func (o LegacyEnvironmentOutput) IsActive() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.BoolPtrOutput { return v.IsActive }).(pulumi.BoolPtrOutput)
}
// Environment name
func (o LegacyEnvironmentOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Project ID to create the environment in
func (o LegacyEnvironmentOutput) ProjectId() pulumi.IntOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.IntOutput { return v.ProjectId }).(pulumi.IntOutput)
}
// The type of environment (must be either development or deployment)
func (o LegacyEnvironmentOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
// Whether to use a custom git branch in this environment
func (o LegacyEnvironmentOutput) UseCustomBranch() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *LegacyEnvironment) pulumi.BoolPtrOutput { return v.UseCustomBranch }).(pulumi.BoolPtrOutput)
}
type LegacyEnvironmentArrayOutput struct{ *pulumi.OutputState }
func (LegacyEnvironmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LegacyEnvironment)(nil)).Elem()
}
func (o LegacyEnvironmentArrayOutput) ToLegacyEnvironmentArrayOutput() LegacyEnvironmentArrayOutput {
return o
}
func (o LegacyEnvironmentArrayOutput) ToLegacyEnvironmentArrayOutputWithContext(ctx context.Context) LegacyEnvironmentArrayOutput {
return o
}
func (o LegacyEnvironmentArrayOutput) Index(i pulumi.IntInput) LegacyEnvironmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LegacyEnvironment {
return vs[0].([]*LegacyEnvironment)[vs[1].(int)]
}).(LegacyEnvironmentOutput)
}
type LegacyEnvironmentMapOutput struct{ *pulumi.OutputState }
func (LegacyEnvironmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LegacyEnvironment)(nil)).Elem()
}
func (o LegacyEnvironmentMapOutput) ToLegacyEnvironmentMapOutput() LegacyEnvironmentMapOutput {
return o
}
func (o LegacyEnvironmentMapOutput) ToLegacyEnvironmentMapOutputWithContext(ctx context.Context) LegacyEnvironmentMapOutput {
return o
}
func (o LegacyEnvironmentMapOutput) MapIndex(k pulumi.StringInput) LegacyEnvironmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LegacyEnvironment {
return vs[0].(map[string]*LegacyEnvironment)[vs[1].(string)]
}).(LegacyEnvironmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*LegacyEnvironmentInput)(nil)).Elem(), &LegacyEnvironment{})
pulumi.RegisterInputType(reflect.TypeOf((*LegacyEnvironmentArrayInput)(nil)).Elem(), LegacyEnvironmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*LegacyEnvironmentMapInput)(nil)).Elem(), LegacyEnvironmentMap{})
pulumi.RegisterOutputType(LegacyEnvironmentOutput{})
pulumi.RegisterOutputType(LegacyEnvironmentArrayOutput{})
pulumi.RegisterOutputType(LegacyEnvironmentMapOutput{})
}