@databricks/sdk-uc-tables 0.1.0-dev.3 → 0.1.0-dev.4

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.
package/src/v1/model.ts DELETED
@@ -1,1813 +0,0 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
-
3
- import {z} from 'zod';
4
-
5
- export enum ColumnTypeName {
6
- BOOLEAN = 'BOOLEAN',
7
- BYTE = 'BYTE',
8
- SHORT = 'SHORT',
9
- INT = 'INT',
10
- LONG = 'LONG',
11
- FLOAT = 'FLOAT',
12
- DOUBLE = 'DOUBLE',
13
- DATE = 'DATE',
14
- TIMESTAMP = 'TIMESTAMP',
15
- STRING = 'STRING',
16
- BINARY = 'BINARY',
17
- DECIMAL = 'DECIMAL',
18
- INTERVAL = 'INTERVAL',
19
- ARRAY = 'ARRAY',
20
- STRUCT = 'STRUCT',
21
- MAP = 'MAP',
22
- CHAR = 'CHAR',
23
- NULL = 'NULL',
24
- USER_DEFINED_TYPE = 'USER_DEFINED_TYPE',
25
- TIMESTAMP_NTZ = 'TIMESTAMP_NTZ',
26
- VARIANT = 'VARIANT',
27
- GEOMETRY = 'GEOMETRY',
28
- GEOGRAPHY = 'GEOGRAPHY',
29
- TABLE_TYPE = 'TABLE_TYPE',
30
- }
31
-
32
- /** Data source format */
33
- export enum DataSourceFormat {
34
- DELTA = 'DELTA',
35
- CSV = 'CSV',
36
- JSON = 'JSON',
37
- AVRO = 'AVRO',
38
- PARQUET = 'PARQUET',
39
- ORC = 'ORC',
40
- TEXT = 'TEXT',
41
- UNITY_CATALOG = 'UNITY_CATALOG',
42
- /** A table shared through Delta Sharing protocol. */
43
- DELTASHARING = 'DELTASHARING',
44
- /** BEGIN - Query federation data source formats. */
45
- DATABRICKS_FORMAT = 'DATABRICKS_FORMAT',
46
- MYSQL_FORMAT = 'MYSQL_FORMAT',
47
- ORACLE_FORMAT = 'ORACLE_FORMAT',
48
- POSTGRESQL_FORMAT = 'POSTGRESQL_FORMAT',
49
- REDSHIFT_FORMAT = 'REDSHIFT_FORMAT',
50
- SNOWFLAKE_FORMAT = 'SNOWFLAKE_FORMAT',
51
- SQLDW_FORMAT = 'SQLDW_FORMAT',
52
- SQLSERVER_FORMAT = 'SQLSERVER_FORMAT',
53
- SALESFORCE_FORMAT = 'SALESFORCE_FORMAT',
54
- SALESFORCE_DATA_CLOUD_FORMAT = 'SALESFORCE_DATA_CLOUD_FORMAT',
55
- TERADATA_FORMAT = 'TERADATA_FORMAT',
56
- BIGQUERY_FORMAT = 'BIGQUERY_FORMAT',
57
- NETSUITE_FORMAT = 'NETSUITE_FORMAT',
58
- WORKDAY_RAAS_FORMAT = 'WORKDAY_RAAS_FORMAT',
59
- MONGODB_FORMAT = 'MONGODB_FORMAT',
60
- /** datasource format used for hive tables. */
61
- HIVE = 'HIVE',
62
- /**
63
- * END - Query federation data source formats.
64
- * Vector search managed index format
65
- */
66
- VECTOR_INDEX_FORMAT = 'VECTOR_INDEX_FORMAT',
67
- /** Brickstore managed online row-oriented storage format. */
68
- DATABRICKS_ROW_STORE_FORMAT = 'DATABRICKS_ROW_STORE_FORMAT',
69
- /** Uniform storage format for Hudi */
70
- DELTA_UNIFORM_HUDI = 'DELTA_UNIFORM_HUDI',
71
- /** Uniform storage format for Iceberg */
72
- DELTA_UNIFORM_ICEBERG = 'DELTA_UNIFORM_ICEBERG',
73
- /** Apache Iceberg DataFormat */
74
- ICEBERG = 'ICEBERG',
75
- }
76
-
77
- /**
78
- * Latest kind: MEMORY_STORE_STANDARD = 342; Next id: 343.
79
- * Reserved numbers: 316, 317, 327, 330, 341 (former ENDPOINT_LLM_*,
80
- * MODEL_SERVICE_STANDARD, MODEL_SERVICE_SYSTEM_DELTASHARING, MCP_SERVICE_STANDARD).
81
- */
82
- export enum SecurableKind {
83
- TABLE_STANDARD = 'TABLE_STANDARD',
84
- TABLE_EXTERNAL = 'TABLE_EXTERNAL',
85
- TABLE_DELTA = 'TABLE_DELTA',
86
- TABLE_DELTA_EXTERNAL = 'TABLE_DELTA_EXTERNAL',
87
- TABLE_VIEW = 'TABLE_VIEW',
88
- TABLE_METRIC_VIEW = 'TABLE_METRIC_VIEW',
89
- TABLE_DELTASHARING = 'TABLE_DELTASHARING',
90
- TABLE_DELTASHARING_MUTABLE = 'TABLE_DELTASHARING_MUTABLE',
91
- TABLE_VIEW_DELTASHARING = 'TABLE_VIEW_DELTASHARING',
92
- TABLE_METRIC_VIEW_DELTASHARING = 'TABLE_METRIC_VIEW_DELTASHARING',
93
- TABLE_MATERIALIZED_VIEW_DELTASHARING = 'TABLE_MATERIALIZED_VIEW_DELTASHARING',
94
- TABLE_STREAMING_LIVE_TABLE_DELTASHARING = 'TABLE_STREAMING_LIVE_TABLE_DELTASHARING',
95
- TABLE_FOREIGN_DELTASHARING = 'TABLE_FOREIGN_DELTASHARING',
96
- TABLE_DELTA_ICEBERG_DELTASHARING = 'TABLE_DELTA_ICEBERG_DELTASHARING',
97
- TABLE_DELTASHARING_OPEN_DIR_BASED = 'TABLE_DELTASHARING_OPEN_DIR_BASED',
98
- /** TABLE_FEATURE_STORE and TABLE_FEATURE_STORE_EXTERNAL are deprecated. */
99
- TABLE_FEATURE_STORE = 'TABLE_FEATURE_STORE',
100
- TABLE_FEATURE_STORE_EXTERNAL = 'TABLE_FEATURE_STORE_EXTERNAL',
101
- TABLE_STREAMING_LIVE_TABLE = 'TABLE_STREAMING_LIVE_TABLE',
102
- TABLE_SYSTEM = 'TABLE_SYSTEM',
103
- TABLE_SYSTEM_DELTASHARING = 'TABLE_SYSTEM_DELTASHARING',
104
- TABLE_MATERIALIZED_VIEW = 'TABLE_MATERIALIZED_VIEW',
105
- TABLE_INTERNAL = 'TABLE_INTERNAL',
106
- TABLE_FOREIGN_BIGQUERY = 'TABLE_FOREIGN_BIGQUERY',
107
- TABLE_FOREIGN_MYSQL = 'TABLE_FOREIGN_MYSQL',
108
- TABLE_FOREIGN_ORACLE = 'TABLE_FOREIGN_ORACLE',
109
- TABLE_FOREIGN_POSTGRESQL = 'TABLE_FOREIGN_POSTGRESQL',
110
- TABLE_FOREIGN_SQLDW = 'TABLE_FOREIGN_SQLDW',
111
- TABLE_FOREIGN_REDSHIFT = 'TABLE_FOREIGN_REDSHIFT',
112
- TABLE_FOREIGN_SNOWFLAKE = 'TABLE_FOREIGN_SNOWFLAKE',
113
- TABLE_FOREIGN_SQLSERVER = 'TABLE_FOREIGN_SQLSERVER',
114
- TABLE_FOREIGN_SALESFORCE = 'TABLE_FOREIGN_SALESFORCE',
115
- TABLE_FOREIGN_SALESFORCE_DATA_CLOUD = 'TABLE_FOREIGN_SALESFORCE_DATA_CLOUD',
116
- TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING = 'TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING',
117
- TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING_VIEW = 'TABLE_FOREIGN_SALESFORCE_DATA_CLOUD_FILE_SHARING_VIEW',
118
- TABLE_FOREIGN_TERADATA = 'TABLE_FOREIGN_TERADATA',
119
- TABLE_FOREIGN_NETSUITE = 'TABLE_FOREIGN_NETSUITE',
120
- TABLE_FOREIGN_DATABRICKS = 'TABLE_FOREIGN_DATABRICKS',
121
- TABLE_FOREIGN_WORKDAY_RAAS = 'TABLE_FOREIGN_WORKDAY_RAAS',
122
- /** Deprecated in favor of more specific types below */
123
- TABLE_FOREIGN_HIVE_METASTORE = 'TABLE_FOREIGN_HIVE_METASTORE',
124
- TABLE_FOREIGN_HIVE_METASTORE_MANAGED = 'TABLE_FOREIGN_HIVE_METASTORE_MANAGED',
125
- TABLE_FOREIGN_HIVE_METASTORE_DBFS_MANAGED = 'TABLE_FOREIGN_HIVE_METASTORE_DBFS_MANAGED',
126
- TABLE_FOREIGN_HIVE_METASTORE_EXTERNAL = 'TABLE_FOREIGN_HIVE_METASTORE_EXTERNAL',
127
- TABLE_FOREIGN_HIVE_METASTORE_DBFS_EXTERNAL = 'TABLE_FOREIGN_HIVE_METASTORE_DBFS_EXTERNAL',
128
- TABLE_FOREIGN_HIVE_METASTORE_VIEW = 'TABLE_FOREIGN_HIVE_METASTORE_VIEW',
129
- TABLE_FOREIGN_HIVE_METASTORE_DBFS_VIEW = 'TABLE_FOREIGN_HIVE_METASTORE_DBFS_VIEW',
130
- TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_MANAGED = 'TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_MANAGED',
131
- TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_MANAGED = 'TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_MANAGED',
132
- TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_EXTERNAL = 'TABLE_FOREIGN_HIVE_METASTORE_SHALLOW_CLONE_EXTERNAL',
133
- TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_EXTERNAL = 'TABLE_FOREIGN_HIVE_METASTORE_DBFS_SHALLOW_CLONE_EXTERNAL',
134
- TABLE_FOREIGN_MONGODB = 'TABLE_FOREIGN_MONGODB',
135
- TABLE_DELTA_UNIFORM_HUDI_EXTERNAL = 'TABLE_DELTA_UNIFORM_HUDI_EXTERNAL',
136
- TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL = 'TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL',
137
- TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_EXTERNAL = 'TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_EXTERNAL',
138
- TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_MANAGED = 'TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_HIVE_METASTORE_MANAGED',
139
- TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_SNOWFLAKE = 'TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_SNOWFLAKE',
140
- /**
141
- * The above uniform securableKinds come from different data sources,
142
- * each creating a foreign catalog in Databricks with its own capabilities.
143
- * UC uses these attributes to interact with remote connections.
144
- * For shared foreign iceberg tables, all are under the Delta Sharing catalog
145
- * with the same capabilities, so the recipient UC does not need to connect
146
- * to the remote source.
147
- */
148
- TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_DELTASHARING = 'TABLE_DELTA_UNIFORM_ICEBERG_FOREIGN_DELTASHARING',
149
- /**
150
- * This is the delta sharing version of TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL.
151
- * Unlike the above foreign iceberg kinds which originate from external catalogs,
152
- * this represents an external uniform iceberg table shared via Delta Sharing.
153
- */
154
- TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL_DELTASHARING = 'TABLE_DELTA_UNIFORM_ICEBERG_EXTERNAL_DELTASHARING',
155
- /** These represent 2 variations of Managed Iceberg tables. See ManagedIcebergTableUtils.scala for more details. */
156
- TABLE_ICEBERG_UNIFORM_MANAGED = 'TABLE_ICEBERG_UNIFORM_MANAGED',
157
- TABLE_DELTA_ICEBERG_MANAGED = 'TABLE_DELTA_ICEBERG_MANAGED',
158
- TABLE_ONLINE_VECTOR_INDEX_REPLICA = 'TABLE_ONLINE_VECTOR_INDEX_REPLICA',
159
- TABLE_ONLINE_VECTOR_INDEX_DIRECT = 'TABLE_ONLINE_VECTOR_INDEX_DIRECT',
160
- TABLE_ONLINE_VIEW = 'TABLE_ONLINE_VIEW',
161
- TABLE_DB_STORAGE = 'TABLE_DB_STORAGE',
162
- TABLE_MANAGED_POSTGRESQL = 'TABLE_MANAGED_POSTGRESQL',
163
- }
164
-
165
- /** The type of Unity Catalog securable. */
166
- export enum SecurableType {
167
- CATALOG = 'CATALOG',
168
- SCHEMA = 'SCHEMA',
169
- TABLE = 'TABLE',
170
- STORAGE_CREDENTIAL = 'STORAGE_CREDENTIAL',
171
- EXTERNAL_LOCATION = 'EXTERNAL_LOCATION',
172
- FUNCTION = 'FUNCTION',
173
- SHARE = 'SHARE',
174
- PROVIDER = 'PROVIDER',
175
- RECIPIENT = 'RECIPIENT',
176
- CLEAN_ROOM = 'CLEAN_ROOM',
177
- METASTORE = 'METASTORE',
178
- PIPELINE = 'PIPELINE',
179
- VOLUME = 'VOLUME',
180
- CONNECTION = 'CONNECTION',
181
- CREDENTIAL = 'CREDENTIAL',
182
- EXTERNAL_METADATA = 'EXTERNAL_METADATA',
183
- /** TODO: [UC-2980] Staging tables aren't full-fleged securables yet. */
184
- STAGING_TABLE = 'STAGING_TABLE',
185
- }
186
-
187
- export enum SseEncryptionAlgorithm {
188
- SSE_ENCRYPTION_ALGORITHM_UNSPECIFIED = 'SSE_ENCRYPTION_ALGORITHM_UNSPECIFIED',
189
- AWS_SSE_S3 = 'AWS_SSE_S3',
190
- AWS_SSE_KMS = 'AWS_SSE_KMS',
191
- }
192
-
193
- export enum TableType {
194
- MANAGED = 'MANAGED',
195
- EXTERNAL = 'EXTERNAL',
196
- VIEW = 'VIEW',
197
- MATERIALIZED_VIEW = 'MATERIALIZED_VIEW',
198
- STREAMING_TABLE = 'STREAMING_TABLE',
199
- MANAGED_SHALLOW_CLONE = 'MANAGED_SHALLOW_CLONE',
200
- FOREIGN = 'FOREIGN',
201
- EXTERNAL_SHALLOW_CLONE = 'EXTERNAL_SHALLOW_CLONE',
202
- METRIC_VIEW = 'METRIC_VIEW',
203
- }
204
-
205
- /**
206
- * During the OAuth flow, specifies which stage the option should be displayed in the UI.
207
- * OAUTH_STAGE_UNSPECIFIED is the default value for options unrelated to the OAuth flow.
208
- * BEFORE_AUTHORIZATION_CODE corresponds to options necessary to initiate the OAuth process.
209
- * BEFORE_ACCESS_TOKEN corresponds to options that are necessary to create a foreign connection,
210
- * but that should be displayed after the authorization code has already been received.
211
- */
212
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
213
- export enum OptionSpec_OauthStage {
214
- OAUTH_STAGE_UNSPECIFIED = 'OAUTH_STAGE_UNSPECIFIED',
215
- BEFORE_AUTHORIZATION_CODE = 'BEFORE_AUTHORIZATION_CODE',
216
- BEFORE_ACCESS_TOKEN = 'BEFORE_ACCESS_TOKEN',
217
- }
218
-
219
- /**
220
- * Type of the option, we purposely follow JavaScript types so that
221
- * the UI can map the options to JS types.
222
- * https://www.w3schools.com/js/js_datatypes.asp
223
- * Enum is a special case that it's just string with selections.
224
- */
225
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
226
- export enum OptionSpec_OptionType {
227
- OPTION_TYPE_UNSPECIFIED = 'OPTION_TYPE_UNSPECIFIED',
228
- OPTION_BOOLEAN = 'OPTION_BOOLEAN',
229
- OPTION_NUMBER = 'OPTION_NUMBER',
230
- OPTION_BIGINT = 'OPTION_BIGINT',
231
- OPTION_STRING = 'OPTION_STRING',
232
- OPTION_ENUM = 'OPTION_ENUM',
233
- OPTION_SERVICE_CREDENTIAL = 'OPTION_SERVICE_CREDENTIAL',
234
- OPTION_MULTILINE_STRING = 'OPTION_MULTILINE_STRING',
235
- }
236
-
237
- export interface ColumnInfo {
238
- /** Name of Column. */
239
- name?: string | undefined;
240
- /** Full data type specification as SQL/catalogString text. */
241
- typeText?: string | undefined;
242
- typeName?: ColumnTypeName | undefined;
243
- /** Ordinal position of column (starting at position 0). */
244
- position?: number | undefined;
245
- /** Digits of precision; required for DecimalTypes. */
246
- typePrecision?: number | undefined;
247
- /** Digits to right of decimal; Required for DecimalTypes. */
248
- typeScale?: number | undefined;
249
- /** Format of IntervalType. */
250
- typeIntervalType?: string | undefined;
251
- /** Full data type specification, JSON-serialized. */
252
- typeJson?: string | undefined;
253
- /** User-provided free-form text description. */
254
- comment?: string | undefined;
255
- /** Whether field may be Null (default: true). */
256
- nullable?: boolean | undefined;
257
- /** Partition index for column. */
258
- partitionIndex?: number | undefined;
259
- mask?: ColumnMask | undefined;
260
- }
261
-
262
- export interface ColumnMask {
263
- /** The full name of the column mask SQL UDF. */
264
- functionName?: string | undefined;
265
- /**
266
- * The list of additional table columns to be passed as input to the column mask function. The
267
- * first arg of the mask function should be of the type of the column being masked and the
268
- * types of the rest of the args should match the types of columns in 'using_column_names'.
269
- */
270
- usingColumnNames?: string[] | undefined;
271
- /**
272
- * The list of additional table columns or literals to be passed as additional arguments to
273
- * a column mask function. This is the replacement of the deprecated using_column_names field and
274
- * carries information about the types (alias or constant) of the arguments to the mask function.
275
- */
276
- usingArguments?: PolicyFunctionArgument[] | undefined;
277
- }
278
-
279
- /** A connection that is dependent on a SQL object. */
280
- export interface ConnectionDependency {
281
- /** Full name of the dependent connection, in the form of __connection_name__. */
282
- connectionName?: string | undefined;
283
- }
284
-
285
- export interface CreateTableConstraintRequest {
286
- /** The full name of the table referenced by the constraint. */
287
- fullNameArg?: string | undefined;
288
- constraint?: TableConstraint | undefined;
289
- }
290
-
291
- export interface CreateTableRequest {
292
- /** Name of table, relative to parent schema. */
293
- name?: string | undefined;
294
- /** Name of parent catalog. */
295
- catalogName?: string | undefined;
296
- /** Name of parent schema relative to its parent catalog. */
297
- schemaName?: string | undefined;
298
- tableType?: TableType | undefined;
299
- dataSourceFormat?: DataSourceFormat | undefined;
300
- /** Storage root URL for table (for **MANAGED**, **EXTERNAL** tables). */
301
- storageLocation?: string | undefined;
302
- /** View definition SQL (when __table_type__ is **VIEW**, **MATERIALIZED_VIEW**, or **STREAMING_TABLE**) */
303
- viewDefinition?: string | undefined;
304
- /**
305
- * View dependencies (when table_type == **VIEW** or **MATERIALIZED_VIEW**, **STREAMING_TABLE**)
306
- * - when DependencyList is None, the dependency is not provided;
307
- * - when DependencyList is an empty list, the dependency is provided but is empty;
308
- * - when DependencyList is not an empty list, dependencies are provided and recorded.
309
- * Note: this field is not set in the output of the __listTables__ API.
310
- */
311
- viewDependencies?: DependencyList | undefined;
312
- /** List of schemes whose objects can be referenced without qualification. */
313
- sqlPath?: string | undefined;
314
- /** Username of current owner of table. */
315
- owner?: string | undefined;
316
- /** User-provided free-form text description. */
317
- comment?: string | undefined;
318
- /** Name of the storage credential, when a storage credential is configured for use with this table. */
319
- storageCredentialName?: string | undefined;
320
- /** List of table constraints. Note: this field is not set in the output of the __listTables__ API. */
321
- tableConstraints?: TableConstraint[] | undefined;
322
- rowFilter?: RowFilter | undefined;
323
- /** The pipeline ID of the table. Applicable for tables created by pipelines (Materialized View, Streaming Table, etc.). */
324
- pipelineId?: string | undefined;
325
- enablePredictiveOptimization?: string | undefined;
326
- /** Unique identifier of parent metastore. */
327
- metastoreId?: string | undefined;
328
- /** Full name of table, in form of __catalog_name__.__schema_name__.__table_name__ */
329
- fullName?: string | undefined;
330
- /** Unique ID of the Data Access Configuration to use with the table data. */
331
- dataAccessConfigurationId?: string | undefined;
332
- /** Time at which this table was created, in epoch milliseconds. */
333
- createdAt?: bigint | undefined;
334
- /** Username of table creator. */
335
- createdBy?: string | undefined;
336
- /** Time at which this table was last modified, in epoch milliseconds. */
337
- updatedAt?: bigint | undefined;
338
- /** Username of user who last modified the table. */
339
- updatedBy?: string | undefined;
340
- /** The unique identifier of the table. */
341
- tableId?: string | undefined;
342
- /** Information pertaining to current state of the delta table. */
343
- deltaRuntimePropertiesKvpairs?: DeltaRuntimePropertiesKvPairs | undefined;
344
- /** Time at which this table was deleted, in epoch milliseconds. Field is omitted if table is not deleted. */
345
- deletedAt?: bigint | undefined;
346
- effectivePredictiveOptimizationFlag?:
347
- | EffectivePredictiveOptimizationFlag
348
- | undefined;
349
- /** The AWS access point to use when accesing s3 for this external location. */
350
- accessPoint?: string | undefined;
351
- /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
352
- browseOnly?: boolean | undefined;
353
- encryptionDetails?: EncryptionDetails | undefined;
354
- /** SecurableKindManifest of table, including capabilities the table has. */
355
- securableKindManifest?: SecurableKindManifest | undefined;
356
- /** The array of __ColumnInfo__ definitions of the table's columns. */
357
- columns?: ColumnInfo[] | undefined;
358
- /** A map of key-value properties attached to the securable. */
359
- properties?: Record<string, string> | undefined;
360
- }
361
-
362
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
363
- export interface CreateTableRequest_PropertiesEntry {
364
- key?: string | undefined;
365
- value?: string | undefined;
366
- }
367
-
368
- /** A credential that is dependent on a SQL object. */
369
- export interface CredentialDependency {
370
- /** Full name of the dependent credential, in the form of __credential_name__. */
371
- credentialName?: string | undefined;
372
- }
373
-
374
- export interface DeleteTableConstraintRequest {
375
- /** Full name of the table referenced by the constraint. */
376
- fullNameArg?: string | undefined;
377
- /** The name of the constraint to delete. */
378
- constraintName?: string | undefined;
379
- /**
380
- * If true, try deleting all child constraints of the current constraint.
381
- * If false, reject this operation if the current constraint has any child constraints.
382
- */
383
- cascade?: boolean | undefined;
384
- }
385
-
386
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
387
- export interface DeleteTableConstraintResponse {}
388
-
389
- export interface DeleteTableRequest {
390
- /** Full name of the table. */
391
- fullNameArg?: string | undefined;
392
- }
393
-
394
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
395
- export interface DeleteTableResponse {}
396
-
397
- /**
398
- * Properties pertaining to the current state of the delta table as given by the commit server.
399
- * This does not contain **delta.*** (input) properties in __TableInfo.properties__.
400
- */
401
- export interface DeltaRuntimePropertiesKvPairs {
402
- /** A map of key-value properties attached to the securable. */
403
- deltaRuntimeProperties?: Record<string, string> | undefined;
404
- }
405
-
406
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
407
- export interface DeltaRuntimePropertiesKvPairs_DeltaRuntimePropertiesEntry {
408
- key?: string | undefined;
409
- value?: string | undefined;
410
- }
411
-
412
- /**
413
- * A dependency of a SQL object. One of the following fields must be defined:
414
- * __table__, __function__, __connection__, __credential__, __volume__, or __secret__.
415
- */
416
- export interface Dependency {
417
- value?:
418
- | {$case: 'table'; table: TableDependency}
419
- | {$case: 'function'; function: FunctionDependency}
420
- | {$case: 'connection'; connection: ConnectionDependency}
421
- | {$case: 'credential'; credential: CredentialDependency}
422
- | undefined;
423
- }
424
-
425
- /** A list of dependencies. */
426
- export interface DependencyList {
427
- /** Array of dependencies. */
428
- dependencies?: Dependency[] | undefined;
429
- }
430
-
431
- export interface EffectivePredictiveOptimizationFlag {
432
- /** Whether predictive optimization should be enabled for this object and objects under it. */
433
- value?: string | undefined;
434
- /** The type of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */
435
- inheritedFromType?: string | undefined;
436
- /** The name of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */
437
- inheritedFromName?: string | undefined;
438
- }
439
-
440
- /** Encryption options that apply to clients connecting to cloud storage. */
441
- export interface EncryptionDetails {
442
- encryptionDetailsType?:
443
- | {
444
- $case: 'sseEncryptionDetails';
445
- /** Server-Side Encryption properties for clients communicating with AWS s3. */
446
- sseEncryptionDetails: SseEncryptionDetails;
447
- }
448
- | undefined;
449
- }
450
-
451
- export interface ForeignKeyConstraint {
452
- /** The name of the constraint. */
453
- name?: string | undefined;
454
- /** Column names for this constraint. */
455
- childColumns?: string[] | undefined;
456
- /** The full name of the parent constraint. */
457
- parentTable?: string | undefined;
458
- /** Column names for this constraint. */
459
- parentColumns?: string[] | undefined;
460
- /** True if the constraint is RELY, false or unset if NORELY. */
461
- rely?: boolean | undefined;
462
- }
463
-
464
- /** A function that is dependent on a SQL object. */
465
- export interface FunctionDependency {
466
- /** Full name of the dependent function, in the form of __catalog_name__.__schema_name__.__function_name__. */
467
- functionFullName?: string | undefined;
468
- }
469
-
470
- export interface GetTableRequest {
471
- /** Full name of the table. */
472
- fullNameArg?: string | undefined;
473
- /** Whether delta metadata should be included in the response. */
474
- includeDeltaMetadata?: boolean | undefined;
475
- /** Whether to include tables in the response for which the principal can only access selective metadata for. */
476
- includeBrowse?: boolean | undefined;
477
- /** Whether to include a manifest containing table capabilities in the response. */
478
- includeManifestCapabilities?: boolean | undefined;
479
- }
480
-
481
- export interface ListTableSummariesRequest {
482
- /** Name of parent catalog for tables of interest. */
483
- catalogName?: string | undefined;
484
- /**
485
- * A sql LIKE pattern (% and _) for schema names.
486
- * All schemas will be returned if not set or empty.
487
- */
488
- schemaNamePattern?: string | undefined;
489
- /**
490
- * A sql LIKE pattern (% and _) for table names.
491
- * All tables will be returned if not set or empty.
492
- */
493
- tableNamePattern?: string | undefined;
494
- /**
495
- * Maximum number of summaries for tables to return.
496
- * If not set, the page length is set to a server configured value (10000, as of 1/5/2024).
497
- * - when set to a value greater than 0, the page length is the minimum of this value and a server configured value (10000, as of 1/5/2024);
498
- * - when set to 0, the page length is set to a server configured value (10000, as of 1/5/2024) (recommended);
499
- * - when set to a value less than 0, an invalid parameter error is returned;
500
- */
501
- maxResults?: number | undefined;
502
- /** Opaque pagination token to go to next page based on previous query. */
503
- pageToken?: string | undefined;
504
- /** Whether to include a manifest containing table capabilities in the response. */
505
- includeManifestCapabilities?: boolean | undefined;
506
- }
507
-
508
- export interface ListTableSummariesResponse {
509
- /** List of table summaries. */
510
- tables?: TableSummary[] | undefined;
511
- /**
512
- * Opaque token to retrieve the next page of results. Absent if there are no more pages.
513
- * __page_token__ should be set to this value for the next request (for the next page of results).
514
- */
515
- nextPageToken?: string | undefined;
516
- }
517
-
518
- export interface ListTablesRequest {
519
- /** Name of parent catalog for tables of interest. */
520
- catalogName?: string | undefined;
521
- /** Parent schema of tables. */
522
- schemaName?: string | undefined;
523
- /**
524
- * Maximum number of tables to return.
525
- * If not set, all the tables are returned (not recommended).
526
- * - when set to a value greater than 0, the page length is the minimum of this value and a server configured value;
527
- * - when set to 0, the page length is set to a server configured value (recommended);
528
- * - when set to a value less than 0, an invalid parameter error is returned;
529
- */
530
- maxResults?: number | undefined;
531
- /** Opaque token to send for the next page of results (pagination). */
532
- pageToken?: string | undefined;
533
- /** Whether to omit the columns of the table from the response or not. */
534
- omitColumns?: boolean | undefined;
535
- /** Whether to omit the properties of the table from the response or not. */
536
- omitProperties?: boolean | undefined;
537
- /** Whether to omit the username of the table (e.g. owner, updated_by, created_by) from the response or not. */
538
- omitUsername?: boolean | undefined;
539
- /** Whether to include tables in the response for which the principal can only access selective metadata for. */
540
- includeBrowse?: boolean | undefined;
541
- /** Whether to include a manifest containing table capabilities in the response. */
542
- includeManifestCapabilities?: boolean | undefined;
543
- }
544
-
545
- export interface ListTablesResponse {
546
- /** An array of table information objects. */
547
- tables?: TableInfo[] | undefined;
548
- /**
549
- * Opaque token to retrieve the next page of results. Absent if there are no more pages.
550
- * __page_token__ should be set to this value for the next request (for the next page of results).
551
- */
552
- nextPageToken?: string | undefined;
553
- }
554
-
555
- export interface NamedTableConstraint {
556
- /** The name of the constraint. */
557
- name?: string | undefined;
558
- }
559
-
560
- /**
561
- * Spec of an allowed option on a securable kind and its attributes.
562
- * This is mostly used by UI to provide user friendly hints and descriptions
563
- * in order to facilitate the securable creation process.
564
- */
565
- export interface OptionSpec {
566
- /** The unique name of the option. */
567
- name?: string | undefined;
568
- /** The type of the option. */
569
- type?: OptionSpec_OptionType | undefined;
570
- /** The default value of the option, for example, value '443' for 'port' option. */
571
- defaultValue?: string | undefined;
572
- /**
573
- * For drop down / radio button selections, UI will want to know the possible
574
- * input values, it can also be used by other option types to limit input selections.
575
- */
576
- allowedValues?: string[] | undefined;
577
- /**
578
- * The hint is used on the UI to suggest what the input value
579
- * can possibly be like, for example: example.com for 'host' option.
580
- * Unlike default value, it will not be applied automatically without user input.
581
- */
582
- hint?: string | undefined;
583
- /** A concise user facing description of what the input value of this option should look like. */
584
- description?: string | undefined;
585
- /** Is the option required. */
586
- isRequired?: boolean | undefined;
587
- /** Is the option value considered secret and thus redacted on the UI. */
588
- isSecret?: boolean | undefined;
589
- /** Is the option value not user settable and is thus not shown on the UI. */
590
- isHidden?: boolean | undefined;
591
- /** Is the option updatable by users. */
592
- isUpdatable?: boolean | undefined;
593
- /** Specifies when the option value is displayed on the UI within the OAuth flow. */
594
- oauthStage?: OptionSpec_OauthStage | undefined;
595
- /** Specifies whether this option is safe to log, i.e. no sensitive information. */
596
- isLoggable?: boolean | undefined;
597
- /** Indicates whether an option can be provided by users in the create/update path of an entity. */
598
- isCreatable?: boolean | undefined;
599
- /** Indicates whether an option should be displayed with copy button on the UI. */
600
- isCopiable?: boolean | undefined;
601
- }
602
-
603
- /**
604
- * A positional argument passed to a row filter or column mask function.
605
- * Distinguishes between column references and literals.
606
- */
607
- export interface PolicyFunctionArgument {
608
- arg?:
609
- | {
610
- $case: 'column';
611
- /** A column reference. */
612
- column: string;
613
- }
614
- | {
615
- $case: 'constant';
616
- /** A constant literal. */
617
- constant: string;
618
- }
619
- | undefined;
620
- }
621
-
622
- export interface PrimaryKeyConstraint {
623
- /** The name of the constraint. */
624
- name?: string | undefined;
625
- /** Column names for this constraint. */
626
- childColumns?: string[] | undefined;
627
- /** Column names that represent a timeseries. */
628
- timeseriesColumns?: string[] | undefined;
629
- /** True if the constraint is RELY, false or unset if NORELY. */
630
- rely?: boolean | undefined;
631
- }
632
-
633
- export interface RowFilter {
634
- /** The full name of the row filter SQL UDF. */
635
- functionName?: string | undefined;
636
- /**
637
- * The list of table columns to be passed as input to the row filter function. The column types
638
- * should match the types of the filter function arguments.
639
- */
640
- inputColumnNames?: string[] | undefined;
641
- /**
642
- * The list of additional table columns or literals to be passed as additional arguments to
643
- * a row filter function. This is the replacement of the deprecated input_column_names field and
644
- * carries information about the types (alias or constant) of the arguments to the filter function.
645
- */
646
- inputArguments?: PolicyFunctionArgument[] | undefined;
647
- }
648
-
649
- /** Manifest of a specific securable kind. */
650
- export interface SecurableKindManifest {
651
- /** Securable Type of the kind. */
652
- securableType?: SecurableType | undefined;
653
- /** Securable kind to get manifest of. */
654
- securableKind?: SecurableKind | undefined;
655
- /** Privileges that can be assigned to the securable. */
656
- assignablePrivileges?: string[] | undefined;
657
- /** Detailed specs of allowed options. */
658
- options?: OptionSpec[] | undefined;
659
- /** A list of capabilities in the securable kind. */
660
- capabilities?: string[] | undefined;
661
- }
662
-
663
- /** Server-Side Encryption properties for clients communicating with AWS s3. */
664
- export interface SseEncryptionDetails {
665
- /** Sets the value of the 'x-amz-server-side-encryption' header in S3 request. */
666
- algorithm?: SseEncryptionAlgorithm | undefined;
667
- /**
668
- * Optional. The ARN of the SSE-KMS key used with the S3 location, when algorithm = "SSE-KMS".
669
- * Sets the value of the 'x-amz-server-side-encryption-aws-kms-key-id' header.
670
- */
671
- awsKmsKeyArn?: string | undefined;
672
- }
673
-
674
- /**
675
- * A table constraint, as defined by *one* of the following fields being set:
676
- * __primary_key_constraint__, __foreign_key_constraint__, __named_table_constraint__.
677
- */
678
- export interface TableConstraint {
679
- constraint?:
680
- | {
681
- $case: 'primaryKeyConstraint';
682
- primaryKeyConstraint: PrimaryKeyConstraint;
683
- }
684
- | {
685
- $case: 'foreignKeyConstraint';
686
- foreignKeyConstraint: ForeignKeyConstraint;
687
- }
688
- | {
689
- $case: 'namedTableConstraint';
690
- namedTableConstraint: NamedTableConstraint;
691
- }
692
- | undefined;
693
- }
694
-
695
- /** A table that is dependent on a SQL object. */
696
- export interface TableDependency {
697
- /** Full name of the dependent table, in the form of __catalog_name__.__schema_name__.__table_name__. */
698
- tableFullName?: string | undefined;
699
- }
700
-
701
- export interface TableExistsRequest {
702
- /** Full name of the table. */
703
- fullNameArg?: string | undefined;
704
- }
705
-
706
- export interface TableExistsResponse {
707
- /** Whether the table exists or not. */
708
- tableExists?: boolean | undefined;
709
- }
710
-
711
- export interface TableInfo {
712
- /** Name of table, relative to parent schema. */
713
- name?: string | undefined;
714
- /** Name of parent catalog. */
715
- catalogName?: string | undefined;
716
- /** Name of parent schema relative to its parent catalog. */
717
- schemaName?: string | undefined;
718
- tableType?: TableType | undefined;
719
- dataSourceFormat?: DataSourceFormat | undefined;
720
- /** Storage root URL for table (for **MANAGED**, **EXTERNAL** tables). */
721
- storageLocation?: string | undefined;
722
- /** View definition SQL (when __table_type__ is **VIEW**, **MATERIALIZED_VIEW**, or **STREAMING_TABLE**) */
723
- viewDefinition?: string | undefined;
724
- /**
725
- * View dependencies (when table_type == **VIEW** or **MATERIALIZED_VIEW**, **STREAMING_TABLE**)
726
- * - when DependencyList is None, the dependency is not provided;
727
- * - when DependencyList is an empty list, the dependency is provided but is empty;
728
- * - when DependencyList is not an empty list, dependencies are provided and recorded.
729
- * Note: this field is not set in the output of the __listTables__ API.
730
- */
731
- viewDependencies?: DependencyList | undefined;
732
- /** List of schemes whose objects can be referenced without qualification. */
733
- sqlPath?: string | undefined;
734
- /** Username of current owner of table. */
735
- owner?: string | undefined;
736
- /** User-provided free-form text description. */
737
- comment?: string | undefined;
738
- /** Name of the storage credential, when a storage credential is configured for use with this table. */
739
- storageCredentialName?: string | undefined;
740
- /** List of table constraints. Note: this field is not set in the output of the __listTables__ API. */
741
- tableConstraints?: TableConstraint[] | undefined;
742
- rowFilter?: RowFilter | undefined;
743
- /** The pipeline ID of the table. Applicable for tables created by pipelines (Materialized View, Streaming Table, etc.). */
744
- pipelineId?: string | undefined;
745
- enablePredictiveOptimization?: string | undefined;
746
- /** Unique identifier of parent metastore. */
747
- metastoreId?: string | undefined;
748
- /** Full name of table, in form of __catalog_name__.__schema_name__.__table_name__ */
749
- fullName?: string | undefined;
750
- /** Unique ID of the Data Access Configuration to use with the table data. */
751
- dataAccessConfigurationId?: string | undefined;
752
- /** Time at which this table was created, in epoch milliseconds. */
753
- createdAt?: bigint | undefined;
754
- /** Username of table creator. */
755
- createdBy?: string | undefined;
756
- /** Time at which this table was last modified, in epoch milliseconds. */
757
- updatedAt?: bigint | undefined;
758
- /** Username of user who last modified the table. */
759
- updatedBy?: string | undefined;
760
- /** The unique identifier of the table. */
761
- tableId?: string | undefined;
762
- /** Information pertaining to current state of the delta table. */
763
- deltaRuntimePropertiesKvpairs?: DeltaRuntimePropertiesKvPairs | undefined;
764
- /** Time at which this table was deleted, in epoch milliseconds. Field is omitted if table is not deleted. */
765
- deletedAt?: bigint | undefined;
766
- effectivePredictiveOptimizationFlag?:
767
- | EffectivePredictiveOptimizationFlag
768
- | undefined;
769
- /** The AWS access point to use when accesing s3 for this external location. */
770
- accessPoint?: string | undefined;
771
- /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
772
- browseOnly?: boolean | undefined;
773
- encryptionDetails?: EncryptionDetails | undefined;
774
- /** SecurableKindManifest of table, including capabilities the table has. */
775
- securableKindManifest?: SecurableKindManifest | undefined;
776
- /** The array of __ColumnInfo__ definitions of the table's columns. */
777
- columns?: ColumnInfo[] | undefined;
778
- /** A map of key-value properties attached to the securable. */
779
- properties?: Record<string, string> | undefined;
780
- }
781
-
782
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
783
- export interface TableInfo_PropertiesEntry {
784
- key?: string | undefined;
785
- value?: string | undefined;
786
- }
787
-
788
- export interface TableSummary {
789
- /** The full name of the table. */
790
- fullName?: string | undefined;
791
- tableType?: TableType | undefined;
792
- /** SecurableKindManifest of table, including capabilities the table has. */
793
- securableKindManifest?: SecurableKindManifest | undefined;
794
- }
795
-
796
- export interface UpdateTableRequest {
797
- /** Full name of the table. */
798
- fullNameArg?: string | undefined;
799
- /** Name of table, relative to parent schema. */
800
- name?: string | undefined;
801
- /** Name of parent catalog. */
802
- catalogName?: string | undefined;
803
- /** Name of parent schema relative to its parent catalog. */
804
- schemaName?: string | undefined;
805
- tableType?: TableType | undefined;
806
- dataSourceFormat?: DataSourceFormat | undefined;
807
- /** Storage root URL for table (for **MANAGED**, **EXTERNAL** tables). */
808
- storageLocation?: string | undefined;
809
- /** View definition SQL (when __table_type__ is **VIEW**, **MATERIALIZED_VIEW**, or **STREAMING_TABLE**) */
810
- viewDefinition?: string | undefined;
811
- /**
812
- * View dependencies (when table_type == **VIEW** or **MATERIALIZED_VIEW**, **STREAMING_TABLE**)
813
- * - when DependencyList is None, the dependency is not provided;
814
- * - when DependencyList is an empty list, the dependency is provided but is empty;
815
- * - when DependencyList is not an empty list, dependencies are provided and recorded.
816
- * Note: this field is not set in the output of the __listTables__ API.
817
- */
818
- viewDependencies?: DependencyList | undefined;
819
- /** List of schemes whose objects can be referenced without qualification. */
820
- sqlPath?: string | undefined;
821
- /** Username of current owner of table. */
822
- owner?: string | undefined;
823
- /** User-provided free-form text description. */
824
- comment?: string | undefined;
825
- /** Name of the storage credential, when a storage credential is configured for use with this table. */
826
- storageCredentialName?: string | undefined;
827
- /** List of table constraints. Note: this field is not set in the output of the __listTables__ API. */
828
- tableConstraints?: TableConstraint[] | undefined;
829
- rowFilter?: RowFilter | undefined;
830
- /** The pipeline ID of the table. Applicable for tables created by pipelines (Materialized View, Streaming Table, etc.). */
831
- pipelineId?: string | undefined;
832
- enablePredictiveOptimization?: string | undefined;
833
- /** Unique identifier of parent metastore. */
834
- metastoreId?: string | undefined;
835
- /** Full name of table, in form of __catalog_name__.__schema_name__.__table_name__ */
836
- fullName?: string | undefined;
837
- /** Unique ID of the Data Access Configuration to use with the table data. */
838
- dataAccessConfigurationId?: string | undefined;
839
- /** Time at which this table was created, in epoch milliseconds. */
840
- createdAt?: bigint | undefined;
841
- /** Username of table creator. */
842
- createdBy?: string | undefined;
843
- /** Time at which this table was last modified, in epoch milliseconds. */
844
- updatedAt?: bigint | undefined;
845
- /** Username of user who last modified the table. */
846
- updatedBy?: string | undefined;
847
- /** The unique identifier of the table. */
848
- tableId?: string | undefined;
849
- /** Information pertaining to current state of the delta table. */
850
- deltaRuntimePropertiesKvpairs?: DeltaRuntimePropertiesKvPairs | undefined;
851
- /** Time at which this table was deleted, in epoch milliseconds. Field is omitted if table is not deleted. */
852
- deletedAt?: bigint | undefined;
853
- effectivePredictiveOptimizationFlag?:
854
- | EffectivePredictiveOptimizationFlag
855
- | undefined;
856
- /** The AWS access point to use when accesing s3 for this external location. */
857
- accessPoint?: string | undefined;
858
- /** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
859
- browseOnly?: boolean | undefined;
860
- encryptionDetails?: EncryptionDetails | undefined;
861
- /** SecurableKindManifest of table, including capabilities the table has. */
862
- securableKindManifest?: SecurableKindManifest | undefined;
863
- /** The array of __ColumnInfo__ definitions of the table's columns. */
864
- columns?: ColumnInfo[] | undefined;
865
- /** A map of key-value properties attached to the securable. */
866
- properties?: Record<string, string> | undefined;
867
- }
868
-
869
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
870
- export interface UpdateTableRequest_PropertiesEntry {
871
- key?: string | undefined;
872
- value?: string | undefined;
873
- }
874
-
875
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
876
- export interface UpdateTableResponse {}
877
-
878
- export const unmarshalColumnInfoSchema: z.ZodType<ColumnInfo> = z
879
- .object({
880
- name: z.string().optional(),
881
- type_text: z.string().optional(),
882
- type_name: z.enum(ColumnTypeName).optional(),
883
- position: z.number().optional(),
884
- type_precision: z.number().optional(),
885
- type_scale: z.number().optional(),
886
- type_interval_type: z.string().optional(),
887
- type_json: z.string().optional(),
888
- comment: z.string().optional(),
889
- nullable: z.boolean().optional(),
890
- partition_index: z.number().optional(),
891
- mask: z.lazy(() => unmarshalColumnMaskSchema).optional(),
892
- })
893
- .transform(d => ({
894
- name: d.name,
895
- typeText: d.type_text,
896
- typeName: d.type_name,
897
- position: d.position,
898
- typePrecision: d.type_precision,
899
- typeScale: d.type_scale,
900
- typeIntervalType: d.type_interval_type,
901
- typeJson: d.type_json,
902
- comment: d.comment,
903
- nullable: d.nullable,
904
- partitionIndex: d.partition_index,
905
- mask: d.mask,
906
- }));
907
-
908
- export const unmarshalColumnMaskSchema: z.ZodType<ColumnMask> = z
909
- .object({
910
- function_name: z.string().optional(),
911
- using_column_names: z.array(z.string()).optional(),
912
- using_arguments: z
913
- .array(z.lazy(() => unmarshalPolicyFunctionArgumentSchema))
914
- .optional(),
915
- })
916
- .transform(d => ({
917
- functionName: d.function_name,
918
- usingColumnNames: d.using_column_names,
919
- usingArguments: d.using_arguments,
920
- }));
921
-
922
- export const unmarshalConnectionDependencySchema: z.ZodType<ConnectionDependency> =
923
- z
924
- .object({
925
- connection_name: z.string().optional(),
926
- })
927
- .transform(d => ({
928
- connectionName: d.connection_name,
929
- }));
930
-
931
- export const unmarshalCredentialDependencySchema: z.ZodType<CredentialDependency> =
932
- z
933
- .object({
934
- credential_name: z.string().optional(),
935
- })
936
- .transform(d => ({
937
- credentialName: d.credential_name,
938
- }));
939
-
940
- export const unmarshalDeleteTableConstraintResponseSchema: z.ZodType<DeleteTableConstraintResponse> =
941
- z.object({});
942
-
943
- export const unmarshalDeleteTableResponseSchema: z.ZodType<DeleteTableResponse> =
944
- z.object({});
945
-
946
- export const unmarshalDeltaRuntimePropertiesKvPairsSchema: z.ZodType<DeltaRuntimePropertiesKvPairs> =
947
- z
948
- .object({
949
- delta_runtime_properties: z.record(z.string(), z.string()).optional(),
950
- })
951
- .transform(d => ({
952
- deltaRuntimeProperties: d.delta_runtime_properties,
953
- }));
954
-
955
- export const unmarshalDependencySchema: z.ZodType<Dependency> = z
956
- .object({
957
- table: z.lazy(() => unmarshalTableDependencySchema).optional(),
958
- function: z.lazy(() => unmarshalFunctionDependencySchema).optional(),
959
- connection: z.lazy(() => unmarshalConnectionDependencySchema).optional(),
960
- credential: z.lazy(() => unmarshalCredentialDependencySchema).optional(),
961
- })
962
- .transform(d => ({
963
- value:
964
- d.table !== undefined
965
- ? {$case: 'table' as const, table: d.table}
966
- : d.function !== undefined
967
- ? {$case: 'function' as const, function: d.function}
968
- : d.connection !== undefined
969
- ? {$case: 'connection' as const, connection: d.connection}
970
- : d.credential !== undefined
971
- ? {$case: 'credential' as const, credential: d.credential}
972
- : undefined,
973
- }));
974
-
975
- export const unmarshalDependencyListSchema: z.ZodType<DependencyList> = z
976
- .object({
977
- dependencies: z.array(z.lazy(() => unmarshalDependencySchema)).optional(),
978
- })
979
- .transform(d => ({
980
- dependencies: d.dependencies,
981
- }));
982
-
983
- export const unmarshalEffectivePredictiveOptimizationFlagSchema: z.ZodType<EffectivePredictiveOptimizationFlag> =
984
- z
985
- .object({
986
- value: z.string().optional(),
987
- inherited_from_type: z.string().optional(),
988
- inherited_from_name: z.string().optional(),
989
- })
990
- .transform(d => ({
991
- value: d.value,
992
- inheritedFromType: d.inherited_from_type,
993
- inheritedFromName: d.inherited_from_name,
994
- }));
995
-
996
- export const unmarshalEncryptionDetailsSchema: z.ZodType<EncryptionDetails> = z
997
- .object({
998
- sse_encryption_details: z
999
- .lazy(() => unmarshalSseEncryptionDetailsSchema)
1000
- .optional(),
1001
- })
1002
- .transform(d => ({
1003
- encryptionDetailsType:
1004
- d.sse_encryption_details !== undefined
1005
- ? {
1006
- $case: 'sseEncryptionDetails' as const,
1007
- sseEncryptionDetails: d.sse_encryption_details,
1008
- }
1009
- : undefined,
1010
- }));
1011
-
1012
- export const unmarshalForeignKeyConstraintSchema: z.ZodType<ForeignKeyConstraint> =
1013
- z
1014
- .object({
1015
- name: z.string().optional(),
1016
- child_columns: z.array(z.string()).optional(),
1017
- parent_table: z.string().optional(),
1018
- parent_columns: z.array(z.string()).optional(),
1019
- rely: z.boolean().optional(),
1020
- })
1021
- .transform(d => ({
1022
- name: d.name,
1023
- childColumns: d.child_columns,
1024
- parentTable: d.parent_table,
1025
- parentColumns: d.parent_columns,
1026
- rely: d.rely,
1027
- }));
1028
-
1029
- export const unmarshalFunctionDependencySchema: z.ZodType<FunctionDependency> =
1030
- z
1031
- .object({
1032
- function_full_name: z.string().optional(),
1033
- })
1034
- .transform(d => ({
1035
- functionFullName: d.function_full_name,
1036
- }));
1037
-
1038
- export const unmarshalListTableSummariesResponseSchema: z.ZodType<ListTableSummariesResponse> =
1039
- z
1040
- .object({
1041
- tables: z.array(z.lazy(() => unmarshalTableSummarySchema)).optional(),
1042
- next_page_token: z.string().optional(),
1043
- })
1044
- .transform(d => ({
1045
- tables: d.tables,
1046
- nextPageToken: d.next_page_token,
1047
- }));
1048
-
1049
- export const unmarshalListTablesResponseSchema: z.ZodType<ListTablesResponse> =
1050
- z
1051
- .object({
1052
- tables: z.array(z.lazy(() => unmarshalTableInfoSchema)).optional(),
1053
- next_page_token: z.string().optional(),
1054
- })
1055
- .transform(d => ({
1056
- tables: d.tables,
1057
- nextPageToken: d.next_page_token,
1058
- }));
1059
-
1060
- export const unmarshalNamedTableConstraintSchema: z.ZodType<NamedTableConstraint> =
1061
- z
1062
- .object({
1063
- name: z.string().optional(),
1064
- })
1065
- .transform(d => ({
1066
- name: d.name,
1067
- }));
1068
-
1069
- export const unmarshalOptionSpecSchema: z.ZodType<OptionSpec> = z
1070
- .object({
1071
- name: z.string().optional(),
1072
- type: z.enum(OptionSpec_OptionType).optional(),
1073
- default_value: z.string().optional(),
1074
- allowed_values: z.array(z.string()).optional(),
1075
- hint: z.string().optional(),
1076
- description: z.string().optional(),
1077
- is_required: z.boolean().optional(),
1078
- is_secret: z.boolean().optional(),
1079
- is_hidden: z.boolean().optional(),
1080
- is_updatable: z.boolean().optional(),
1081
- oauth_stage: z.enum(OptionSpec_OauthStage).optional(),
1082
- is_loggable: z.boolean().optional(),
1083
- is_creatable: z.boolean().optional(),
1084
- is_copiable: z.boolean().optional(),
1085
- })
1086
- .transform(d => ({
1087
- name: d.name,
1088
- type: d.type,
1089
- defaultValue: d.default_value,
1090
- allowedValues: d.allowed_values,
1091
- hint: d.hint,
1092
- description: d.description,
1093
- isRequired: d.is_required,
1094
- isSecret: d.is_secret,
1095
- isHidden: d.is_hidden,
1096
- isUpdatable: d.is_updatable,
1097
- oauthStage: d.oauth_stage,
1098
- isLoggable: d.is_loggable,
1099
- isCreatable: d.is_creatable,
1100
- isCopiable: d.is_copiable,
1101
- }));
1102
-
1103
- export const unmarshalPolicyFunctionArgumentSchema: z.ZodType<PolicyFunctionArgument> =
1104
- z
1105
- .object({
1106
- column: z.string().optional(),
1107
- constant: z.string().optional(),
1108
- })
1109
- .transform(d => ({
1110
- arg:
1111
- d.column !== undefined
1112
- ? {$case: 'column' as const, column: d.column}
1113
- : d.constant !== undefined
1114
- ? {$case: 'constant' as const, constant: d.constant}
1115
- : undefined,
1116
- }));
1117
-
1118
- export const unmarshalPrimaryKeyConstraintSchema: z.ZodType<PrimaryKeyConstraint> =
1119
- z
1120
- .object({
1121
- name: z.string().optional(),
1122
- child_columns: z.array(z.string()).optional(),
1123
- timeseries_columns: z.array(z.string()).optional(),
1124
- rely: z.boolean().optional(),
1125
- })
1126
- .transform(d => ({
1127
- name: d.name,
1128
- childColumns: d.child_columns,
1129
- timeseriesColumns: d.timeseries_columns,
1130
- rely: d.rely,
1131
- }));
1132
-
1133
- export const unmarshalRowFilterSchema: z.ZodType<RowFilter> = z
1134
- .object({
1135
- function_name: z.string().optional(),
1136
- input_column_names: z.array(z.string()).optional(),
1137
- input_arguments: z
1138
- .array(z.lazy(() => unmarshalPolicyFunctionArgumentSchema))
1139
- .optional(),
1140
- })
1141
- .transform(d => ({
1142
- functionName: d.function_name,
1143
- inputColumnNames: d.input_column_names,
1144
- inputArguments: d.input_arguments,
1145
- }));
1146
-
1147
- export const unmarshalSecurableKindManifestSchema: z.ZodType<SecurableKindManifest> =
1148
- z
1149
- .object({
1150
- securable_type: z.enum(SecurableType).optional(),
1151
- securable_kind: z.enum(SecurableKind).optional(),
1152
- assignable_privileges: z.array(z.string()).optional(),
1153
- options: z.array(z.lazy(() => unmarshalOptionSpecSchema)).optional(),
1154
- capabilities: z.array(z.string()).optional(),
1155
- })
1156
- .transform(d => ({
1157
- securableType: d.securable_type,
1158
- securableKind: d.securable_kind,
1159
- assignablePrivileges: d.assignable_privileges,
1160
- options: d.options,
1161
- capabilities: d.capabilities,
1162
- }));
1163
-
1164
- export const unmarshalSseEncryptionDetailsSchema: z.ZodType<SseEncryptionDetails> =
1165
- z
1166
- .object({
1167
- algorithm: z.enum(SseEncryptionAlgorithm).optional(),
1168
- aws_kms_key_arn: z.string().optional(),
1169
- })
1170
- .transform(d => ({
1171
- algorithm: d.algorithm,
1172
- awsKmsKeyArn: d.aws_kms_key_arn,
1173
- }));
1174
-
1175
- export const unmarshalTableConstraintSchema: z.ZodType<TableConstraint> = z
1176
- .object({
1177
- primary_key_constraint: z
1178
- .lazy(() => unmarshalPrimaryKeyConstraintSchema)
1179
- .optional(),
1180
- foreign_key_constraint: z
1181
- .lazy(() => unmarshalForeignKeyConstraintSchema)
1182
- .optional(),
1183
- named_table_constraint: z
1184
- .lazy(() => unmarshalNamedTableConstraintSchema)
1185
- .optional(),
1186
- })
1187
- .transform(d => ({
1188
- constraint:
1189
- d.primary_key_constraint !== undefined
1190
- ? {
1191
- $case: 'primaryKeyConstraint' as const,
1192
- primaryKeyConstraint: d.primary_key_constraint,
1193
- }
1194
- : d.foreign_key_constraint !== undefined
1195
- ? {
1196
- $case: 'foreignKeyConstraint' as const,
1197
- foreignKeyConstraint: d.foreign_key_constraint,
1198
- }
1199
- : d.named_table_constraint !== undefined
1200
- ? {
1201
- $case: 'namedTableConstraint' as const,
1202
- namedTableConstraint: d.named_table_constraint,
1203
- }
1204
- : undefined,
1205
- }));
1206
-
1207
- export const unmarshalTableDependencySchema: z.ZodType<TableDependency> = z
1208
- .object({
1209
- table_full_name: z.string().optional(),
1210
- })
1211
- .transform(d => ({
1212
- tableFullName: d.table_full_name,
1213
- }));
1214
-
1215
- export const unmarshalTableExistsResponseSchema: z.ZodType<TableExistsResponse> =
1216
- z
1217
- .object({
1218
- table_exists: z.boolean().optional(),
1219
- })
1220
- .transform(d => ({
1221
- tableExists: d.table_exists,
1222
- }));
1223
-
1224
- export const unmarshalTableInfoSchema: z.ZodType<TableInfo> = z
1225
- .object({
1226
- name: z.string().optional(),
1227
- catalog_name: z.string().optional(),
1228
- schema_name: z.string().optional(),
1229
- table_type: z.enum(TableType).optional(),
1230
- data_source_format: z.enum(DataSourceFormat).optional(),
1231
- storage_location: z.string().optional(),
1232
- view_definition: z.string().optional(),
1233
- view_dependencies: z.lazy(() => unmarshalDependencyListSchema).optional(),
1234
- sql_path: z.string().optional(),
1235
- owner: z.string().optional(),
1236
- comment: z.string().optional(),
1237
- storage_credential_name: z.string().optional(),
1238
- table_constraints: z
1239
- .array(z.lazy(() => unmarshalTableConstraintSchema))
1240
- .optional(),
1241
- row_filter: z.lazy(() => unmarshalRowFilterSchema).optional(),
1242
- pipeline_id: z.string().optional(),
1243
- enable_predictive_optimization: z.string().optional(),
1244
- metastore_id: z.string().optional(),
1245
- full_name: z.string().optional(),
1246
- data_access_configuration_id: z.string().optional(),
1247
- created_at: z
1248
- .union([z.number(), z.bigint()])
1249
- .transform(v => BigInt(v))
1250
- .optional(),
1251
- created_by: z.string().optional(),
1252
- updated_at: z
1253
- .union([z.number(), z.bigint()])
1254
- .transform(v => BigInt(v))
1255
- .optional(),
1256
- updated_by: z.string().optional(),
1257
- table_id: z.string().optional(),
1258
- delta_runtime_properties_kvpairs: z
1259
- .lazy(() => unmarshalDeltaRuntimePropertiesKvPairsSchema)
1260
- .optional(),
1261
- deleted_at: z
1262
- .union([z.number(), z.bigint()])
1263
- .transform(v => BigInt(v))
1264
- .optional(),
1265
- effective_predictive_optimization_flag: z
1266
- .lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema)
1267
- .optional(),
1268
- access_point: z.string().optional(),
1269
- browse_only: z.boolean().optional(),
1270
- encryption_details: z
1271
- .lazy(() => unmarshalEncryptionDetailsSchema)
1272
- .optional(),
1273
- securable_kind_manifest: z
1274
- .lazy(() => unmarshalSecurableKindManifestSchema)
1275
- .optional(),
1276
- columns: z.array(z.lazy(() => unmarshalColumnInfoSchema)).optional(),
1277
- properties: z.record(z.string(), z.string()).optional(),
1278
- })
1279
- .transform(d => ({
1280
- name: d.name,
1281
- catalogName: d.catalog_name,
1282
- schemaName: d.schema_name,
1283
- tableType: d.table_type,
1284
- dataSourceFormat: d.data_source_format,
1285
- storageLocation: d.storage_location,
1286
- viewDefinition: d.view_definition,
1287
- viewDependencies: d.view_dependencies,
1288
- sqlPath: d.sql_path,
1289
- owner: d.owner,
1290
- comment: d.comment,
1291
- storageCredentialName: d.storage_credential_name,
1292
- tableConstraints: d.table_constraints,
1293
- rowFilter: d.row_filter,
1294
- pipelineId: d.pipeline_id,
1295
- enablePredictiveOptimization: d.enable_predictive_optimization,
1296
- metastoreId: d.metastore_id,
1297
- fullName: d.full_name,
1298
- dataAccessConfigurationId: d.data_access_configuration_id,
1299
- createdAt: d.created_at,
1300
- createdBy: d.created_by,
1301
- updatedAt: d.updated_at,
1302
- updatedBy: d.updated_by,
1303
- tableId: d.table_id,
1304
- deltaRuntimePropertiesKvpairs: d.delta_runtime_properties_kvpairs,
1305
- deletedAt: d.deleted_at,
1306
- effectivePredictiveOptimizationFlag:
1307
- d.effective_predictive_optimization_flag,
1308
- accessPoint: d.access_point,
1309
- browseOnly: d.browse_only,
1310
- encryptionDetails: d.encryption_details,
1311
- securableKindManifest: d.securable_kind_manifest,
1312
- columns: d.columns,
1313
- properties: d.properties,
1314
- }));
1315
-
1316
- export const unmarshalTableSummarySchema: z.ZodType<TableSummary> = z
1317
- .object({
1318
- full_name: z.string().optional(),
1319
- table_type: z.enum(TableType).optional(),
1320
- securable_kind_manifest: z
1321
- .lazy(() => unmarshalSecurableKindManifestSchema)
1322
- .optional(),
1323
- })
1324
- .transform(d => ({
1325
- fullName: d.full_name,
1326
- tableType: d.table_type,
1327
- securableKindManifest: d.securable_kind_manifest,
1328
- }));
1329
-
1330
- export const unmarshalUpdateTableResponseSchema: z.ZodType<UpdateTableResponse> =
1331
- z.object({});
1332
-
1333
- export const marshalColumnInfoSchema: z.ZodType = z
1334
- .object({
1335
- name: z.string().optional(),
1336
- typeText: z.string().optional(),
1337
- typeName: z.enum(ColumnTypeName).optional(),
1338
- position: z.number().optional(),
1339
- typePrecision: z.number().optional(),
1340
- typeScale: z.number().optional(),
1341
- typeIntervalType: z.string().optional(),
1342
- typeJson: z.string().optional(),
1343
- comment: z.string().optional(),
1344
- nullable: z.boolean().optional(),
1345
- partitionIndex: z.number().optional(),
1346
- mask: z.lazy(() => marshalColumnMaskSchema).optional(),
1347
- })
1348
- .transform(d => ({
1349
- name: d.name,
1350
- type_text: d.typeText,
1351
- type_name: d.typeName,
1352
- position: d.position,
1353
- type_precision: d.typePrecision,
1354
- type_scale: d.typeScale,
1355
- type_interval_type: d.typeIntervalType,
1356
- type_json: d.typeJson,
1357
- comment: d.comment,
1358
- nullable: d.nullable,
1359
- partition_index: d.partitionIndex,
1360
- mask: d.mask,
1361
- }));
1362
-
1363
- export const marshalColumnMaskSchema: z.ZodType = z
1364
- .object({
1365
- functionName: z.string().optional(),
1366
- usingColumnNames: z.array(z.string()).optional(),
1367
- usingArguments: z
1368
- .array(z.lazy(() => marshalPolicyFunctionArgumentSchema))
1369
- .optional(),
1370
- })
1371
- .transform(d => ({
1372
- function_name: d.functionName,
1373
- using_column_names: d.usingColumnNames,
1374
- using_arguments: d.usingArguments,
1375
- }));
1376
-
1377
- export const marshalConnectionDependencySchema: z.ZodType = z
1378
- .object({
1379
- connectionName: z.string().optional(),
1380
- })
1381
- .transform(d => ({
1382
- connection_name: d.connectionName,
1383
- }));
1384
-
1385
- export const marshalCreateTableConstraintRequestSchema: z.ZodType = z
1386
- .object({
1387
- fullNameArg: z.string().optional(),
1388
- constraint: z.lazy(() => marshalTableConstraintSchema).optional(),
1389
- })
1390
- .transform(d => ({
1391
- full_name_arg: d.fullNameArg,
1392
- constraint: d.constraint,
1393
- }));
1394
-
1395
- export const marshalCreateTableRequestSchema: z.ZodType = z
1396
- .object({
1397
- name: z.string().optional(),
1398
- catalogName: z.string().optional(),
1399
- schemaName: z.string().optional(),
1400
- tableType: z.enum(TableType).optional(),
1401
- dataSourceFormat: z.enum(DataSourceFormat).optional(),
1402
- storageLocation: z.string().optional(),
1403
- viewDefinition: z.string().optional(),
1404
- viewDependencies: z.lazy(() => marshalDependencyListSchema).optional(),
1405
- sqlPath: z.string().optional(),
1406
- owner: z.string().optional(),
1407
- comment: z.string().optional(),
1408
- storageCredentialName: z.string().optional(),
1409
- tableConstraints: z
1410
- .array(z.lazy(() => marshalTableConstraintSchema))
1411
- .optional(),
1412
- rowFilter: z.lazy(() => marshalRowFilterSchema).optional(),
1413
- pipelineId: z.string().optional(),
1414
- enablePredictiveOptimization: z.string().optional(),
1415
- metastoreId: z.string().optional(),
1416
- fullName: z.string().optional(),
1417
- dataAccessConfigurationId: z.string().optional(),
1418
- createdAt: z.bigint().optional(),
1419
- createdBy: z.string().optional(),
1420
- updatedAt: z.bigint().optional(),
1421
- updatedBy: z.string().optional(),
1422
- tableId: z.string().optional(),
1423
- deltaRuntimePropertiesKvpairs: z
1424
- .lazy(() => marshalDeltaRuntimePropertiesKvPairsSchema)
1425
- .optional(),
1426
- deletedAt: z.bigint().optional(),
1427
- effectivePredictiveOptimizationFlag: z
1428
- .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema)
1429
- .optional(),
1430
- accessPoint: z.string().optional(),
1431
- browseOnly: z.boolean().optional(),
1432
- encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(),
1433
- securableKindManifest: z
1434
- .lazy(() => marshalSecurableKindManifestSchema)
1435
- .optional(),
1436
- columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(),
1437
- properties: z.record(z.string(), z.string()).optional(),
1438
- })
1439
- .transform(d => ({
1440
- name: d.name,
1441
- catalog_name: d.catalogName,
1442
- schema_name: d.schemaName,
1443
- table_type: d.tableType,
1444
- data_source_format: d.dataSourceFormat,
1445
- storage_location: d.storageLocation,
1446
- view_definition: d.viewDefinition,
1447
- view_dependencies: d.viewDependencies,
1448
- sql_path: d.sqlPath,
1449
- owner: d.owner,
1450
- comment: d.comment,
1451
- storage_credential_name: d.storageCredentialName,
1452
- table_constraints: d.tableConstraints,
1453
- row_filter: d.rowFilter,
1454
- pipeline_id: d.pipelineId,
1455
- enable_predictive_optimization: d.enablePredictiveOptimization,
1456
- metastore_id: d.metastoreId,
1457
- full_name: d.fullName,
1458
- data_access_configuration_id: d.dataAccessConfigurationId,
1459
- created_at: d.createdAt,
1460
- created_by: d.createdBy,
1461
- updated_at: d.updatedAt,
1462
- updated_by: d.updatedBy,
1463
- table_id: d.tableId,
1464
- delta_runtime_properties_kvpairs: d.deltaRuntimePropertiesKvpairs,
1465
- deleted_at: d.deletedAt,
1466
- effective_predictive_optimization_flag:
1467
- d.effectivePredictiveOptimizationFlag,
1468
- access_point: d.accessPoint,
1469
- browse_only: d.browseOnly,
1470
- encryption_details: d.encryptionDetails,
1471
- securable_kind_manifest: d.securableKindManifest,
1472
- columns: d.columns,
1473
- properties: d.properties,
1474
- }));
1475
-
1476
- export const marshalCredentialDependencySchema: z.ZodType = z
1477
- .object({
1478
- credentialName: z.string().optional(),
1479
- })
1480
- .transform(d => ({
1481
- credential_name: d.credentialName,
1482
- }));
1483
-
1484
- export const marshalDeltaRuntimePropertiesKvPairsSchema: z.ZodType = z
1485
- .object({
1486
- deltaRuntimeProperties: z.record(z.string(), z.string()).optional(),
1487
- })
1488
- .transform(d => ({
1489
- delta_runtime_properties: d.deltaRuntimeProperties,
1490
- }));
1491
-
1492
- export const marshalDependencySchema: z.ZodType = z
1493
- .object({
1494
- value: z
1495
- .discriminatedUnion('$case', [
1496
- z.object({
1497
- $case: z.literal('table'),
1498
- table: z.lazy(() => marshalTableDependencySchema),
1499
- }),
1500
- z.object({
1501
- $case: z.literal('function'),
1502
- function: z.lazy(() => marshalFunctionDependencySchema),
1503
- }),
1504
- z.object({
1505
- $case: z.literal('connection'),
1506
- connection: z.lazy(() => marshalConnectionDependencySchema),
1507
- }),
1508
- z.object({
1509
- $case: z.literal('credential'),
1510
- credential: z.lazy(() => marshalCredentialDependencySchema),
1511
- }),
1512
- ])
1513
- .optional(),
1514
- })
1515
- .transform(d => ({
1516
- ...(d.value?.$case === 'table' && {table: d.value.table}),
1517
- ...(d.value?.$case === 'function' && {function: d.value.function}),
1518
- ...(d.value?.$case === 'connection' && {connection: d.value.connection}),
1519
- ...(d.value?.$case === 'credential' && {credential: d.value.credential}),
1520
- }));
1521
-
1522
- export const marshalDependencyListSchema: z.ZodType = z
1523
- .object({
1524
- dependencies: z.array(z.lazy(() => marshalDependencySchema)).optional(),
1525
- })
1526
- .transform(d => ({
1527
- dependencies: d.dependencies,
1528
- }));
1529
-
1530
- export const marshalEffectivePredictiveOptimizationFlagSchema: z.ZodType = z
1531
- .object({
1532
- value: z.string().optional(),
1533
- inheritedFromType: z.string().optional(),
1534
- inheritedFromName: z.string().optional(),
1535
- })
1536
- .transform(d => ({
1537
- value: d.value,
1538
- inherited_from_type: d.inheritedFromType,
1539
- inherited_from_name: d.inheritedFromName,
1540
- }));
1541
-
1542
- export const marshalEncryptionDetailsSchema: z.ZodType = z
1543
- .object({
1544
- encryptionDetailsType: z
1545
- .discriminatedUnion('$case', [
1546
- z.object({
1547
- $case: z.literal('sseEncryptionDetails'),
1548
- sseEncryptionDetails: z.lazy(() => marshalSseEncryptionDetailsSchema),
1549
- }),
1550
- ])
1551
- .optional(),
1552
- })
1553
- .transform(d => ({
1554
- ...(d.encryptionDetailsType?.$case === 'sseEncryptionDetails' && {
1555
- sse_encryption_details: d.encryptionDetailsType.sseEncryptionDetails,
1556
- }),
1557
- }));
1558
-
1559
- export const marshalForeignKeyConstraintSchema: z.ZodType = z
1560
- .object({
1561
- name: z.string().optional(),
1562
- childColumns: z.array(z.string()).optional(),
1563
- parentTable: z.string().optional(),
1564
- parentColumns: z.array(z.string()).optional(),
1565
- rely: z.boolean().optional(),
1566
- })
1567
- .transform(d => ({
1568
- name: d.name,
1569
- child_columns: d.childColumns,
1570
- parent_table: d.parentTable,
1571
- parent_columns: d.parentColumns,
1572
- rely: d.rely,
1573
- }));
1574
-
1575
- export const marshalFunctionDependencySchema: z.ZodType = z
1576
- .object({
1577
- functionFullName: z.string().optional(),
1578
- })
1579
- .transform(d => ({
1580
- function_full_name: d.functionFullName,
1581
- }));
1582
-
1583
- export const marshalNamedTableConstraintSchema: z.ZodType = z
1584
- .object({
1585
- name: z.string().optional(),
1586
- })
1587
- .transform(d => ({
1588
- name: d.name,
1589
- }));
1590
-
1591
- export const marshalOptionSpecSchema: z.ZodType = z
1592
- .object({
1593
- name: z.string().optional(),
1594
- type: z.enum(OptionSpec_OptionType).optional(),
1595
- defaultValue: z.string().optional(),
1596
- allowedValues: z.array(z.string()).optional(),
1597
- hint: z.string().optional(),
1598
- description: z.string().optional(),
1599
- isRequired: z.boolean().optional(),
1600
- isSecret: z.boolean().optional(),
1601
- isHidden: z.boolean().optional(),
1602
- isUpdatable: z.boolean().optional(),
1603
- oauthStage: z.enum(OptionSpec_OauthStage).optional(),
1604
- isLoggable: z.boolean().optional(),
1605
- isCreatable: z.boolean().optional(),
1606
- isCopiable: z.boolean().optional(),
1607
- })
1608
- .transform(d => ({
1609
- name: d.name,
1610
- type: d.type,
1611
- default_value: d.defaultValue,
1612
- allowed_values: d.allowedValues,
1613
- hint: d.hint,
1614
- description: d.description,
1615
- is_required: d.isRequired,
1616
- is_secret: d.isSecret,
1617
- is_hidden: d.isHidden,
1618
- is_updatable: d.isUpdatable,
1619
- oauth_stage: d.oauthStage,
1620
- is_loggable: d.isLoggable,
1621
- is_creatable: d.isCreatable,
1622
- is_copiable: d.isCopiable,
1623
- }));
1624
-
1625
- export const marshalPolicyFunctionArgumentSchema: z.ZodType = z
1626
- .object({
1627
- arg: z
1628
- .discriminatedUnion('$case', [
1629
- z.object({$case: z.literal('column'), column: z.string()}),
1630
- z.object({$case: z.literal('constant'), constant: z.string()}),
1631
- ])
1632
- .optional(),
1633
- })
1634
- .transform(d => ({
1635
- ...(d.arg?.$case === 'column' && {column: d.arg.column}),
1636
- ...(d.arg?.$case === 'constant' && {constant: d.arg.constant}),
1637
- }));
1638
-
1639
- export const marshalPrimaryKeyConstraintSchema: z.ZodType = z
1640
- .object({
1641
- name: z.string().optional(),
1642
- childColumns: z.array(z.string()).optional(),
1643
- timeseriesColumns: z.array(z.string()).optional(),
1644
- rely: z.boolean().optional(),
1645
- })
1646
- .transform(d => ({
1647
- name: d.name,
1648
- child_columns: d.childColumns,
1649
- timeseries_columns: d.timeseriesColumns,
1650
- rely: d.rely,
1651
- }));
1652
-
1653
- export const marshalRowFilterSchema: z.ZodType = z
1654
- .object({
1655
- functionName: z.string().optional(),
1656
- inputColumnNames: z.array(z.string()).optional(),
1657
- inputArguments: z
1658
- .array(z.lazy(() => marshalPolicyFunctionArgumentSchema))
1659
- .optional(),
1660
- })
1661
- .transform(d => ({
1662
- function_name: d.functionName,
1663
- input_column_names: d.inputColumnNames,
1664
- input_arguments: d.inputArguments,
1665
- }));
1666
-
1667
- export const marshalSecurableKindManifestSchema: z.ZodType = z
1668
- .object({
1669
- securableType: z.enum(SecurableType).optional(),
1670
- securableKind: z.enum(SecurableKind).optional(),
1671
- assignablePrivileges: z.array(z.string()).optional(),
1672
- options: z.array(z.lazy(() => marshalOptionSpecSchema)).optional(),
1673
- capabilities: z.array(z.string()).optional(),
1674
- })
1675
- .transform(d => ({
1676
- securable_type: d.securableType,
1677
- securable_kind: d.securableKind,
1678
- assignable_privileges: d.assignablePrivileges,
1679
- options: d.options,
1680
- capabilities: d.capabilities,
1681
- }));
1682
-
1683
- export const marshalSseEncryptionDetailsSchema: z.ZodType = z
1684
- .object({
1685
- algorithm: z.enum(SseEncryptionAlgorithm).optional(),
1686
- awsKmsKeyArn: z.string().optional(),
1687
- })
1688
- .transform(d => ({
1689
- algorithm: d.algorithm,
1690
- aws_kms_key_arn: d.awsKmsKeyArn,
1691
- }));
1692
-
1693
- export const marshalTableConstraintSchema: z.ZodType = z
1694
- .object({
1695
- constraint: z
1696
- .discriminatedUnion('$case', [
1697
- z.object({
1698
- $case: z.literal('primaryKeyConstraint'),
1699
- primaryKeyConstraint: z.lazy(() => marshalPrimaryKeyConstraintSchema),
1700
- }),
1701
- z.object({
1702
- $case: z.literal('foreignKeyConstraint'),
1703
- foreignKeyConstraint: z.lazy(() => marshalForeignKeyConstraintSchema),
1704
- }),
1705
- z.object({
1706
- $case: z.literal('namedTableConstraint'),
1707
- namedTableConstraint: z.lazy(() => marshalNamedTableConstraintSchema),
1708
- }),
1709
- ])
1710
- .optional(),
1711
- })
1712
- .transform(d => ({
1713
- ...(d.constraint?.$case === 'primaryKeyConstraint' && {
1714
- primary_key_constraint: d.constraint.primaryKeyConstraint,
1715
- }),
1716
- ...(d.constraint?.$case === 'foreignKeyConstraint' && {
1717
- foreign_key_constraint: d.constraint.foreignKeyConstraint,
1718
- }),
1719
- ...(d.constraint?.$case === 'namedTableConstraint' && {
1720
- named_table_constraint: d.constraint.namedTableConstraint,
1721
- }),
1722
- }));
1723
-
1724
- export const marshalTableDependencySchema: z.ZodType = z
1725
- .object({
1726
- tableFullName: z.string().optional(),
1727
- })
1728
- .transform(d => ({
1729
- table_full_name: d.tableFullName,
1730
- }));
1731
-
1732
- export const marshalUpdateTableRequestSchema: z.ZodType = z
1733
- .object({
1734
- fullNameArg: z.string().optional(),
1735
- name: z.string().optional(),
1736
- catalogName: z.string().optional(),
1737
- schemaName: z.string().optional(),
1738
- tableType: z.enum(TableType).optional(),
1739
- dataSourceFormat: z.enum(DataSourceFormat).optional(),
1740
- storageLocation: z.string().optional(),
1741
- viewDefinition: z.string().optional(),
1742
- viewDependencies: z.lazy(() => marshalDependencyListSchema).optional(),
1743
- sqlPath: z.string().optional(),
1744
- owner: z.string().optional(),
1745
- comment: z.string().optional(),
1746
- storageCredentialName: z.string().optional(),
1747
- tableConstraints: z
1748
- .array(z.lazy(() => marshalTableConstraintSchema))
1749
- .optional(),
1750
- rowFilter: z.lazy(() => marshalRowFilterSchema).optional(),
1751
- pipelineId: z.string().optional(),
1752
- enablePredictiveOptimization: z.string().optional(),
1753
- metastoreId: z.string().optional(),
1754
- fullName: z.string().optional(),
1755
- dataAccessConfigurationId: z.string().optional(),
1756
- createdAt: z.bigint().optional(),
1757
- createdBy: z.string().optional(),
1758
- updatedAt: z.bigint().optional(),
1759
- updatedBy: z.string().optional(),
1760
- tableId: z.string().optional(),
1761
- deltaRuntimePropertiesKvpairs: z
1762
- .lazy(() => marshalDeltaRuntimePropertiesKvPairsSchema)
1763
- .optional(),
1764
- deletedAt: z.bigint().optional(),
1765
- effectivePredictiveOptimizationFlag: z
1766
- .lazy(() => marshalEffectivePredictiveOptimizationFlagSchema)
1767
- .optional(),
1768
- accessPoint: z.string().optional(),
1769
- browseOnly: z.boolean().optional(),
1770
- encryptionDetails: z.lazy(() => marshalEncryptionDetailsSchema).optional(),
1771
- securableKindManifest: z
1772
- .lazy(() => marshalSecurableKindManifestSchema)
1773
- .optional(),
1774
- columns: z.array(z.lazy(() => marshalColumnInfoSchema)).optional(),
1775
- properties: z.record(z.string(), z.string()).optional(),
1776
- })
1777
- .transform(d => ({
1778
- full_name_arg: d.fullNameArg,
1779
- name: d.name,
1780
- catalog_name: d.catalogName,
1781
- schema_name: d.schemaName,
1782
- table_type: d.tableType,
1783
- data_source_format: d.dataSourceFormat,
1784
- storage_location: d.storageLocation,
1785
- view_definition: d.viewDefinition,
1786
- view_dependencies: d.viewDependencies,
1787
- sql_path: d.sqlPath,
1788
- owner: d.owner,
1789
- comment: d.comment,
1790
- storage_credential_name: d.storageCredentialName,
1791
- table_constraints: d.tableConstraints,
1792
- row_filter: d.rowFilter,
1793
- pipeline_id: d.pipelineId,
1794
- enable_predictive_optimization: d.enablePredictiveOptimization,
1795
- metastore_id: d.metastoreId,
1796
- full_name: d.fullName,
1797
- data_access_configuration_id: d.dataAccessConfigurationId,
1798
- created_at: d.createdAt,
1799
- created_by: d.createdBy,
1800
- updated_at: d.updatedAt,
1801
- updated_by: d.updatedBy,
1802
- table_id: d.tableId,
1803
- delta_runtime_properties_kvpairs: d.deltaRuntimePropertiesKvpairs,
1804
- deleted_at: d.deletedAt,
1805
- effective_predictive_optimization_flag:
1806
- d.effectivePredictiveOptimizationFlag,
1807
- access_point: d.accessPoint,
1808
- browse_only: d.browseOnly,
1809
- encryption_details: d.encryptionDetails,
1810
- securable_kind_manifest: d.securableKindManifest,
1811
- columns: d.columns,
1812
- properties: d.properties,
1813
- }));