forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverride_details.go
237 lines (199 loc) · 6.55 KB
/
override_details.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
// Copyright 2021 Google LLC. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
// -----------BEFORE ADDING NEW OVERRIDES------------
// Any new override added to tpgtools should have an associated design doc
// See go/tpgtools-new-feature for the template.
// This allows us to further document why overrides were added and
// how they should be used.
// Add these docs to go/tpgtools-overrides when the override is submitted.
// VirtualFieldDetails are the details used to construct a virtual field, a
// Terraform-only field that represents Terraform-specific resource behaviour
// that deviates from the DCL.
type VirtualFieldDetails struct {
// Name is the name of the property in Terraform, in snake_case.
Name string
// Name of the field's type eg "string", "boolean", "integer"
Type string
// If set to true, the field is an output-only field.
Output bool
}
type PreCreateFunctionDetails struct {
// Function is the name of the function to call. Arguments are decided by
// the generated code based on the resource's identity, with the format
// (d, config, res).
// This function is expected to return an error.
Function string
}
type PostCreateFunctionDetails struct {
// Function is the name of the function to call. Arguments are decided by
// the generated code based on the resource's identity, with the format
// (d, config, res).
// This function is expected to return an error.
Function string
}
type PreDeleteFunctionDetails struct {
// Function is the name of the function to call. Arguments are decided by
// the generated code based on the resource's identity, with the format
// (d, config, res).
// This function is expected to return an error.
Function string
}
type CustomImportFunctionDetails struct {
// Function is the name of the function to call. Arguments are decided by
// the generated code based on the resource's identity, with the format
// (d, config, {{identity}}). For example:
// (d *schema.ResourceData, config *transport_tpg.Config, project, location, name string)
// This function is expected to return an error.
Function string
}
type AppendToBasePathDetails struct {
// AppendToBasePath appends the given string onto the end of the config base path.
String string
}
type ReplaceInBasePathDetails struct {
// ReplaceInBasePath replaces the config base path with the value returned
// by the given string.
// For example, client.Config.BasePath + "v1" would append "v1" to the current
// base path.
Present bool
Old string
New string
}
type CustomizeDiffDetails struct {
// Functions is a list of CustomizeDiffFunc to use with
// customdiff.All(...).
Functions []string
}
type CustomConfigModeDetails struct {
Mode string
}
type CustomDescriptionDetails struct {
// Formatted CommonMark description for the property.
Description string
}
type CustomDiffSuppressFuncDetails struct {
// Name of the DSF to apply to a property
DiffSuppressFunc string
}
type CustomIDDetails struct {
// The pattern string of the Terraform resource's id
ID string
}
type CustomNameDetails struct {
// The overriding name of the property in Terraform, in snake_case.
Name string
}
type CustomValidationDetails struct {
// Function is the name of a ValidationFunc to apply to a property
Function string
}
type SetHashFuncDetails struct {
// Name of the function to determine the unique ID of an item in the set
Function string
}
type RemovedDetails struct {
// Message describing a removed field
Message string
}
type DeprecatedDetails struct {
// Message describing a deprecated field
Message string
}
// A CustomIdentityGetter is used to replace the default getX function for
// fields that are inferred from multiple places.
// In the future, this override could be used to attach getX functions to fields
// that don't match the standard name exactly as well.
type CustomIdentityGetterDetails struct {
// The name of the function to call to retrieve the value. An error is
// expected to be returned.
Function string
}
type CustomDefaultDetails struct {
Default string
}
type CustomListSizeConstraintDetails struct {
Min int64
Max int64
}
type CustomSchemaValuesDetails struct {
Required bool
Optional bool
Computed bool
}
type ImportFormatDetails struct {
// List of import format pattern strings
Formats []string
}
type MutexDetails struct {
// The pattern string for the mutex lock name preventing concurrent calls to
// the resource
Mutex string
}
type CustomStateGetterDetails struct {
// The function that is used as the StateGetter.
Function string
}
type CustomStateSetterDetails struct {
// The function that is used as the StateSetter.
Function string
}
type CustomResourceNameDetails struct {
// The name of the resource in terraform.
Title string
}
type CustomCreateDirectiveDetails struct {
// The name of function that will return the create directive.
Function string
}
type CustomSerializerDetails struct {
// The name of the function that will serialize this resource.
Function string
}
type SkipDeleteFunctionDetails struct {
// The name of the function that determines if we should skip delete.
Function string
}
type TerraformProductNameDetails struct {
// The name of the product in terraform.
Product string
}
type ProductBasePathDetails struct {
// If set to true, generating the product base path should be skipped
// This is the case when mmv1 already generates base path support
Skip bool
// Alternative product base path name to allow for DCL-based resources to use
// different default base paths than mmv1 generated resources
BasePathIdentifier string
}
type ProductTitleDetails struct {
// alternative name to be used for the product resources
Title string
}
type ProductDocsSectionDetails struct {
// alternative name to be used for the product resources in docs.
DocsSection string
}
type CustomTimeoutDetails struct {
// The overriding Timeouts in Terraform
TimeoutMinutes int
}
type StateUpgradeDetails struct {
// The current schema version
SchemaVersion int
}
type ComplexMapKeyDetails struct {
// The name of the key as exposed by Terraform
KeyName string
}