@databricks/sdk-uc-tables 0.0.0-dev → 0.1.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1103 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+ import { z } from 'zod';
3
+ export var ColumnTypeName;
4
+ (function (ColumnTypeName) {
5
+ ColumnTypeName["BOOLEAN"] = "BOOLEAN";
6
+ ColumnTypeName["BYTE"] = "BYTE";
7
+ ColumnTypeName["SHORT"] = "SHORT";
8
+ ColumnTypeName["INT"] = "INT";
9
+ ColumnTypeName["LONG"] = "LONG";
10
+ ColumnTypeName["FLOAT"] = "FLOAT";
11
+ ColumnTypeName["DOUBLE"] = "DOUBLE";
12
+ ColumnTypeName["DATE"] = "DATE";
13
+ ColumnTypeName["TIMESTAMP"] = "TIMESTAMP";
14
+ ColumnTypeName["STRING"] = "STRING";
15
+ ColumnTypeName["BINARY"] = "BINARY";
16
+ ColumnTypeName["DECIMAL"] = "DECIMAL";
17
+ ColumnTypeName["INTERVAL"] = "INTERVAL";
18
+ ColumnTypeName["ARRAY"] = "ARRAY";
19
+ ColumnTypeName["STRUCT"] = "STRUCT";
20
+ ColumnTypeName["MAP"] = "MAP";
21
+ ColumnTypeName["CHAR"] = "CHAR";
22
+ ColumnTypeName["NULL"] = "NULL";
23
+ ColumnTypeName["USER_DEFINED_TYPE"] = "USER_DEFINED_TYPE";
24
+ ColumnTypeName["TIMESTAMP_NTZ"] = "TIMESTAMP_NTZ";
25
+ ColumnTypeName["VARIANT"] = "VARIANT";
26
+ ColumnTypeName["GEOMETRY"] = "GEOMETRY";
27
+ ColumnTypeName["GEOGRAPHY"] = "GEOGRAPHY";
28
+ ColumnTypeName["TABLE_TYPE"] = "TABLE_TYPE";
29
+ })(ColumnTypeName || (ColumnTypeName = {}));
30
+ /** Data source format */
31
+ export var DataSourceFormat;
32
+ (function (DataSourceFormat) {
33
+ DataSourceFormat["DELTA"] = "DELTA";
34
+ DataSourceFormat["CSV"] = "CSV";
35
+ DataSourceFormat["JSON"] = "JSON";
36
+ DataSourceFormat["AVRO"] = "AVRO";
37
+ DataSourceFormat["PARQUET"] = "PARQUET";
38
+ DataSourceFormat["ORC"] = "ORC";
39
+ DataSourceFormat["TEXT"] = "TEXT";
40
+ DataSourceFormat["UNITY_CATALOG"] = "UNITY_CATALOG";
41
+ /** A table shared through Delta Sharing protocol. */
42
+ DataSourceFormat["DELTASHARING"] = "DELTASHARING";
43
+ /** BEGIN - Query federation data source formats. */
44
+ DataSourceFormat["DATABRICKS_FORMAT"] = "DATABRICKS_FORMAT";
45
+ DataSourceFormat["MYSQL_FORMAT"] = "MYSQL_FORMAT";
46
+ DataSourceFormat["ORACLE_FORMAT"] = "ORACLE_FORMAT";
47
+ DataSourceFormat["POSTGRESQL_FORMAT"] = "POSTGRESQL_FORMAT";
48
+ DataSourceFormat["REDSHIFT_FORMAT"] = "REDSHIFT_FORMAT";
49
+ DataSourceFormat["SNOWFLAKE_FORMAT"] = "SNOWFLAKE_FORMAT";
50
+ DataSourceFormat["SQLDW_FORMAT"] = "SQLDW_FORMAT";
51
+ DataSourceFormat["SQLSERVER_FORMAT"] = "SQLSERVER_FORMAT";
52
+ DataSourceFormat["SALESFORCE_FORMAT"] = "SALESFORCE_FORMAT";
53
+ DataSourceFormat["SALESFORCE_DATA_CLOUD_FORMAT"] = "SALESFORCE_DATA_CLOUD_FORMAT";
54
+ DataSourceFormat["TERADATA_FORMAT"] = "TERADATA_FORMAT";
55
+ DataSourceFormat["BIGQUERY_FORMAT"] = "BIGQUERY_FORMAT";
56
+ DataSourceFormat["NETSUITE_FORMAT"] = "NETSUITE_FORMAT";
57
+ DataSourceFormat["WORKDAY_RAAS_FORMAT"] = "WORKDAY_RAAS_FORMAT";
58
+ DataSourceFormat["MONGODB_FORMAT"] = "MONGODB_FORMAT";
59
+ /** datasource format used for hive tables. */
60
+ DataSourceFormat["HIVE"] = "HIVE";
61
+ /**
62
+ * END - Query federation data source formats.
63
+ * Vector search managed index format
64
+ */
65
+ DataSourceFormat["VECTOR_INDEX_FORMAT"] = "VECTOR_INDEX_FORMAT";
66
+ /** Brickstore managed online row-oriented storage format. */
67
+ DataSourceFormat["DATABRICKS_ROW_STORE_FORMAT"] = "DATABRICKS_ROW_STORE_FORMAT";
68
+ /** Uniform storage format for Hudi */
69
+ DataSourceFormat["DELTA_UNIFORM_HUDI"] = "DELTA_UNIFORM_HUDI";
70
+ /** Uniform storage format for Iceberg */
71
+ DataSourceFormat["DELTA_UNIFORM_ICEBERG"] = "DELTA_UNIFORM_ICEBERG";
72
+ /** Apache Iceberg DataFormat */
73
+ DataSourceFormat["ICEBERG"] = "ICEBERG";
74
+ })(DataSourceFormat || (DataSourceFormat = {}));
75
+ /**
76
+ * Latest kind: CONNECTION_GOOGLE_CLOUD_LAKEHOUSE_SERVICE_ACCOUNT = 340; Next id: 342.
77
+ * Reserved numbers: 316, 317, 327, 330 (former ENDPOINT_LLM_*,
78
+ * MODEL_SERVICE_STANDARD, MODEL_SERVICE_SYSTEM_DELTASHARING).
79
+ */
80
+ export var SecurableKind;
81
+ (function (SecurableKind) {
82
+ SecurableKind["TABLE_STANDARD"] = "TABLE_STANDARD";
83
+ SecurableKind["TABLE_EXTERNAL"] = "TABLE_EXTERNAL";
84
+ SecurableKind["TABLE_DELTA"] = "TABLE_DELTA";
85
+ SecurableKind["TABLE_DELTA_EXTERNAL"] = "TABLE_DELTA_EXTERNAL";
86
+ SecurableKind["TABLE_VIEW"] = "TABLE_VIEW";
87
+ SecurableKind["TABLE_METRIC_VIEW"] = "TABLE_METRIC_VIEW";
88
+ SecurableKind["TABLE_DELTASHARING"] = "TABLE_DELTASHARING";
89
+ SecurableKind["TABLE_DELTASHARING_MUTABLE"] = "TABLE_DELTASHARING_MUTABLE";
90
+ SecurableKind["TABLE_VIEW_DELTASHARING"] = "TABLE_VIEW_DELTASHARING";
91
+ SecurableKind["TABLE_METRIC_VIEW_DELTASHARING"] = "TABLE_METRIC_VIEW_DELTASHARING";
92
+ SecurableKind["TABLE_MATERIALIZED_VIEW_DELTASHARING"] = "TABLE_MATERIALIZED_VIEW_DELTASHARING";
93
+ SecurableKind["TABLE_STREAMING_LIVE_TABLE_DELTASHARING"] = "TABLE_STREAMING_LIVE_TABLE_DELTASHARING";
94
+ SecurableKind["TABLE_FOREIGN_DELTASHARING"] = "TABLE_FOREIGN_DELTASHARING";
95
+ SecurableKind["TABLE_DELTA_ICEBERG_DELTASHARING"] = "TABLE_DELTA_ICEBERG_DELTASHARING";
96
+ SecurableKind["TABLE_DELTASHARING_OPEN_DIR_BASED"] = "TABLE_DELTASHARING_OPEN_DIR_BASED";
97
+ /** TABLE_FEATURE_STORE and TABLE_FEATURE_STORE_EXTERNAL are deprecated. */
98
+ SecurableKind["TABLE_FEATURE_STORE"] = "TABLE_FEATURE_STORE";
99
+ SecurableKind["TABLE_FEATURE_STORE_EXTERNAL"] = "TABLE_FEATURE_STORE_EXTERNAL";
100
+ SecurableKind["TABLE_STREAMING_LIVE_TABLE"] = "TABLE_STREAMING_LIVE_TABLE";
101
+ SecurableKind["TABLE_SYSTEM"] = "TABLE_SYSTEM";
102
+ SecurableKind["TABLE_SYSTEM_DELTASHARING"] = "TABLE_SYSTEM_DELTASHARING";
103
+ SecurableKind["TABLE_MATERIALIZED_VIEW"] = "TABLE_MATERIALIZED_VIEW";
104
+ SecurableKind["TABLE_INTERNAL"] = "TABLE_INTERNAL";
105
+ SecurableKind["TABLE_FOREIGN_BIGQUERY"] = "TABLE_FOREIGN_BIGQUERY";
106
+ SecurableKind["TABLE_FOREIGN_MYSQL"] = "TABLE_FOREIGN_MYSQL";
107
+ SecurableKind["TABLE_FOREIGN_ORACLE"] = "TABLE_FOREIGN_ORACLE";
108
+ SecurableKind["TABLE_FOREIGN_POSTGRESQL"] = "TABLE_FOREIGN_POSTGRESQL";
109
+ SecurableKind["TABLE_FOREIGN_SQLDW"] = "TABLE_FOREIGN_SQLDW";
110
+ SecurableKind["TABLE_FOREIGN_REDSHIFT"] = "TABLE_FOREIGN_REDSHIFT";
111
+ SecurableKind["TABLE_FOREIGN_SNOWFLAKE"] = "TABLE_FOREIGN_SNOWFLAKE";
112
+ SecurableKind["TABLE_FOREIGN_SQLSERVER"] = "TABLE_FOREIGN_SQLSERVER";
113
+ SecurableKind["TABLE_FOREIGN_SALESFORCE"] = "TABLE_FOREIGN_SALESFORCE";
114
+ SecurableKind["TABLE_FOREIGN_SALESFORCE_DATA_CLOUD"] = "TABLE_FOREIGN_SALESFORCE_DATA_CLOUD";
115
+ SecurableKind["TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING"] = "TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING";
116
+ SecurableKind["TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING_VIEW"] = "TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING_VIEW";
117
+ SecurableKind["TABLE_FOREIGN_TERADATA"] = "TABLE_FOREIGN_TERADATA";
118
+ SecurableKind["TABLE_FOREIGN_NETSUITE"] = "TABLE_FOREIGN_NETSUITE";
119
+ SecurableKind["TABLE_FOREIGN_DATABRICKS"] = "TABLE_FOREIGN_DATABRICKS";
120
+ SecurableKind["TABLE_FOREIGN_WORKDAY_RAAS"] = "TABLE_FOREIGN_WORKDAY_RAAS";
121
+ /** Deprecated in favor of more specific types below */
122
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE"] = "TABLE_FOREIGN_HIVE_METASTORE";
123
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_MANAGED"] = "TABLE_FOREIGN_HIVE_METASTORE_MANAGED";
124
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_DBFS_MANAGED"] = "TABLE_FOREIGN_HIVE_METASTORE_DBFS_MANAGED";
125
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_EXTERNAL"] = "TABLE_FOREIGN_HIVE_METASTORE_EXTERNAL";
126
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_DBFS_EXTERNAL"] = "TABLE_FOREIGN_HIVE_METASTORE_DBFS_EXTERNAL";
127
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_VIEW"] = "TABLE_FOREIGN_HIVE_METASTORE_VIEW";
128
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_DBFS_VIEW"] = "TABLE_FOREIGN_HIVE_METASTORE_DBFS_VIEW";
129
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_MANAGED"] = "TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_MANAGED";
130
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_MANAGED"] = "TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_MANAGED";
131
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_EXTERNAL"] = "TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_EXTERNAL";
132
+ SecurableKind["TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_EXTERNAL"] = "TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_EXTERNAL";
133
+ SecurableKind["TABLE_FOREIGN_MONGODB"] = "TABLE_FOREIGN_MONGODB";
134
+ SecurableKind["TABLE_DELTA_UNIFORM_HUDI_EXTERNAL"] = "TABLE_DELTA_UNIFORM_HUDI_EXTERNAL";
135
+ SecurableKind["TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL"] = "TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL";
136
+ SecurableKind["TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_EXTERNAL"] = "TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_EXTERNAL";
137
+ SecurableKind["TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_MANAGED"] = "TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_MANAGED";
138
+ SecurableKind["TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_SNOWFLAKE"] = "TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_SNOWFLAKE";
139
+ /**
140
+ * The above uniform securableKinds come from different data sources,
141
+ * each creating a foreign catalog in Databricks with its own capabilities.
142
+ * UC uses these attributes to interact with remote connections.
143
+ * For shared foreign iceberg tables, all are under the Delta Sharing catalog
144
+ * with the same capabilities, so the recipient UC does not need to connect
145
+ * to the remote source.
146
+ */
147
+ SecurableKind["TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_DELTASHARING"] = "TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_DELTASHARING";
148
+ /**
149
+ * This is the delta sharing version of TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL.
150
+ * Unlike the above foreign iceberg kinds which originate from external catalogs,
151
+ * this represents an external uniform iceberg table shared via Delta Sharing.
152
+ */
153
+ SecurableKind["TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL_DELTASHARING"] = "TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL_DELTASHARING";
154
+ /** These represent 2 variations of Managed Iceberg tables. See ManagedIcebergTableUtils.scala for more details. */
155
+ SecurableKind["TABLE_ICEBERG_UNIFORM_MANAGED"] = "TABLE_ICEBERG_UNIFORM_MANAGED";
156
+ SecurableKind["TABLE_DELTA_ICEBERG_MANAGED"] = "TABLE_DELTA_ICEBERG_MANAGED";
157
+ SecurableKind["TABLE_ONLINE_VECTOR_INDEX_REPLICA"] = "TABLE_ONLINE_VECTOR_INDEX_REPLICA";
158
+ SecurableKind["TABLE_ONLINE_VECTOR_INDEX_DIRECT"] = "TABLE_ONLINE_VECTOR_INDEX_DIRECT";
159
+ SecurableKind["TABLE_ONLINE_VIEW"] = "TABLE_ONLINE_VIEW";
160
+ SecurableKind["TABLE_DB_STORAGE"] = "TABLE_DB_STORAGE";
161
+ SecurableKind["TABLE_MANAGED_POSTGRESQL"] = "TABLE_MANAGED_POSTGRESQL";
162
+ })(SecurableKind || (SecurableKind = {}));
163
+ /** The type of Unity Catalog securable. */
164
+ export var SecurableType;
165
+ (function (SecurableType) {
166
+ SecurableType["CATALOG"] = "CATALOG";
167
+ SecurableType["SCHEMA"] = "SCHEMA";
168
+ SecurableType["TABLE"] = "TABLE";
169
+ SecurableType["STORAGE_CREDENTIAL"] = "STORAGE_CREDENTIAL";
170
+ SecurableType["EXTERNAL_LOCATION"] = "EXTERNAL_LOCATION";
171
+ SecurableType["FUNCTION"] = "FUNCTION";
172
+ SecurableType["SHARE"] = "SHARE";
173
+ SecurableType["PROVIDER"] = "PROVIDER";
174
+ SecurableType["RECIPIENT"] = "RECIPIENT";
175
+ SecurableType["CLEAN_ROOM"] = "CLEAN_ROOM";
176
+ SecurableType["METASTORE"] = "METASTORE";
177
+ SecurableType["PIPELINE"] = "PIPELINE";
178
+ SecurableType["VOLUME"] = "VOLUME";
179
+ SecurableType["CONNECTION"] = "CONNECTION";
180
+ SecurableType["CREDENTIAL"] = "CREDENTIAL";
181
+ SecurableType["EXTERNAL_METADATA"] = "EXTERNAL_METADATA";
182
+ /** TODO: [UC-2980] Staging tables aren't full-fleged securables yet. */
183
+ SecurableType["STAGING_TABLE"] = "STAGING_TABLE";
184
+ })(SecurableType || (SecurableType = {}));
185
+ export var SseEncryptionAlgorithm;
186
+ (function (SseEncryptionAlgorithm) {
187
+ SseEncryptionAlgorithm["SSE_ENCRYPTION_ALGORITHM_UNSPECIFIED"] = "SSE_ENCRYPTION_ALGORITHM_UNSPECIFIED";
188
+ SseEncryptionAlgorithm["AWS_SSE_S3"] = "AWS_SSE_S3";
189
+ SseEncryptionAlgorithm["AWS_SSE_KMS"] = "AWS_SSE_KMS";
190
+ })(SseEncryptionAlgorithm || (SseEncryptionAlgorithm = {}));
191
+ export var TableType;
192
+ (function (TableType) {
193
+ TableType["MANAGED"] = "MANAGED";
194
+ TableType["EXTERNAL"] = "EXTERNAL";
195
+ TableType["VIEW"] = "VIEW";
196
+ TableType["MATERIALIZED_VIEW"] = "MATERIALIZED_VIEW";
197
+ TableType["STREAMING_TABLE"] = "STREAMING_TABLE";
198
+ TableType["MANAGED_SHALLOW_CLONE"] = "MANAGED_SHALLOW_CLONE";
199
+ TableType["FOREIGN"] = "FOREIGN";
200
+ TableType["EXTERNAL_SHALLOW_CLONE"] = "EXTERNAL_SHALLOW_CLONE";
201
+ TableType["METRIC_VIEW"] = "METRIC_VIEW";
202
+ })(TableType || (TableType = {}));
203
+ /**
204
+ * During the OAuth flow, specifies which stage the option should be displayed in the UI.
205
+ * OAUTH_STAGE_UNSPECIFIED is the default value for options unrelated to the OAuth flow.
206
+ * BEFORE_AUTHORIZATION_CODE corresponds to options necessary to initiate the OAuth process.
207
+ * BEFORE_ACCESS_TOKEN corresponds to options that are necessary to create a foreign connection,
208
+ * but that should be displayed after the authorization code has already been received.
209
+ */
210
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
211
+ export var OptionSpec_OauthStage;
212
+ (function (OptionSpec_OauthStage) {
213
+ OptionSpec_OauthStage["OAUTH_STAGE_UNSPECIFIED"] = "OAUTH_STAGE_UNSPECIFIED";
214
+ OptionSpec_OauthStage["BEFORE_AUTHORIZATION_CODE"] = "BEFORE_AUTHORIZATION_CODE";
215
+ OptionSpec_OauthStage["BEFORE_ACCESS_TOKEN"] = "BEFORE_ACCESS_TOKEN";
216
+ })(OptionSpec_OauthStage || (OptionSpec_OauthStage = {}));
217
+ /**
218
+ * Type of the option, we purposely follow JavaScript types so that
219
+ * the UI can map the options to JS types.
220
+ * https://www.w3schools.com/js/js_datatypes.asp
221
+ * Enum is a special case that it's just string with selections.
222
+ */
223
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
224
+ export var OptionSpec_OptionType;
225
+ (function (OptionSpec_OptionType) {
226
+ OptionSpec_OptionType["OPTION_TYPE_UNSPECIFIED"] = "OPTION_TYPE_UNSPECIFIED";
227
+ OptionSpec_OptionType["OPTION_BOOLEAN"] = "OPTION_BOOLEAN";
228
+ OptionSpec_OptionType["OPTION_NUMBER"] = "OPTION_NUMBER";
229
+ OptionSpec_OptionType["OPTION_BIGINT"] = "OPTION_BIGINT";
230
+ OptionSpec_OptionType["OPTION_STRING"] = "OPTION_STRING";
231
+ OptionSpec_OptionType["OPTION_ENUM"] = "OPTION_ENUM";
232
+ OptionSpec_OptionType["OPTION_SERVICE_CREDENTIAL"] = "OPTION_SERVICE_CREDENTIAL";
233
+ OptionSpec_OptionType["OPTION_MULTILINE_STRING"] = "OPTION_MULTILINE_STRING";
234
+ })(OptionSpec_OptionType || (OptionSpec_OptionType = {}));
235
+ export const unmarshalColumnInfoSchema = z
236
+ .object({
237
+ name: z.string().optional(),
238
+ type_text: z.string().optional(),
239
+ type_name: z.enum(ColumnTypeName).optional(),
240
+ position: z.number().optional(),
241
+ type_precision: z.number().optional(),
242
+ type_scale: z.number().optional(),
243
+ type_interval_type: z.string().optional(),
244
+ type_json: z.string().optional(),
245
+ comment: z.string().optional(),
246
+ nullable: z.boolean().optional(),
247
+ partition_index: z.number().optional(),
248
+ mask: z.lazy(() => unmarshalColumnMaskSchema).optional(),
249
+ })
250
+ .transform(d => ({
251
+ name: d.name,
252
+ typeText: d.type_text,
253
+ typeName: d.type_name,
254
+ position: d.position,
255
+ typePrecision: d.type_precision,
256
+ typeScale: d.type_scale,
257
+ typeIntervalType: d.type_interval_type,
258
+ typeJson: d.type_json,
259
+ comment: d.comment,
260
+ nullable: d.nullable,
261
+ partitionIndex: d.partition_index,
262
+ mask: d.mask,
263
+ }));
264
+ export const unmarshalColumnMaskSchema = z
265
+ .object({
266
+ function_name: z.string().optional(),
267
+ using_column_names: z.array(z.string()).optional(),
268
+ using_arguments: z
269
+ .array(z.lazy(() => unmarshalPolicyFunctionArgumentSchema))
270
+ .optional(),
271
+ })
272
+ .transform(d => ({
273
+ functionName: d.function_name,
274
+ usingColumnNames: d.using_column_names,
275
+ usingArguments: d.using_arguments,
276
+ }));
277
+ export const unmarshalConnectionDependencySchema = z
278
+ .object({
279
+ connection_name: z.string().optional(),
280
+ })
281
+ .transform(d => ({
282
+ connectionName: d.connection_name,
283
+ }));
284
+ export const unmarshalCredentialDependencySchema = z
285
+ .object({
286
+ credential_name: z.string().optional(),
287
+ })
288
+ .transform(d => ({
289
+ credentialName: d.credential_name,
290
+ }));
291
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
292
+ export const unmarshalDeleteTableConstraintRequest_ResponseSchema = z.object({});
293
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
294
+ export const unmarshalDeleteTableRequest_ResponseSchema = z.object({});
295
+ export const unmarshalDeltaRuntimePropertiesKvPairsSchema = z
296
+ .object({
297
+ delta_runtime_properties: z.record(z.string(), z.string()).optional(),
298
+ })
299
+ .transform(d => ({
300
+ deltaRuntimeProperties: d.delta_runtime_properties,
301
+ }));
302
+ export const unmarshalDependencySchema = z
303
+ .object({
304
+ table: z.lazy(() => unmarshalTableDependencySchema).optional(),
305
+ function: z.lazy(() => unmarshalFunctionDependencySchema).optional(),
306
+ connection: z.lazy(() => unmarshalConnectionDependencySchema).optional(),
307
+ credential: z.lazy(() => unmarshalCredentialDependencySchema).optional(),
308
+ })
309
+ .transform(d => ({
310
+ value: d.table !== undefined
311
+ ? { $case: 'table', table: d.table }
312
+ : d.function !== undefined
313
+ ? { $case: 'function', function: d.function }
314
+ : d.connection !== undefined
315
+ ? { $case: 'connection', connection: d.connection }
316
+ : d.credential !== undefined
317
+ ? { $case: 'credential', credential: d.credential }
318
+ : undefined,
319
+ }));
320
+ export const unmarshalDependencyListSchema = z
321
+ .object({
322
+ dependencies: z.array(z.lazy(() => unmarshalDependencySchema)).optional(),
323
+ })
324
+ .transform(d => ({
325
+ dependencies: d.dependencies,
326
+ }));
327
+ export const unmarshalEffectivePredictiveOptimizationFlagSchema = z
328
+ .object({
329
+ value: z.string().optional(),
330
+ inherited_from_type: z.string().optional(),
331
+ inherited_from_name: z.string().optional(),
332
+ })
333
+ .transform(d => ({
334
+ value: d.value,
335
+ inheritedFromType: d.inherited_from_type,
336
+ inheritedFromName: d.inherited_from_name,
337
+ }));
338
+ export const unmarshalEncryptionDetailsSchema = z
339
+ .object({
340
+ sse_encryption_details: z
341
+ .lazy(() => unmarshalSseEncryptionDetailsSchema)
342
+ .optional(),
343
+ })
344
+ .transform(d => ({
345
+ encryptionDetailsType: d.sse_encryption_details !== undefined
346
+ ? {
347
+ $case: 'sseEncryptionDetails',
348
+ sseEncryptionDetails: d.sse_encryption_details,
349
+ }
350
+ : undefined,
351
+ }));
352
+ export const unmarshalForeignKeyConstraintSchema = z
353
+ .object({
354
+ name: z.string().optional(),
355
+ child_columns: z.array(z.string()).optional(),
356
+ parent_table: z.string().optional(),
357
+ parent_columns: z.array(z.string()).optional(),
358
+ rely: z.boolean().optional(),
359
+ })
360
+ .transform(d => ({
361
+ name: d.name,
362
+ childColumns: d.child_columns,
363
+ parentTable: d.parent_table,
364
+ parentColumns: d.parent_columns,
365
+ rely: d.rely,
366
+ }));
367
+ export const unmarshalFunctionDependencySchema = z
368
+ .object({
369
+ function_full_name: z.string().optional(),
370
+ })
371
+ .transform(d => ({
372
+ functionFullName: d.function_full_name,
373
+ }));
374
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
375
+ export const unmarshalListTableSummariesRequest_ResponseSchema = z
376
+ .object({
377
+ tables: z.array(z.lazy(() => unmarshalTableSummarySchema)).optional(),
378
+ next_page_token: z.string().optional(),
379
+ })
380
+ .transform(d => ({
381
+ tables: d.tables,
382
+ nextPageToken: d.next_page_token,
383
+ }));
384
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
385
+ export const unmarshalListTablesRequest_ResponseSchema = z
386
+ .object({
387
+ tables: z.array(z.lazy(() => unmarshalTableInfoSchema)).optional(),
388
+ next_page_token: z.string().optional(),
389
+ })
390
+ .transform(d => ({
391
+ tables: d.tables,
392
+ nextPageToken: d.next_page_token,
393
+ }));
394
+ export const unmarshalNamedTableConstraintSchema = z
395
+ .object({
396
+ name: z.string().optional(),
397
+ })
398
+ .transform(d => ({
399
+ name: d.name,
400
+ }));
401
+ export const unmarshalOptionSpecSchema = z
402
+ .object({
403
+ name: z.string().optional(),
404
+ type: z.enum(OptionSpec_OptionType).optional(),
405
+ default_value: z.string().optional(),
406
+ allowed_values: z.array(z.string()).optional(),
407
+ hint: z.string().optional(),
408
+ description: z.string().optional(),
409
+ is_required: z.boolean().optional(),
410
+ is_secret: z.boolean().optional(),
411
+ is_hidden: z.boolean().optional(),
412
+ is_updatable: z.boolean().optional(),
413
+ oauth_stage: z.enum(OptionSpec_OauthStage).optional(),
414
+ is_loggable: z.boolean().optional(),
415
+ is_creatable: z.boolean().optional(),
416
+ is_copiable: z.boolean().optional(),
417
+ })
418
+ .transform(d => ({
419
+ name: d.name,
420
+ type: d.type,
421
+ defaultValue: d.default_value,
422
+ allowedValues: d.allowed_values,
423
+ hint: d.hint,
424
+ description: d.description,
425
+ isRequired: d.is_required,
426
+ isSecret: d.is_secret,
427
+ isHidden: d.is_hidden,
428
+ isUpdatable: d.is_updatable,
429
+ oauthStage: d.oauth_stage,
430
+ isLoggable: d.is_loggable,
431
+ isCreatable: d.is_creatable,
432
+ isCopiable: d.is_copiable,
433
+ }));
434
+ export const unmarshalPolicyFunctionArgumentSchema = z
435
+ .object({
436
+ column: z.string().optional(),
437
+ constant: z.string().optional(),
438
+ })
439
+ .transform(d => ({
440
+ arg: d.column !== undefined
441
+ ? { $case: 'column', column: d.column }
442
+ : d.constant !== undefined
443
+ ? { $case: 'constant', constant: d.constant }
444
+ : undefined,
445
+ }));
446
+ export const unmarshalPrimaryKeyConstraintSchema = z
447
+ .object({
448
+ name: z.string().optional(),
449
+ child_columns: z.array(z.string()).optional(),
450
+ timeseries_columns: z.array(z.string()).optional(),
451
+ rely: z.boolean().optional(),
452
+ })
453
+ .transform(d => ({
454
+ name: d.name,
455
+ childColumns: d.child_columns,
456
+ timeseriesColumns: d.timeseries_columns,
457
+ rely: d.rely,
458
+ }));
459
+ export const unmarshalRowFilterSchema = z
460
+ .object({
461
+ function_name: z.string().optional(),
462
+ input_column_names: z.array(z.string()).optional(),
463
+ input_arguments: z
464
+ .array(z.lazy(() => unmarshalPolicyFunctionArgumentSchema))
465
+ .optional(),
466
+ })
467
+ .transform(d => ({
468
+ functionName: d.function_name,
469
+ inputColumnNames: d.input_column_names,
470
+ inputArguments: d.input_arguments,
471
+ }));
472
+ export const unmarshalSecurableKindManifestSchema = z
473
+ .object({
474
+ securable_type: z.enum(SecurableType).optional(),
475
+ securable_kind: z.enum(SecurableKind).optional(),
476
+ assignable_privileges: z.array(z.string()).optional(),
477
+ options: z.array(z.lazy(() => unmarshalOptionSpecSchema)).optional(),
478
+ capabilities: z.array(z.string()).optional(),
479
+ })
480
+ .transform(d => ({
481
+ securableType: d.securable_type,
482
+ securableKind: d.securable_kind,
483
+ assignablePrivileges: d.assignable_privileges,
484
+ options: d.options,
485
+ capabilities: d.capabilities,
486
+ }));
487
+ export const unmarshalSseEncryptionDetailsSchema = z
488
+ .object({
489
+ algorithm: z.enum(SseEncryptionAlgorithm).optional(),
490
+ aws_kms_key_arn: z.string().optional(),
491
+ })
492
+ .transform(d => ({
493
+ algorithm: d.algorithm,
494
+ awsKmsKeyArn: d.aws_kms_key_arn,
495
+ }));
496
+ export const unmarshalTableConstraintSchema = z
497
+ .object({
498
+ primary_key_constraint: z
499
+ .lazy(() => unmarshalPrimaryKeyConstraintSchema)
500
+ .optional(),
501
+ foreign_key_constraint: z
502
+ .lazy(() => unmarshalForeignKeyConstraintSchema)
503
+ .optional(),
504
+ named_table_constraint: z
505
+ .lazy(() => unmarshalNamedTableConstraintSchema)
506
+ .optional(),
507
+ })
508
+ .transform(d => ({
509
+ constraint: d.primary_key_constraint !== undefined
510
+ ? {
511
+ $case: 'primaryKeyConstraint',
512
+ primaryKeyConstraint: d.primary_key_constraint,
513
+ }
514
+ : d.foreign_key_constraint !== undefined
515
+ ? {
516
+ $case: 'foreignKeyConstraint',
517
+ foreignKeyConstraint: d.foreign_key_constraint,
518
+ }
519
+ : d.named_table_constraint !== undefined
520
+ ? {
521
+ $case: 'namedTableConstraint',
522
+ namedTableConstraint: d.named_table_constraint,
523
+ }
524
+ : undefined,
525
+ }));
526
+ export const unmarshalTableDependencySchema = z
527
+ .object({
528
+ table_full_name: z.string().optional(),
529
+ })
530
+ .transform(d => ({
531
+ tableFullName: d.table_full_name,
532
+ }));
533
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
534
+ export const unmarshalTableExistsRequest_ResponseSchema = z
535
+ .object({
536
+ table_exists: z.boolean().optional(),
537
+ })
538
+ .transform(d => ({
539
+ tableExists: d.table_exists,
540
+ }));
541
+ export const unmarshalTableInfoSchema = z
542
+ .object({
543
+ name: z.string().optional(),
544
+ catalog_name: z.string().optional(),
545
+ schema_name: z.string().optional(),
546
+ table_type: z.enum(TableType).optional(),
547
+ data_source_format: z.enum(DataSourceFormat).optional(),
548
+ storage_location: z.string().optional(),
549
+ view_definition: z.string().optional(),
550
+ view_dependencies: z.lazy(() => unmarshalDependencyListSchema).optional(),
551
+ sql_path: z.string().optional(),
552
+ owner: z.string().optional(),
553
+ comment: z.string().optional(),
554
+ storage_credential_name: z.string().optional(),
555
+ table_constraints: z
556
+ .array(z.lazy(() => unmarshalTableConstraintSchema))
557
+ .optional(),
558
+ row_filter: z.lazy(() => unmarshalRowFilterSchema).optional(),
559
+ pipeline_id: z.string().optional(),
560
+ enable_predictive_optimization: z.string().optional(),
561
+ metastore_id: z.string().optional(),
562
+ full_name: z.string().optional(),
563
+ data_access_configuration_id: z.string().optional(),
564
+ created_at: z
565
+ .union([z.number(), z.bigint()])
566
+ .transform(v => BigInt(v))
567
+ .optional(),
568
+ created_by: z.string().optional(),
569
+ updated_at: z
570
+ .union([z.number(), z.bigint()])
571
+ .transform(v => BigInt(v))
572
+ .optional(),
573
+ updated_by: z.string().optional(),
574
+ table_id: z.string().optional(),
575
+ delta_runtime_properties_kvpairs: z
576
+ .lazy(() => unmarshalDeltaRuntimePropertiesKvPairsSchema)
577
+ .optional(),
578
+ deleted_at: z
579
+ .union([z.number(), z.bigint()])
580
+ .transform(v => BigInt(v))
581
+ .optional(),
582
+ effective_predictive_optimization_flag: z
583
+ .lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema)
584
+ .optional(),
585
+ access_point: z.string().optional(),
586
+ browse_only: z.boolean().optional(),
587
+ encryption_details: z
588
+ .lazy(() => unmarshalEncryptionDetailsSchema)
589
+ .optional(),
590
+ securable_kind_manifest: z
591
+ .lazy(() => unmarshalSecurableKindManifestSchema)
592
+ .optional(),
593
+ columns: z.array(z.lazy(() => unmarshalColumnInfoSchema)).optional(),
594
+ properties: z.record(z.string(), z.string()).optional(),
595
+ })
596
+ .transform(d => ({
597
+ name: d.name,
598
+ catalogName: d.catalog_name,
599
+ schemaName: d.schema_name,
600
+ tableType: d.table_type,
601
+ dataSourceFormat: d.data_source_format,
602
+ storageLocation: d.storage_location,
603
+ viewDefinition: d.view_definition,
604
+ viewDependencies: d.view_dependencies,
605
+ sqlPath: d.sql_path,
606
+ owner: d.owner,
607
+ comment: d.comment,
608
+ storageCredentialName: d.storage_credential_name,
609
+ tableConstraints: d.table_constraints,
610
+ rowFilter: d.row_filter,
611
+ pipelineId: d.pipeline_id,
612
+ enablePredictiveOptimization: d.enable_predictive_optimization,
613
+ metastoreId: d.metastore_id,
614
+ fullName: d.full_name,
615
+ dataAccessConfigurationId: d.data_access_configuration_id,
616
+ createdAt: d.created_at,
617
+ createdBy: d.created_by,
618
+ updatedAt: d.updated_at,
619
+ updatedBy: d.updated_by,
620
+ tableId: d.table_id,
621
+ deltaRuntimePropertiesKvpairs: d.delta_runtime_properties_kvpairs,
622
+ deletedAt: d.deleted_at,
623
+ effectivePredictiveOptimizationFlag: d.effective_predictive_optimization_flag,
624
+ accessPoint: d.access_point,
625
+ browseOnly: d.browse_only,
626
+ encryptionDetails: d.encryption_details,
627
+ securableKindManifest: d.securable_kind_manifest,
628
+ columns: d.columns,
629
+ properties: d.properties,
630
+ }));
631
+ export const unmarshalTableSummarySchema = z
632
+ .object({
633
+ full_name: z.string().optional(),
634
+ table_type: z.enum(TableType).optional(),
635
+ securable_kind_manifest: z
636
+ .lazy(() => unmarshalSecurableKindManifestSchema)
637
+ .optional(),
638
+ })
639
+ .transform(d => ({
640
+ fullName: d.full_name,
641
+ tableType: d.table_type,
642
+ securableKindManifest: d.securable_kind_manifest,
643
+ }));
644
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
645
+ export const unmarshalUpdateTableRequest_ResponseSchema = z.object({});
646
+ export const marshalColumnInfoSchema = z
647
+ .object({
648
+ name: z.string().optional(),
649
+ typeText: z.string().optional(),
650
+ typeName: z.enum(ColumnTypeName).optional(),
651
+ position: z.number().optional(),
652
+ typePrecision: z.number().optional(),
653
+ typeScale: z.number().optional(),
654
+ typeIntervalType: z.string().optional(),
655
+ typeJson: z.string().optional(),
656
+ comment: z.string().optional(),
657
+ nullable: z.boolean().optional(),
658
+ partitionIndex: z.number().optional(),
659
+ mask: z.lazy(() => marshalColumnMaskSchema).optional(),
660
+ })
661
+ .transform(d => ({
662
+ name: d.name,
663
+ type_text: d.typeText,
664
+ type_name: d.typeName,
665
+ position: d.position,
666
+ type_precision: d.typePrecision,
667
+ type_scale: d.typeScale,
668
+ type_interval_type: d.typeIntervalType,
669
+ type_json: d.typeJson,
670
+ comment: d.comment,
671
+ nullable: d.nullable,
672
+ partition_index: d.partitionIndex,
673
+ mask: d.mask,
674
+ }));
675
+ export const marshalColumnMaskSchema = z
676
+ .object({
677
+ functionName: z.string().optional(),
678
+ usingColumnNames: z.array(z.string()).optional(),
679
+ usingArguments: z
680
+ .array(z.lazy(() => marshalPolicyFunctionArgumentSchema))
681
+ .optional(),
682
+ })
683
+ .transform(d => ({
684
+ function_name: d.functionName,
685
+ using_column_names: d.usingColumnNames,
686
+ using_arguments: d.usingArguments,
687
+ }));
688
+ export const marshalConnectionDependencySchema = z
689
+ .object({
690
+ connectionName: z.string().optional(),
691
+ })
692
+ .transform(d => ({
693
+ connection_name: d.connectionName,
694
+ }));
695
+ export const marshalCreateTableConstraintRequestSchema = z
696
+ .object({
697
+ fullNameArg: z.string().optional(),
698
+ constraint: z.lazy(() => marshalTableConstraintSchema).optional(),
699
+ })
700
+ .transform(d => ({
701
+ full_name_arg: d.fullNameArg,
702
+ constraint: d.constraint,
703
+ }));
704
+ export const marshalCreateTableRequestSchema = z
705
+ .object({
706
+ name: z.string().optional(),
707
+ catalogName: z.string().optional(),
708
+ schemaName: z.string().optional(),
709
+ tableType: z.enum(TableType).optional(),
710
+ dataSourceFormat: z.enum(DataSourceFormat).optional(),
711
+ storageLocation: z.string().optional(),
712
+ viewDefinition: z.string().optional(),
713
+ viewDependencies: z.lazy(() => marshalDependencyListSchema).optional(),
714
+ sqlPath: z.string().optional(),
715
+ owner: z.string().optional(),
716
+ comment: z.string().optional(),
717
+ storageCredentialName: z.string().optional(),
718
+ tableConstraints: z
719
+ .array(z.lazy(() => marshalTableConstraintSchema))
720
+ .optional(),
721
+ rowFilter: z.lazy(() => marshalRowFilterSchema).optional(),
722
+ pipelineId: z.string().optional(),
723
+ enablePredictiveOptimization: z.string().optional(),
724
+ metastoreId: z.string().optional(),
725
+ fullName: z.string().optional(),
726
+ dataAccessConfigurationId: z.string().optional(),
727
+ createdAt: z.bigint().optional(),
728
+ createdBy: z.string().optional(),
729
+ updatedAt: z.bigint().optional(),
730
+ updatedBy: z.string().optional(),
731
+ tableId: z.string().optional(),
732
+ deltaRuntimePropertiesKvpairs: z
733
+ .lazy(() => marshalDeltaRuntimePropertiesKvPairsSchema)
734
+ .optional(),
735
+ deletedAt: z.bigint().optional(),
736
+ effectivePredictiveOptimizationFlag: z
737
+ .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema)
738
+ .optional(),
739
+ accessPoint: z.string().optional(),
740
+ browseOnly: z.boolean().optional(),
741
+ encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(),
742
+ securableKindManifest: z
743
+ .lazy(() => marshalSecurableKindManifestSchema)
744
+ .optional(),
745
+ columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(),
746
+ properties: z.record(z.string(), z.string()).optional(),
747
+ })
748
+ .transform(d => ({
749
+ name: d.name,
750
+ catalog_name: d.catalogName,
751
+ schema_name: d.schemaName,
752
+ table_type: d.tableType,
753
+ data_source_format: d.dataSourceFormat,
754
+ storage_location: d.storageLocation,
755
+ view_definition: d.viewDefinition,
756
+ view_dependencies: d.viewDependencies,
757
+ sql_path: d.sqlPath,
758
+ owner: d.owner,
759
+ comment: d.comment,
760
+ storage_credential_name: d.storageCredentialName,
761
+ table_constraints: d.tableConstraints,
762
+ row_filter: d.rowFilter,
763
+ pipeline_id: d.pipelineId,
764
+ enable_predictive_optimization: d.enablePredictiveOptimization,
765
+ metastore_id: d.metastoreId,
766
+ full_name: d.fullName,
767
+ data_access_configuration_id: d.dataAccessConfigurationId,
768
+ created_at: d.createdAt,
769
+ created_by: d.createdBy,
770
+ updated_at: d.updatedAt,
771
+ updated_by: d.updatedBy,
772
+ table_id: d.tableId,
773
+ delta_runtime_properties_kvpairs: d.deltaRuntimePropertiesKvpairs,
774
+ deleted_at: d.deletedAt,
775
+ effective_predictive_optimization_flag: d.effectivePredictiveOptimizationFlag,
776
+ access_point: d.accessPoint,
777
+ browse_only: d.browseOnly,
778
+ encryption_details: d.encryptionDetails,
779
+ securable_kind_manifest: d.securableKindManifest,
780
+ columns: d.columns,
781
+ properties: d.properties,
782
+ }));
783
+ export const marshalCredentialDependencySchema = z
784
+ .object({
785
+ credentialName: z.string().optional(),
786
+ })
787
+ .transform(d => ({
788
+ credential_name: d.credentialName,
789
+ }));
790
+ export const marshalDeltaRuntimePropertiesKvPairsSchema = z
791
+ .object({
792
+ deltaRuntimeProperties: z.record(z.string(), z.string()).optional(),
793
+ })
794
+ .transform(d => ({
795
+ delta_runtime_properties: d.deltaRuntimeProperties,
796
+ }));
797
+ export const marshalDependencySchema = z
798
+ .object({
799
+ value: z
800
+ .discriminatedUnion('$case', [
801
+ z.object({
802
+ $case: z.literal('table'),
803
+ table: z.lazy(() => marshalTableDependencySchema),
804
+ }),
805
+ z.object({
806
+ $case: z.literal('function'),
807
+ function: z.lazy(() => marshalFunctionDependencySchema),
808
+ }),
809
+ z.object({
810
+ $case: z.literal('connection'),
811
+ connection: z.lazy(() => marshalConnectionDependencySchema),
812
+ }),
813
+ z.object({
814
+ $case: z.literal('credential'),
815
+ credential: z.lazy(() => marshalCredentialDependencySchema),
816
+ }),
817
+ ])
818
+ .optional(),
819
+ })
820
+ .transform(d => ({
821
+ ...(d.value?.$case === 'table' && { table: d.value.table }),
822
+ ...(d.value?.$case === 'function' && { function: d.value.function }),
823
+ ...(d.value?.$case === 'connection' && { connection: d.value.connection }),
824
+ ...(d.value?.$case === 'credential' && { credential: d.value.credential }),
825
+ }));
826
+ export const marshalDependencyListSchema = z
827
+ .object({
828
+ dependencies: z.array(z.lazy(() => marshalDependencySchema)).optional(),
829
+ })
830
+ .transform(d => ({
831
+ dependencies: d.dependencies,
832
+ }));
833
+ export const marshalEffectivePredictiveOptimizationFlagSchema = z
834
+ .object({
835
+ value: z.string().optional(),
836
+ inheritedFromType: z.string().optional(),
837
+ inheritedFromName: z.string().optional(),
838
+ })
839
+ .transform(d => ({
840
+ value: d.value,
841
+ inherited_from_type: d.inheritedFromType,
842
+ inherited_from_name: d.inheritedFromName,
843
+ }));
844
+ export const marshalEncryptionDetailsSchema = z
845
+ .object({
846
+ encryptionDetailsType: z
847
+ .discriminatedUnion('$case', [
848
+ z.object({
849
+ $case: z.literal('sseEncryptionDetails'),
850
+ sseEncryptionDetails: z.lazy(() => marshalSseEncryptionDetailsSchema),
851
+ }),
852
+ ])
853
+ .optional(),
854
+ })
855
+ .transform(d => ({
856
+ ...(d.encryptionDetailsType?.$case === 'sseEncryptionDetails' && {
857
+ sse_encryption_details: d.encryptionDetailsType.sseEncryptionDetails,
858
+ }),
859
+ }));
860
+ export const marshalForeignKeyConstraintSchema = z
861
+ .object({
862
+ name: z.string().optional(),
863
+ childColumns: z.array(z.string()).optional(),
864
+ parentTable: z.string().optional(),
865
+ parentColumns: z.array(z.string()).optional(),
866
+ rely: z.boolean().optional(),
867
+ })
868
+ .transform(d => ({
869
+ name: d.name,
870
+ child_columns: d.childColumns,
871
+ parent_table: d.parentTable,
872
+ parent_columns: d.parentColumns,
873
+ rely: d.rely,
874
+ }));
875
+ export const marshalFunctionDependencySchema = z
876
+ .object({
877
+ functionFullName: z.string().optional(),
878
+ })
879
+ .transform(d => ({
880
+ function_full_name: d.functionFullName,
881
+ }));
882
+ export const marshalNamedTableConstraintSchema = z
883
+ .object({
884
+ name: z.string().optional(),
885
+ })
886
+ .transform(d => ({
887
+ name: d.name,
888
+ }));
889
+ export const marshalOptionSpecSchema = z
890
+ .object({
891
+ name: z.string().optional(),
892
+ type: z.enum(OptionSpec_OptionType).optional(),
893
+ defaultValue: z.string().optional(),
894
+ allowedValues: z.array(z.string()).optional(),
895
+ hint: z.string().optional(),
896
+ description: z.string().optional(),
897
+ isRequired: z.boolean().optional(),
898
+ isSecret: z.boolean().optional(),
899
+ isHidden: z.boolean().optional(),
900
+ isUpdatable: z.boolean().optional(),
901
+ oauthStage: z.enum(OptionSpec_OauthStage).optional(),
902
+ isLoggable: z.boolean().optional(),
903
+ isCreatable: z.boolean().optional(),
904
+ isCopiable: z.boolean().optional(),
905
+ })
906
+ .transform(d => ({
907
+ name: d.name,
908
+ type: d.type,
909
+ default_value: d.defaultValue,
910
+ allowed_values: d.allowedValues,
911
+ hint: d.hint,
912
+ description: d.description,
913
+ is_required: d.isRequired,
914
+ is_secret: d.isSecret,
915
+ is_hidden: d.isHidden,
916
+ is_updatable: d.isUpdatable,
917
+ oauth_stage: d.oauthStage,
918
+ is_loggable: d.isLoggable,
919
+ is_creatable: d.isCreatable,
920
+ is_copiable: d.isCopiable,
921
+ }));
922
+ export const marshalPolicyFunctionArgumentSchema = z
923
+ .object({
924
+ arg: z
925
+ .discriminatedUnion('$case', [
926
+ z.object({ $case: z.literal('column'), column: z.string() }),
927
+ z.object({ $case: z.literal('constant'), constant: z.string() }),
928
+ ])
929
+ .optional(),
930
+ })
931
+ .transform(d => ({
932
+ ...(d.arg?.$case === 'column' && { column: d.arg.column }),
933
+ ...(d.arg?.$case === 'constant' && { constant: d.arg.constant }),
934
+ }));
935
+ export const marshalPrimaryKeyConstraintSchema = z
936
+ .object({
937
+ name: z.string().optional(),
938
+ childColumns: z.array(z.string()).optional(),
939
+ timeseriesColumns: z.array(z.string()).optional(),
940
+ rely: z.boolean().optional(),
941
+ })
942
+ .transform(d => ({
943
+ name: d.name,
944
+ child_columns: d.childColumns,
945
+ timeseries_columns: d.timeseriesColumns,
946
+ rely: d.rely,
947
+ }));
948
+ export const marshalRowFilterSchema = z
949
+ .object({
950
+ functionName: z.string().optional(),
951
+ inputColumnNames: z.array(z.string()).optional(),
952
+ inputArguments: z
953
+ .array(z.lazy(() => marshalPolicyFunctionArgumentSchema))
954
+ .optional(),
955
+ })
956
+ .transform(d => ({
957
+ function_name: d.functionName,
958
+ input_column_names: d.inputColumnNames,
959
+ input_arguments: d.inputArguments,
960
+ }));
961
+ export const marshalSecurableKindManifestSchema = z
962
+ .object({
963
+ securableType: z.enum(SecurableType).optional(),
964
+ securableKind: z.enum(SecurableKind).optional(),
965
+ assignablePrivileges: z.array(z.string()).optional(),
966
+ options: z.array(z.lazy(() => marshalOptionSpecSchema)).optional(),
967
+ capabilities: z.array(z.string()).optional(),
968
+ })
969
+ .transform(d => ({
970
+ securable_type: d.securableType,
971
+ securable_kind: d.securableKind,
972
+ assignable_privileges: d.assignablePrivileges,
973
+ options: d.options,
974
+ capabilities: d.capabilities,
975
+ }));
976
+ export const marshalSseEncryptionDetailsSchema = z
977
+ .object({
978
+ algorithm: z.enum(SseEncryptionAlgorithm).optional(),
979
+ awsKmsKeyArn: z.string().optional(),
980
+ })
981
+ .transform(d => ({
982
+ algorithm: d.algorithm,
983
+ aws_kms_key_arn: d.awsKmsKeyArn,
984
+ }));
985
+ export const marshalTableConstraintSchema = z
986
+ .object({
987
+ constraint: z
988
+ .discriminatedUnion('$case', [
989
+ z.object({
990
+ $case: z.literal('primaryKeyConstraint'),
991
+ primaryKeyConstraint: z.lazy(() => marshalPrimaryKeyConstraintSchema),
992
+ }),
993
+ z.object({
994
+ $case: z.literal('foreignKeyConstraint'),
995
+ foreignKeyConstraint: z.lazy(() => marshalForeignKeyConstraintSchema),
996
+ }),
997
+ z.object({
998
+ $case: z.literal('namedTableConstraint'),
999
+ namedTableConstraint: z.lazy(() => marshalNamedTableConstraintSchema),
1000
+ }),
1001
+ ])
1002
+ .optional(),
1003
+ })
1004
+ .transform(d => ({
1005
+ ...(d.constraint?.$case === 'primaryKeyConstraint' && {
1006
+ primary_key_constraint: d.constraint.primaryKeyConstraint,
1007
+ }),
1008
+ ...(d.constraint?.$case === 'foreignKeyConstraint' && {
1009
+ foreign_key_constraint: d.constraint.foreignKeyConstraint,
1010
+ }),
1011
+ ...(d.constraint?.$case === 'namedTableConstraint' && {
1012
+ named_table_constraint: d.constraint.namedTableConstraint,
1013
+ }),
1014
+ }));
1015
+ export const marshalTableDependencySchema = z
1016
+ .object({
1017
+ tableFullName: z.string().optional(),
1018
+ })
1019
+ .transform(d => ({
1020
+ table_full_name: d.tableFullName,
1021
+ }));
1022
+ export const marshalUpdateTableRequestSchema = z
1023
+ .object({
1024
+ fullNameArg: z.string().optional(),
1025
+ name: z.string().optional(),
1026
+ catalogName: z.string().optional(),
1027
+ schemaName: z.string().optional(),
1028
+ tableType: z.enum(TableType).optional(),
1029
+ dataSourceFormat: z.enum(DataSourceFormat).optional(),
1030
+ storageLocation: z.string().optional(),
1031
+ viewDefinition: z.string().optional(),
1032
+ viewDependencies: z.lazy(() => marshalDependencyListSchema).optional(),
1033
+ sqlPath: z.string().optional(),
1034
+ owner: z.string().optional(),
1035
+ comment: z.string().optional(),
1036
+ storageCredentialName: z.string().optional(),
1037
+ tableConstraints: z
1038
+ .array(z.lazy(() => marshalTableConstraintSchema))
1039
+ .optional(),
1040
+ rowFilter: z.lazy(() => marshalRowFilterSchema).optional(),
1041
+ pipelineId: z.string().optional(),
1042
+ enablePredictiveOptimization: z.string().optional(),
1043
+ metastoreId: z.string().optional(),
1044
+ fullName: z.string().optional(),
1045
+ dataAccessConfigurationId: z.string().optional(),
1046
+ createdAt: z.bigint().optional(),
1047
+ createdBy: z.string().optional(),
1048
+ updatedAt: z.bigint().optional(),
1049
+ updatedBy: z.string().optional(),
1050
+ tableId: z.string().optional(),
1051
+ deltaRuntimePropertiesKvpairs: z
1052
+ .lazy(() => marshalDeltaRuntimePropertiesKvPairsSchema)
1053
+ .optional(),
1054
+ deletedAt: z.bigint().optional(),
1055
+ effectivePredictiveOptimizationFlag: z
1056
+ .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema)
1057
+ .optional(),
1058
+ accessPoint: z.string().optional(),
1059
+ browseOnly: z.boolean().optional(),
1060
+ encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(),
1061
+ securableKindManifest: z
1062
+ .lazy(() => marshalSecurableKindManifestSchema)
1063
+ .optional(),
1064
+ columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(),
1065
+ properties: z.record(z.string(), z.string()).optional(),
1066
+ })
1067
+ .transform(d => ({
1068
+ full_name_arg: d.fullNameArg,
1069
+ name: d.name,
1070
+ catalog_name: d.catalogName,
1071
+ schema_name: d.schemaName,
1072
+ table_type: d.tableType,
1073
+ data_source_format: d.dataSourceFormat,
1074
+ storage_location: d.storageLocation,
1075
+ view_definition: d.viewDefinition,
1076
+ view_dependencies: d.viewDependencies,
1077
+ sql_path: d.sqlPath,
1078
+ owner: d.owner,
1079
+ comment: d.comment,
1080
+ storage_credential_name: d.storageCredentialName,
1081
+ table_constraints: d.tableConstraints,
1082
+ row_filter: d.rowFilter,
1083
+ pipeline_id: d.pipelineId,
1084
+ enable_predictive_optimization: d.enablePredictiveOptimization,
1085
+ metastore_id: d.metastoreId,
1086
+ full_name: d.fullName,
1087
+ data_access_configuration_id: d.dataAccessConfigurationId,
1088
+ created_at: d.createdAt,
1089
+ created_by: d.createdBy,
1090
+ updated_at: d.updatedAt,
1091
+ updated_by: d.updatedBy,
1092
+ table_id: d.tableId,
1093
+ delta_runtime_properties_kvpairs: d.deltaRuntimePropertiesKvpairs,
1094
+ deleted_at: d.deletedAt,
1095
+ effective_predictive_optimization_flag: d.effectivePredictiveOptimizationFlag,
1096
+ access_point: d.accessPoint,
1097
+ browse_only: d.browseOnly,
1098
+ encryption_details: d.encryptionDetails,
1099
+ securable_kind_manifest: d.securableKindManifest,
1100
+ columns: d.columns,
1101
+ properties: d.properties,
1102
+ }));
1103
+ //# sourceMappingURL=model.js.map