/
compilationResult.go
212 lines (177 loc) · 10.5 KB
/
compilationResult.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1beta1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new CompilationResult in a given project and location.
// Auto-naming is currently not supported for this resource.
// Note - this resource's API doesn't support deletion. When deleted, the resource will persist
// on Google Cloud even though it will be deleted from Pulumi state.
type CompilationResult struct {
pulumi.CustomResourceState
// Immutable. If set, fields of `code_compilation_config` override the default compilation settings that are specified in dataform.json.
CodeCompilationConfig CodeCompilationConfigResponseOutput `pulumi:"codeCompilationConfig"`
// Errors encountered during project compilation.
CompilationErrors CompilationErrorResponseArrayOutput `pulumi:"compilationErrors"`
// The version of `@dataform/core` that was used for compilation.
DataformCoreVersion pulumi.StringOutput `pulumi:"dataformCoreVersion"`
// Immutable. Git commit/tag/branch name at which the repository should be compiled. Must exist in the remote repository. Examples: - a commit SHA: `12ade345` - a tag: `tag1` - a branch name: `branch1`
GitCommitish pulumi.StringOutput `pulumi:"gitCommitish"`
Location pulumi.StringOutput `pulumi:"location"`
// The compilation result's name.
Name pulumi.StringOutput `pulumi:"name"`
Project pulumi.StringOutput `pulumi:"project"`
// Immutable. The name of the release config to compile. The release config's 'current_compilation_result' field will be updated to this compilation result. Must be in the format `projects/*/locations/*/repositories/*/releaseConfigs/*`.
ReleaseConfig pulumi.StringOutput `pulumi:"releaseConfig"`
RepositoryId pulumi.StringOutput `pulumi:"repositoryId"`
// The fully resolved Git commit SHA of the code that was compiled. Not set for compilation results whose source is a workspace.
ResolvedGitCommitSha pulumi.StringOutput `pulumi:"resolvedGitCommitSha"`
// Immutable. The name of the workspace to compile. Must be in the format `projects/*/locations/*/repositories/*/workspaces/*`.
Workspace pulumi.StringOutput `pulumi:"workspace"`
}
// NewCompilationResult registers a new resource with the given unique name, arguments, and options.
func NewCompilationResult(ctx *pulumi.Context,
name string, args *CompilationResultArgs, opts ...pulumi.ResourceOption) (*CompilationResult, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RepositoryId == nil {
return nil, errors.New("invalid value for required argument 'RepositoryId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"location",
"project",
"repositoryId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource CompilationResult
err := ctx.RegisterResource("google-native:dataform/v1beta1:CompilationResult", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCompilationResult gets an existing CompilationResult 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 GetCompilationResult(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CompilationResultState, opts ...pulumi.ResourceOption) (*CompilationResult, error) {
var resource CompilationResult
err := ctx.ReadResource("google-native:dataform/v1beta1:CompilationResult", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CompilationResult resources.
type compilationResultState struct {
}
type CompilationResultState struct {
}
func (CompilationResultState) ElementType() reflect.Type {
return reflect.TypeOf((*compilationResultState)(nil)).Elem()
}
type compilationResultArgs struct {
// Immutable. If set, fields of `code_compilation_config` override the default compilation settings that are specified in dataform.json.
CodeCompilationConfig *CodeCompilationConfig `pulumi:"codeCompilationConfig"`
// Immutable. Git commit/tag/branch name at which the repository should be compiled. Must exist in the remote repository. Examples: - a commit SHA: `12ade345` - a tag: `tag1` - a branch name: `branch1`
GitCommitish *string `pulumi:"gitCommitish"`
Location *string `pulumi:"location"`
Project *string `pulumi:"project"`
// Immutable. The name of the release config to compile. The release config's 'current_compilation_result' field will be updated to this compilation result. Must be in the format `projects/*/locations/*/repositories/*/releaseConfigs/*`.
ReleaseConfig *string `pulumi:"releaseConfig"`
RepositoryId string `pulumi:"repositoryId"`
// Immutable. The name of the workspace to compile. Must be in the format `projects/*/locations/*/repositories/*/workspaces/*`.
Workspace *string `pulumi:"workspace"`
}
// The set of arguments for constructing a CompilationResult resource.
type CompilationResultArgs struct {
// Immutable. If set, fields of `code_compilation_config` override the default compilation settings that are specified in dataform.json.
CodeCompilationConfig CodeCompilationConfigPtrInput
// Immutable. Git commit/tag/branch name at which the repository should be compiled. Must exist in the remote repository. Examples: - a commit SHA: `12ade345` - a tag: `tag1` - a branch name: `branch1`
GitCommitish pulumi.StringPtrInput
Location pulumi.StringPtrInput
Project pulumi.StringPtrInput
// Immutable. The name of the release config to compile. The release config's 'current_compilation_result' field will be updated to this compilation result. Must be in the format `projects/*/locations/*/repositories/*/releaseConfigs/*`.
ReleaseConfig pulumi.StringPtrInput
RepositoryId pulumi.StringInput
// Immutable. The name of the workspace to compile. Must be in the format `projects/*/locations/*/repositories/*/workspaces/*`.
Workspace pulumi.StringPtrInput
}
func (CompilationResultArgs) ElementType() reflect.Type {
return reflect.TypeOf((*compilationResultArgs)(nil)).Elem()
}
type CompilationResultInput interface {
pulumi.Input
ToCompilationResultOutput() CompilationResultOutput
ToCompilationResultOutputWithContext(ctx context.Context) CompilationResultOutput
}
func (*CompilationResult) ElementType() reflect.Type {
return reflect.TypeOf((**CompilationResult)(nil)).Elem()
}
func (i *CompilationResult) ToCompilationResultOutput() CompilationResultOutput {
return i.ToCompilationResultOutputWithContext(context.Background())
}
func (i *CompilationResult) ToCompilationResultOutputWithContext(ctx context.Context) CompilationResultOutput {
return pulumi.ToOutputWithContext(ctx, i).(CompilationResultOutput)
}
type CompilationResultOutput struct{ *pulumi.OutputState }
func (CompilationResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CompilationResult)(nil)).Elem()
}
func (o CompilationResultOutput) ToCompilationResultOutput() CompilationResultOutput {
return o
}
func (o CompilationResultOutput) ToCompilationResultOutputWithContext(ctx context.Context) CompilationResultOutput {
return o
}
// Immutable. If set, fields of `code_compilation_config` override the default compilation settings that are specified in dataform.json.
func (o CompilationResultOutput) CodeCompilationConfig() CodeCompilationConfigResponseOutput {
return o.ApplyT(func(v *CompilationResult) CodeCompilationConfigResponseOutput { return v.CodeCompilationConfig }).(CodeCompilationConfigResponseOutput)
}
// Errors encountered during project compilation.
func (o CompilationResultOutput) CompilationErrors() CompilationErrorResponseArrayOutput {
return o.ApplyT(func(v *CompilationResult) CompilationErrorResponseArrayOutput { return v.CompilationErrors }).(CompilationErrorResponseArrayOutput)
}
// The version of `@dataform/core` that was used for compilation.
func (o CompilationResultOutput) DataformCoreVersion() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.DataformCoreVersion }).(pulumi.StringOutput)
}
// Immutable. Git commit/tag/branch name at which the repository should be compiled. Must exist in the remote repository. Examples: - a commit SHA: `12ade345` - a tag: `tag1` - a branch name: `branch1`
func (o CompilationResultOutput) GitCommitish() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.GitCommitish }).(pulumi.StringOutput)
}
func (o CompilationResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// The compilation result's name.
func (o CompilationResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o CompilationResultOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// Immutable. The name of the release config to compile. The release config's 'current_compilation_result' field will be updated to this compilation result. Must be in the format `projects/*/locations/*/repositories/*/releaseConfigs/*`.
func (o CompilationResultOutput) ReleaseConfig() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.ReleaseConfig }).(pulumi.StringOutput)
}
func (o CompilationResultOutput) RepositoryId() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.RepositoryId }).(pulumi.StringOutput)
}
// The fully resolved Git commit SHA of the code that was compiled. Not set for compilation results whose source is a workspace.
func (o CompilationResultOutput) ResolvedGitCommitSha() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.ResolvedGitCommitSha }).(pulumi.StringOutput)
}
// Immutable. The name of the workspace to compile. Must be in the format `projects/*/locations/*/repositories/*/workspaces/*`.
func (o CompilationResultOutput) Workspace() pulumi.StringOutput {
return o.ApplyT(func(v *CompilationResult) pulumi.StringOutput { return v.Workspace }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CompilationResultInput)(nil)).Elem(), &CompilationResult{})
pulumi.RegisterOutputType(CompilationResultOutput{})
}