/
zone_schema.go
executable file
·389 lines (387 loc) · 13.6 KB
/
zone_schema.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
// Copyright 2024 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 beta
import (
"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
)
func DCLZoneSchema() *dcl.Schema {
return &dcl.Schema{
Info: &dcl.Info{
Title: "Dataplex/Zone",
Description: "The Dataplex Zone resource",
StructName: "Zone",
},
Paths: &dcl.Paths{
Get: &dcl.Path{
Description: "The function used to get information about a Zone",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "zone",
Required: true,
Description: "A full instance of a Zone",
},
},
},
Apply: &dcl.Path{
Description: "The function used to apply information about a Zone",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "zone",
Required: true,
Description: "A full instance of a Zone",
},
},
},
Delete: &dcl.Path{
Description: "The function used to delete a Zone",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "zone",
Required: true,
Description: "A full instance of a Zone",
},
},
},
DeleteAll: &dcl.Path{
Description: "The function used to delete all Zone",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "project",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
dcl.PathParameters{
Name: "location",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
dcl.PathParameters{
Name: "lake",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
},
},
List: &dcl.Path{
Description: "The function used to list information about many Zone",
Parameters: []dcl.PathParameters{
dcl.PathParameters{
Name: "project",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
dcl.PathParameters{
Name: "location",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
dcl.PathParameters{
Name: "lake",
Required: true,
Schema: &dcl.PathParametersSchema{
Type: "string",
},
},
},
},
},
Components: &dcl.Components{
Schemas: map[string]*dcl.Component{
"Zone": &dcl.Component{
Title: "Zone",
ID: "projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{name}}",
ParentContainer: "project",
HasCreate: true,
SchemaProperty: dcl.Property{
Type: "object",
Required: []string{
"name",
"type",
"discoverySpec",
"resourceSpec",
"project",
"location",
"lake",
},
Properties: map[string]*dcl.Property{
"assetStatus": &dcl.Property{
Type: "object",
GoName: "AssetStatus",
GoType: "ZoneAssetStatus",
ReadOnly: true,
Description: "Output only. Aggregated status of the underlying assets of the zone.",
Properties: map[string]*dcl.Property{
"activeAssets": &dcl.Property{
Type: "integer",
Format: "int64",
GoName: "ActiveAssets",
Description: "Number of active assets.",
},
"securityPolicyApplyingAssets": &dcl.Property{
Type: "integer",
Format: "int64",
GoName: "SecurityPolicyApplyingAssets",
Description: "Number of assets that are in process of updating the security policy on attached resources.",
},
"updateTime": &dcl.Property{
Type: "string",
Format: "date-time",
GoName: "UpdateTime",
Description: "Last update time of the status.",
},
},
},
"createTime": &dcl.Property{
Type: "string",
Format: "date-time",
GoName: "CreateTime",
ReadOnly: true,
Description: "Output only. The time when the zone was created.",
Immutable: true,
},
"description": &dcl.Property{
Type: "string",
GoName: "Description",
Description: "Optional. Description of the zone.",
},
"discoverySpec": &dcl.Property{
Type: "object",
GoName: "DiscoverySpec",
GoType: "ZoneDiscoverySpec",
Description: "Required. Specification of the discovery feature applied to data in this zone.",
Required: []string{
"enabled",
},
Properties: map[string]*dcl.Property{
"csvOptions": &dcl.Property{
Type: "object",
GoName: "CsvOptions",
GoType: "ZoneDiscoverySpecCsvOptions",
Description: "Optional. Configuration for CSV data.",
ServerDefault: true,
Properties: map[string]*dcl.Property{
"delimiter": &dcl.Property{
Type: "string",
GoName: "Delimiter",
Description: "Optional. The delimiter being used to separate values. This defaults to ','.",
},
"disableTypeInference": &dcl.Property{
Type: "boolean",
GoName: "DisableTypeInference",
Description: "Optional. Whether to disable the inference of data type for CSV data. If true, all columns will be registered as strings.",
},
"encoding": &dcl.Property{
Type: "string",
GoName: "Encoding",
Description: "Optional. The character encoding of the data. The default is UTF-8.",
},
"headerRows": &dcl.Property{
Type: "integer",
Format: "int64",
GoName: "HeaderRows",
Description: "Optional. The number of rows to interpret as header rows that should be skipped when reading data rows.",
},
},
},
"enabled": &dcl.Property{
Type: "boolean",
GoName: "Enabled",
Description: "Required. Whether discovery is enabled.",
},
"excludePatterns": &dcl.Property{
Type: "array",
GoName: "ExcludePatterns",
Description: "Optional. The list of patterns to apply for selecting data to exclude during discovery. For Cloud Storage bucket assets, these are interpreted as glob patterns used to match object names. For BigQuery dataset assets, these are interpreted as patterns to match table names.",
SendEmpty: true,
ListType: "list",
Items: &dcl.Property{
Type: "string",
GoType: "string",
},
},
"includePatterns": &dcl.Property{
Type: "array",
GoName: "IncludePatterns",
Description: "Optional. The list of patterns to apply for selecting data to include during discovery if only a subset of the data should considered. For Cloud Storage bucket assets, these are interpreted as glob patterns used to match object names. For BigQuery dataset assets, these are interpreted as patterns to match table names.",
SendEmpty: true,
ListType: "list",
Items: &dcl.Property{
Type: "string",
GoType: "string",
},
},
"jsonOptions": &dcl.Property{
Type: "object",
GoName: "JsonOptions",
GoType: "ZoneDiscoverySpecJsonOptions",
Description: "Optional. Configuration for Json data.",
ServerDefault: true,
Properties: map[string]*dcl.Property{
"disableTypeInference": &dcl.Property{
Type: "boolean",
GoName: "DisableTypeInference",
Description: "Optional. Whether to disable the inference of data type for Json data. If true, all columns will be registered as their primitive types (strings, number or boolean).",
},
"encoding": &dcl.Property{
Type: "string",
GoName: "Encoding",
Description: "Optional. The character encoding of the data. The default is UTF-8.",
},
},
},
"schedule": &dcl.Property{
Type: "string",
GoName: "Schedule",
Description: "Optional. Cron schedule (https://en.wikipedia.org/wiki/Cron) for running discovery periodically. Successive discovery runs must be scheduled at least 60 minutes apart. The default value is to run discovery every 60 minutes. To explicitly set a timezone to the cron tab, apply a prefix in the cron tab: \"CRON_TZ=${IANA_TIME_ZONE}\" or TZ=${IANA_TIME_ZONE}\". The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone database. For example, \"CRON_TZ=America/New_York 1 * * * *\", or \"TZ=America/New_York 1 * * * *\".",
ServerDefault: true,
},
},
},
"displayName": &dcl.Property{
Type: "string",
GoName: "DisplayName",
Description: "Optional. User friendly display name.",
},
"labels": &dcl.Property{
Type: "object",
AdditionalProperties: &dcl.Property{
Type: "string",
},
GoName: "Labels",
Description: "Optional. User defined labels for the zone.",
},
"lake": &dcl.Property{
Type: "string",
GoName: "Lake",
Description: "The lake for the resource",
Immutable: true,
Parameter: true,
},
"location": &dcl.Property{
Type: "string",
GoName: "Location",
Description: "The location for the resource",
Immutable: true,
Parameter: true,
},
"name": &dcl.Property{
Type: "string",
GoName: "Name",
Description: "The name of the zone.",
ResourceReferences: []*dcl.PropertyResourceReference{
&dcl.PropertyResourceReference{
Resource: "Dataplex/Zone",
Field: "selfLink",
Parent: true,
},
},
HasLongForm: true,
},
"project": &dcl.Property{
Type: "string",
GoName: "Project",
Description: "The project for the resource",
Immutable: true,
ResourceReferences: []*dcl.PropertyResourceReference{
&dcl.PropertyResourceReference{
Resource: "Cloudresourcemanager/Project",
Field: "name",
Parent: true,
},
},
Parameter: true,
},
"resourceSpec": &dcl.Property{
Type: "object",
GoName: "ResourceSpec",
GoType: "ZoneResourceSpec",
Description: "Required. Immutable. Specification of the resources that are referenced by the assets within this zone.",
Immutable: true,
Required: []string{
"locationType",
},
Properties: map[string]*dcl.Property{
"locationType": &dcl.Property{
Type: "string",
GoName: "LocationType",
GoType: "ZoneResourceSpecLocationTypeEnum",
Description: "Required. Immutable. The location type of the resources that are allowed to be attached to the assets within this zone. Possible values: LOCATION_TYPE_UNSPECIFIED, SINGLE_REGION, MULTI_REGION",
Immutable: true,
Enum: []string{
"LOCATION_TYPE_UNSPECIFIED",
"SINGLE_REGION",
"MULTI_REGION",
},
},
},
},
"state": &dcl.Property{
Type: "string",
GoName: "State",
GoType: "ZoneStateEnum",
ReadOnly: true,
Description: "Output only. Current state of the zone. Possible values: STATE_UNSPECIFIED, ACTIVE, CREATING, DELETING, ACTION_REQUIRED",
Immutable: true,
Enum: []string{
"STATE_UNSPECIFIED",
"ACTIVE",
"CREATING",
"DELETING",
"ACTION_REQUIRED",
},
},
"type": &dcl.Property{
Type: "string",
GoName: "Type",
GoType: "ZoneTypeEnum",
Description: "Required. Immutable. The type of the zone. Possible values: TYPE_UNSPECIFIED, RAW, CURATED",
Immutable: true,
Enum: []string{
"TYPE_UNSPECIFIED",
"RAW",
"CURATED",
},
},
"uid": &dcl.Property{
Type: "string",
GoName: "Uid",
ReadOnly: true,
Description: "Output only. System generated globally unique ID for the zone. This ID will be different if the zone is deleted and re-created with the same name.",
Immutable: true,
},
"updateTime": &dcl.Property{
Type: "string",
Format: "date-time",
GoName: "UpdateTime",
ReadOnly: true,
Description: "Output only. The time when the zone was last updated.",
Immutable: true,
},
},
},
},
},
},
}
}