@databricks/sdk-uc-registeredmodels 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,849 +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 ModelVersionStatus {
6
- MODEL_VERSION_STATUS_UNKNOWN = 'MODEL_VERSION_STATUS_UNKNOWN',
7
- /** Request to register a new model version is pending as client uploads model files. */
8
- PENDING_REGISTRATION = 'PENDING_REGISTRATION',
9
- /** Request to register a new model version has failed. */
10
- FAILED_REGISTRATION = 'FAILED_REGISTRATION',
11
- /** Model version is ready for use. */
12
- READY = 'READY',
13
- }
14
-
15
- /** A connection that is dependent on a SQL object. */
16
- export interface ConnectionDependency {
17
- /** Full name of the dependent connection, in the form of __connection_name__. */
18
- connectionName?: string | undefined;
19
- }
20
-
21
- export interface CreateRegisteredModelRequest {
22
- /** The name of the registered model */
23
- name?: string | undefined;
24
- /** The name of the catalog where the schema and the registered model reside */
25
- catalogName?: string | undefined;
26
- /** The name of the schema where the registered model resides */
27
- schemaName?: string | undefined;
28
- /** The identifier of the user who owns the registered model */
29
- owner?: string | undefined;
30
- /** The comment attached to the registered model */
31
- comment?: string | undefined;
32
- /** The storage location on the cloud under which model version data files are stored */
33
- storageLocation?: string | undefined;
34
- /** The unique identifier of the metastore */
35
- metastoreId?: string | undefined;
36
- /** The three-level (fully qualified) name of the registered model */
37
- fullName?: string | undefined;
38
- /** Creation timestamp of the registered model in milliseconds since the Unix epoch */
39
- createdAt?: bigint | undefined;
40
- /** The identifier of the user who created the registered model */
41
- createdBy?: string | undefined;
42
- /** Last-update timestamp of the registered model in milliseconds since the Unix epoch */
43
- updatedAt?: bigint | undefined;
44
- /** The identifier of the user who updated the registered model last time */
45
- updatedBy?: string | undefined;
46
- /** List of aliases associated with the registered model */
47
- aliases?: RegisteredModelAliasInfo[] | undefined;
48
- /** 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. */
49
- browseOnly?: boolean | undefined;
50
- }
51
-
52
- /** A credential that is dependent on a SQL object. */
53
- export interface CredentialDependency {
54
- /** Full name of the dependent credential, in the form of __credential_name__. */
55
- credentialName?: string | undefined;
56
- }
57
-
58
- export interface DeleteModelVersionRequest {
59
- /** The three-level (fully qualified) name of the model version */
60
- fullNameArg?: string | undefined;
61
- /** The integer version number of the model version */
62
- versionArg?: bigint | undefined;
63
- }
64
-
65
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
66
- export interface DeleteModelVersionResponse {}
67
-
68
- export interface DeleteRegisteredModelAliasRequest {
69
- /** The three-level (fully qualified) name of the registered model */
70
- fullNameArg?: string | undefined;
71
- /** The name of the alias */
72
- aliasArg?: string | undefined;
73
- }
74
-
75
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
76
- export interface DeleteRegisteredModelAliasResponse {}
77
-
78
- export interface DeleteRegisteredModelRequest {
79
- /** The three-level (fully qualified) name of the registered model */
80
- fullNameArg?: string | undefined;
81
- }
82
-
83
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
84
- export interface DeleteRegisteredModelResponse {}
85
-
86
- /**
87
- * A dependency of a SQL object. One of the following fields must be defined:
88
- * __table__, __function__, __connection__, __credential__, __volume__, or __secret__.
89
- */
90
- export interface Dependency {
91
- value?:
92
- | {$case: 'table'; table: TableDependency}
93
- | {$case: 'function'; function: FunctionDependency}
94
- | {$case: 'connection'; connection: ConnectionDependency}
95
- | {$case: 'credential'; credential: CredentialDependency}
96
- | undefined;
97
- }
98
-
99
- /** A list of dependencies. */
100
- export interface DependencyList {
101
- /** Array of dependencies. */
102
- dependencies?: Dependency[] | undefined;
103
- }
104
-
105
- /** A function that is dependent on a SQL object. */
106
- export interface FunctionDependency {
107
- /** Full name of the dependent function, in the form of __catalog_name__.__schema_name__.__function_name__. */
108
- functionFullName?: string | undefined;
109
- }
110
-
111
- export interface GetModelVersionByAliasRequest {
112
- /** The three-level (fully qualified) name of the registered model */
113
- fullNameArg?: string | undefined;
114
- /** The name of the alias */
115
- aliasArg?: string | undefined;
116
- /** Whether to include aliases associated with the model version in the response */
117
- includeAliases?: boolean | undefined;
118
- }
119
-
120
- export interface GetModelVersionRequest {
121
- /** The three-level (fully qualified) name of the model version */
122
- fullNameArg?: string | undefined;
123
- /** The integer version number of the model version */
124
- versionArg?: bigint | undefined;
125
- /** Whether to include aliases associated with the model version in the response */
126
- includeAliases?: boolean | undefined;
127
- /** Whether to include model versions in the response for which the principal can only access selective metadata for */
128
- includeBrowse?: boolean | undefined;
129
- }
130
-
131
- export interface GetRegisteredModelRequest {
132
- /** The three-level (fully qualified) name of the registered model */
133
- fullNameArg?: string | undefined;
134
- /** Whether to include registered model aliases in the response */
135
- includeAliases?: boolean | undefined;
136
- /** Whether to include registered models in the response for which the principal can only access selective metadata for */
137
- includeBrowse?: boolean | undefined;
138
- }
139
-
140
- export interface ListModelVersionsRequest {
141
- /** The full three-level name of the registered model under which to list model versions */
142
- fullNameArg?: string | undefined;
143
- /**
144
- * Maximum number of model versions to return.
145
- * If not set, the page length is set to a server configured value (100, as of 1/3/2024).
146
- * - when set to a value greater than 0, the page length is the minimum of this value and a server configured value(1000, as of 1/3/2024);
147
- * - when set to 0, the page length is set to a server configured value (100, as of 1/3/2024) (recommended);
148
- * - when set to a value less than 0, an invalid parameter error is returned;
149
- */
150
- maxResults?: bigint | undefined;
151
- /** Opaque pagination token to go to next page based on previous query. */
152
- pageToken?: string | undefined;
153
- /** Whether to include model versions in the response for which the principal can only access selective metadata for */
154
- includeBrowse?: boolean | undefined;
155
- }
156
-
157
- export interface ListModelVersionsResponse {
158
- modelVersions?: ModelVersionInfo[] | undefined;
159
- /**
160
- * Opaque token to retrieve the next page of results. Absent if there are no more pages.
161
- * __page_token__ should be set to this value for the next request (for the next page of results).
162
- */
163
- nextPageToken?: string | undefined;
164
- }
165
-
166
- export interface ListRegisteredModelsRequest {
167
- /**
168
- * The identifier of the catalog under which to list registered models.
169
- * If specified, schema_name must be specified.
170
- */
171
- catalogName?: string | undefined;
172
- /**
173
- * The identifier of the schema under which to list registered models.
174
- * If specified, catalog_name must be specified.
175
- */
176
- schemaName?: string | undefined;
177
- /** Whether to include registered models in the response for which the principal can only access selective metadata for */
178
- includeBrowse?: boolean | undefined;
179
- /**
180
- * Max number of registered models to return.
181
- *
182
- * If both catalog and schema are specified:
183
- * - when max_results is not specified, the page length is set to a server configured value (10000, as of 4/2/2024).
184
- * - 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 4/2/2024);
185
- * - when set to 0, the page length is set to a server configured value (10000, as of 4/2/2024);
186
- * - when set to a value less than 0, an invalid parameter error is returned;
187
- *
188
- * If neither schema nor catalog is specified:
189
- * - when max_results is not specified, the page length is set to a server configured value (100, as of 4/2/2024).
190
- * - when set to a value greater than 0, the page length is the minimum of this value and a server configured value (1000, as of 4/2/2024);
191
- * - when set to 0, the page length is set to a server configured value (100, as of 4/2/2024);
192
- * - when set to a value less than 0, an invalid parameter error is returned;
193
- */
194
- maxResults?: bigint | undefined;
195
- /** Opaque token to send for the next page of results (pagination). */
196
- pageToken?: string | undefined;
197
- }
198
-
199
- export interface ListRegisteredModelsResponse {
200
- registeredModels?: RegisteredModelInfo[] | undefined;
201
- /**
202
- * Opaque token for pagination. Omitted if there are no more results. page_token should
203
- * be set to this value for fetching the next page.
204
- */
205
- nextPageToken?: string | undefined;
206
- }
207
-
208
- export interface ModelVersionInfo {
209
- /** The name of the parent registered model of the model version, relative to parent schema */
210
- modelName?: string | undefined;
211
- /** The name of the catalog containing the model version */
212
- catalogName?: string | undefined;
213
- /** The name of the schema containing the model version, relative to parent catalog */
214
- schemaName?: string | undefined;
215
- /** URI indicating the location of the source artifacts (files) for the model version */
216
- source?: string | undefined;
217
- /** The comment attached to the model version */
218
- comment?: string | undefined;
219
- /**
220
- * MLflow run ID used when creating the model version, if ``source`` was generated by an
221
- * experiment run stored in an MLflow tracking server
222
- */
223
- runId?: string | undefined;
224
- /**
225
- * ID of the <Databricks> workspace containing the MLflow run that generated this model
226
- * version, if applicable
227
- */
228
- runWorkspaceId?: bigint | undefined;
229
- /** Model version dependencies, for feature-store packaged models */
230
- modelVersionDependencies?: DependencyList | undefined;
231
- /**
232
- * Current status of the model version. Newly created model versions start in
233
- * PENDING_REGISTRATION status, then move to READY status once the model version files are uploaded and
234
- * the model version is finalized. Only model versions in READY status can be loaded for inference or
235
- * served.
236
- */
237
- status?: ModelVersionStatus | undefined;
238
- /** Integer model version number, used to reference the model version in API requests. */
239
- version?: bigint | undefined;
240
- /** The storage location on the cloud under which model version data files are stored */
241
- storageLocation?: string | undefined;
242
- /** The unique identifier of the metastore containing the model version */
243
- metastoreId?: string | undefined;
244
- createdAt?: bigint | undefined;
245
- /** The identifier of the user who created the model version */
246
- createdBy?: string | undefined;
247
- updatedAt?: bigint | undefined;
248
- /** The identifier of the user who updated the model version last time */
249
- updatedBy?: string | undefined;
250
- /** The unique identifier of the model version */
251
- id?: string | undefined;
252
- /** List of aliases associated with the model version */
253
- aliases?: RegisteredModelAliasInfo[] | undefined;
254
- }
255
-
256
- export interface RegisteredModelAliasInfo {
257
- /** Name of the alias, e.g. 'champion' or 'latest_stable' */
258
- aliasName?: string | undefined;
259
- /** Integer version number of the model version to which this alias points. */
260
- versionNum?: bigint | undefined;
261
- /** The unique identifier of the alias */
262
- id?: string | undefined;
263
- /** The name of the parent registered model of the model version, relative to parent schema */
264
- modelName?: string | undefined;
265
- /** The name of the catalog containing the model version */
266
- catalogName?: string | undefined;
267
- /** The name of the schema containing the model version, relative to parent catalog */
268
- schemaName?: string | undefined;
269
- }
270
-
271
- export interface RegisteredModelInfo {
272
- /** The name of the registered model */
273
- name?: string | undefined;
274
- /** The name of the catalog where the schema and the registered model reside */
275
- catalogName?: string | undefined;
276
- /** The name of the schema where the registered model resides */
277
- schemaName?: string | undefined;
278
- /** The identifier of the user who owns the registered model */
279
- owner?: string | undefined;
280
- /** The comment attached to the registered model */
281
- comment?: string | undefined;
282
- /** The storage location on the cloud under which model version data files are stored */
283
- storageLocation?: string | undefined;
284
- /** The unique identifier of the metastore */
285
- metastoreId?: string | undefined;
286
- /** The three-level (fully qualified) name of the registered model */
287
- fullName?: string | undefined;
288
- /** Creation timestamp of the registered model in milliseconds since the Unix epoch */
289
- createdAt?: bigint | undefined;
290
- /** The identifier of the user who created the registered model */
291
- createdBy?: string | undefined;
292
- /** Last-update timestamp of the registered model in milliseconds since the Unix epoch */
293
- updatedAt?: bigint | undefined;
294
- /** The identifier of the user who updated the registered model last time */
295
- updatedBy?: string | undefined;
296
- /** List of aliases associated with the registered model */
297
- aliases?: RegisteredModelAliasInfo[] | undefined;
298
- /** 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. */
299
- browseOnly?: boolean | undefined;
300
- }
301
-
302
- export interface SetRegisteredModelAliasRequest {
303
- /** The three-level (fully qualified) name of the registered model */
304
- fullNameArg?: string | undefined;
305
- /** The name of the alias */
306
- aliasArg?: string | undefined;
307
- /** The version number of the model version to which the alias points */
308
- versionNum?: bigint | undefined;
309
- }
310
-
311
- /** A table that is dependent on a SQL object. */
312
- export interface TableDependency {
313
- /** Full name of the dependent table, in the form of __catalog_name__.__schema_name__.__table_name__. */
314
- tableFullName?: string | undefined;
315
- }
316
-
317
- export interface UpdateModelVersionRequest {
318
- /** The three-level (fully qualified) name of the model version */
319
- fullNameArg?: string | undefined;
320
- /** The integer version number of the model version */
321
- versionArg?: bigint | undefined;
322
- /** The name of the parent registered model of the model version, relative to parent schema */
323
- modelName?: string | undefined;
324
- /** The name of the catalog containing the model version */
325
- catalogName?: string | undefined;
326
- /** The name of the schema containing the model version, relative to parent catalog */
327
- schemaName?: string | undefined;
328
- /** URI indicating the location of the source artifacts (files) for the model version */
329
- source?: string | undefined;
330
- /** The comment attached to the model version */
331
- comment?: string | undefined;
332
- /**
333
- * MLflow run ID used when creating the model version, if ``source`` was generated by an
334
- * experiment run stored in an MLflow tracking server
335
- */
336
- runId?: string | undefined;
337
- /**
338
- * ID of the <Databricks> workspace containing the MLflow run that generated this model
339
- * version, if applicable
340
- */
341
- runWorkspaceId?: bigint | undefined;
342
- /** Model version dependencies, for feature-store packaged models */
343
- modelVersionDependencies?: DependencyList | undefined;
344
- /**
345
- * Current status of the model version. Newly created model versions start in
346
- * PENDING_REGISTRATION status, then move to READY status once the model version files are uploaded and
347
- * the model version is finalized. Only model versions in READY status can be loaded for inference or
348
- * served.
349
- */
350
- status?: ModelVersionStatus | undefined;
351
- /** Integer model version number, used to reference the model version in API requests. */
352
- version?: bigint | undefined;
353
- /** The storage location on the cloud under which model version data files are stored */
354
- storageLocation?: string | undefined;
355
- /** The unique identifier of the metastore containing the model version */
356
- metastoreId?: string | undefined;
357
- createdAt?: bigint | undefined;
358
- /** The identifier of the user who created the model version */
359
- createdBy?: string | undefined;
360
- updatedAt?: bigint | undefined;
361
- /** The identifier of the user who updated the model version last time */
362
- updatedBy?: string | undefined;
363
- /** The unique identifier of the model version */
364
- id?: string | undefined;
365
- /** List of aliases associated with the model version */
366
- aliases?: RegisteredModelAliasInfo[] | undefined;
367
- }
368
-
369
- export interface UpdateRegisteredModelRequest {
370
- /** The three-level (fully qualified) name of the registered model */
371
- fullNameArg?: string | undefined;
372
- /** New name for the registered model. */
373
- newName?: string | undefined;
374
- /** The name of the registered model */
375
- name?: string | undefined;
376
- /** The name of the catalog where the schema and the registered model reside */
377
- catalogName?: string | undefined;
378
- /** The name of the schema where the registered model resides */
379
- schemaName?: string | undefined;
380
- /** The identifier of the user who owns the registered model */
381
- owner?: string | undefined;
382
- /** The comment attached to the registered model */
383
- comment?: string | undefined;
384
- /** The storage location on the cloud under which model version data files are stored */
385
- storageLocation?: string | undefined;
386
- /** The unique identifier of the metastore */
387
- metastoreId?: string | undefined;
388
- /** The three-level (fully qualified) name of the registered model */
389
- fullName?: string | undefined;
390
- /** Creation timestamp of the registered model in milliseconds since the Unix epoch */
391
- createdAt?: bigint | undefined;
392
- /** The identifier of the user who created the registered model */
393
- createdBy?: string | undefined;
394
- /** Last-update timestamp of the registered model in milliseconds since the Unix epoch */
395
- updatedAt?: bigint | undefined;
396
- /** The identifier of the user who updated the registered model last time */
397
- updatedBy?: string | undefined;
398
- /** List of aliases associated with the registered model */
399
- aliases?: RegisteredModelAliasInfo[] | undefined;
400
- /** 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. */
401
- browseOnly?: boolean | undefined;
402
- }
403
-
404
- export const unmarshalConnectionDependencySchema: z.ZodType<ConnectionDependency> =
405
- z
406
- .object({
407
- connection_name: z.string().optional(),
408
- })
409
- .transform(d => ({
410
- connectionName: d.connection_name,
411
- }));
412
-
413
- export const unmarshalCredentialDependencySchema: z.ZodType<CredentialDependency> =
414
- z
415
- .object({
416
- credential_name: z.string().optional(),
417
- })
418
- .transform(d => ({
419
- credentialName: d.credential_name,
420
- }));
421
-
422
- export const unmarshalDeleteModelVersionResponseSchema: z.ZodType<DeleteModelVersionResponse> =
423
- z.object({});
424
-
425
- export const unmarshalDeleteRegisteredModelAliasResponseSchema: z.ZodType<DeleteRegisteredModelAliasResponse> =
426
- z.object({});
427
-
428
- export const unmarshalDeleteRegisteredModelResponseSchema: z.ZodType<DeleteRegisteredModelResponse> =
429
- z.object({});
430
-
431
- export const unmarshalDependencySchema: z.ZodType<Dependency> = z
432
- .object({
433
- table: z.lazy(() => unmarshalTableDependencySchema).optional(),
434
- function: z.lazy(() => unmarshalFunctionDependencySchema).optional(),
435
- connection: z.lazy(() => unmarshalConnectionDependencySchema).optional(),
436
- credential: z.lazy(() => unmarshalCredentialDependencySchema).optional(),
437
- })
438
- .transform(d => ({
439
- value:
440
- d.table !== undefined
441
- ? {$case: 'table' as const, table: d.table}
442
- : d.function !== undefined
443
- ? {$case: 'function' as const, function: d.function}
444
- : d.connection !== undefined
445
- ? {$case: 'connection' as const, connection: d.connection}
446
- : d.credential !== undefined
447
- ? {$case: 'credential' as const, credential: d.credential}
448
- : undefined,
449
- }));
450
-
451
- export const unmarshalDependencyListSchema: z.ZodType<DependencyList> = z
452
- .object({
453
- dependencies: z.array(z.lazy(() => unmarshalDependencySchema)).optional(),
454
- })
455
- .transform(d => ({
456
- dependencies: d.dependencies,
457
- }));
458
-
459
- export const unmarshalFunctionDependencySchema: z.ZodType<FunctionDependency> =
460
- z
461
- .object({
462
- function_full_name: z.string().optional(),
463
- })
464
- .transform(d => ({
465
- functionFullName: d.function_full_name,
466
- }));
467
-
468
- export const unmarshalListModelVersionsResponseSchema: z.ZodType<ListModelVersionsResponse> =
469
- z
470
- .object({
471
- model_versions: z
472
- .array(z.lazy(() => unmarshalModelVersionInfoSchema))
473
- .optional(),
474
- next_page_token: z.string().optional(),
475
- })
476
- .transform(d => ({
477
- modelVersions: d.model_versions,
478
- nextPageToken: d.next_page_token,
479
- }));
480
-
481
- export const unmarshalListRegisteredModelsResponseSchema: z.ZodType<ListRegisteredModelsResponse> =
482
- z
483
- .object({
484
- registered_models: z
485
- .array(z.lazy(() => unmarshalRegisteredModelInfoSchema))
486
- .optional(),
487
- next_page_token: z.string().optional(),
488
- })
489
- .transform(d => ({
490
- registeredModels: d.registered_models,
491
- nextPageToken: d.next_page_token,
492
- }));
493
-
494
- export const unmarshalModelVersionInfoSchema: z.ZodType<ModelVersionInfo> = z
495
- .object({
496
- model_name: z.string().optional(),
497
- catalog_name: z.string().optional(),
498
- schema_name: z.string().optional(),
499
- source: z.string().optional(),
500
- comment: z.string().optional(),
501
- run_id: z.string().optional(),
502
- run_workspace_id: z
503
- .union([z.number(), z.bigint()])
504
- .transform(v => BigInt(v))
505
- .optional(),
506
- model_version_dependencies: z
507
- .lazy(() => unmarshalDependencyListSchema)
508
- .optional(),
509
- status: z.enum(ModelVersionStatus).optional(),
510
- version: z
511
- .union([z.number(), z.bigint()])
512
- .transform(v => BigInt(v))
513
- .optional(),
514
- storage_location: z.string().optional(),
515
- metastore_id: z.string().optional(),
516
- created_at: z
517
- .union([z.number(), z.bigint()])
518
- .transform(v => BigInt(v))
519
- .optional(),
520
- created_by: z.string().optional(),
521
- updated_at: z
522
- .union([z.number(), z.bigint()])
523
- .transform(v => BigInt(v))
524
- .optional(),
525
- updated_by: z.string().optional(),
526
- id: z.string().optional(),
527
- aliases: z
528
- .array(z.lazy(() => unmarshalRegisteredModelAliasInfoSchema))
529
- .optional(),
530
- })
531
- .transform(d => ({
532
- modelName: d.model_name,
533
- catalogName: d.catalog_name,
534
- schemaName: d.schema_name,
535
- source: d.source,
536
- comment: d.comment,
537
- runId: d.run_id,
538
- runWorkspaceId: d.run_workspace_id,
539
- modelVersionDependencies: d.model_version_dependencies,
540
- status: d.status,
541
- version: d.version,
542
- storageLocation: d.storage_location,
543
- metastoreId: d.metastore_id,
544
- createdAt: d.created_at,
545
- createdBy: d.created_by,
546
- updatedAt: d.updated_at,
547
- updatedBy: d.updated_by,
548
- id: d.id,
549
- aliases: d.aliases,
550
- }));
551
-
552
- export const unmarshalRegisteredModelAliasInfoSchema: z.ZodType<RegisteredModelAliasInfo> =
553
- z
554
- .object({
555
- alias_name: z.string().optional(),
556
- version_num: z
557
- .union([z.number(), z.bigint()])
558
- .transform(v => BigInt(v))
559
- .optional(),
560
- id: z.string().optional(),
561
- model_name: z.string().optional(),
562
- catalog_name: z.string().optional(),
563
- schema_name: z.string().optional(),
564
- })
565
- .transform(d => ({
566
- aliasName: d.alias_name,
567
- versionNum: d.version_num,
568
- id: d.id,
569
- modelName: d.model_name,
570
- catalogName: d.catalog_name,
571
- schemaName: d.schema_name,
572
- }));
573
-
574
- export const unmarshalRegisteredModelInfoSchema: z.ZodType<RegisteredModelInfo> =
575
- z
576
- .object({
577
- name: z.string().optional(),
578
- catalog_name: z.string().optional(),
579
- schema_name: z.string().optional(),
580
- owner: z.string().optional(),
581
- comment: z.string().optional(),
582
- storage_location: z.string().optional(),
583
- metastore_id: z.string().optional(),
584
- full_name: z.string().optional(),
585
- created_at: z
586
- .union([z.number(), z.bigint()])
587
- .transform(v => BigInt(v))
588
- .optional(),
589
- created_by: z.string().optional(),
590
- updated_at: z
591
- .union([z.number(), z.bigint()])
592
- .transform(v => BigInt(v))
593
- .optional(),
594
- updated_by: z.string().optional(),
595
- aliases: z
596
- .array(z.lazy(() => unmarshalRegisteredModelAliasInfoSchema))
597
- .optional(),
598
- browse_only: z.boolean().optional(),
599
- })
600
- .transform(d => ({
601
- name: d.name,
602
- catalogName: d.catalog_name,
603
- schemaName: d.schema_name,
604
- owner: d.owner,
605
- comment: d.comment,
606
- storageLocation: d.storage_location,
607
- metastoreId: d.metastore_id,
608
- fullName: d.full_name,
609
- createdAt: d.created_at,
610
- createdBy: d.created_by,
611
- updatedAt: d.updated_at,
612
- updatedBy: d.updated_by,
613
- aliases: d.aliases,
614
- browseOnly: d.browse_only,
615
- }));
616
-
617
- export const unmarshalTableDependencySchema: z.ZodType<TableDependency> = z
618
- .object({
619
- table_full_name: z.string().optional(),
620
- })
621
- .transform(d => ({
622
- tableFullName: d.table_full_name,
623
- }));
624
-
625
- export const marshalConnectionDependencySchema: z.ZodType = z
626
- .object({
627
- connectionName: z.string().optional(),
628
- })
629
- .transform(d => ({
630
- connection_name: d.connectionName,
631
- }));
632
-
633
- export const marshalCreateRegisteredModelRequestSchema: z.ZodType = z
634
- .object({
635
- name: z.string().optional(),
636
- catalogName: z.string().optional(),
637
- schemaName: z.string().optional(),
638
- owner: z.string().optional(),
639
- comment: z.string().optional(),
640
- storageLocation: z.string().optional(),
641
- metastoreId: z.string().optional(),
642
- fullName: z.string().optional(),
643
- createdAt: z.bigint().optional(),
644
- createdBy: z.string().optional(),
645
- updatedAt: z.bigint().optional(),
646
- updatedBy: z.string().optional(),
647
- aliases: z
648
- .array(z.lazy(() => marshalRegisteredModelAliasInfoSchema))
649
- .optional(),
650
- browseOnly: z.boolean().optional(),
651
- })
652
- .transform(d => ({
653
- name: d.name,
654
- catalog_name: d.catalogName,
655
- schema_name: d.schemaName,
656
- owner: d.owner,
657
- comment: d.comment,
658
- storage_location: d.storageLocation,
659
- metastore_id: d.metastoreId,
660
- full_name: d.fullName,
661
- created_at: d.createdAt,
662
- created_by: d.createdBy,
663
- updated_at: d.updatedAt,
664
- updated_by: d.updatedBy,
665
- aliases: d.aliases,
666
- browse_only: d.browseOnly,
667
- }));
668
-
669
- export const marshalCredentialDependencySchema: z.ZodType = z
670
- .object({
671
- credentialName: z.string().optional(),
672
- })
673
- .transform(d => ({
674
- credential_name: d.credentialName,
675
- }));
676
-
677
- export const marshalDependencySchema: z.ZodType = z
678
- .object({
679
- value: z
680
- .discriminatedUnion('$case', [
681
- z.object({
682
- $case: z.literal('table'),
683
- table: z.lazy(() => marshalTableDependencySchema),
684
- }),
685
- z.object({
686
- $case: z.literal('function'),
687
- function: z.lazy(() => marshalFunctionDependencySchema),
688
- }),
689
- z.object({
690
- $case: z.literal('connection'),
691
- connection: z.lazy(() => marshalConnectionDependencySchema),
692
- }),
693
- z.object({
694
- $case: z.literal('credential'),
695
- credential: z.lazy(() => marshalCredentialDependencySchema),
696
- }),
697
- ])
698
- .optional(),
699
- })
700
- .transform(d => ({
701
- ...(d.value?.$case === 'table' && {table: d.value.table}),
702
- ...(d.value?.$case === 'function' && {function: d.value.function}),
703
- ...(d.value?.$case === 'connection' && {connection: d.value.connection}),
704
- ...(d.value?.$case === 'credential' && {credential: d.value.credential}),
705
- }));
706
-
707
- export const marshalDependencyListSchema: z.ZodType = z
708
- .object({
709
- dependencies: z.array(z.lazy(() => marshalDependencySchema)).optional(),
710
- })
711
- .transform(d => ({
712
- dependencies: d.dependencies,
713
- }));
714
-
715
- export const marshalFunctionDependencySchema: z.ZodType = z
716
- .object({
717
- functionFullName: z.string().optional(),
718
- })
719
- .transform(d => ({
720
- function_full_name: d.functionFullName,
721
- }));
722
-
723
- export const marshalRegisteredModelAliasInfoSchema: z.ZodType = z
724
- .object({
725
- aliasName: z.string().optional(),
726
- versionNum: z.bigint().optional(),
727
- id: z.string().optional(),
728
- modelName: z.string().optional(),
729
- catalogName: z.string().optional(),
730
- schemaName: z.string().optional(),
731
- })
732
- .transform(d => ({
733
- alias_name: d.aliasName,
734
- version_num: d.versionNum,
735
- id: d.id,
736
- model_name: d.modelName,
737
- catalog_name: d.catalogName,
738
- schema_name: d.schemaName,
739
- }));
740
-
741
- export const marshalSetRegisteredModelAliasRequestSchema: z.ZodType = z
742
- .object({
743
- fullNameArg: z.string().optional(),
744
- aliasArg: z.string().optional(),
745
- versionNum: z.bigint().optional(),
746
- })
747
- .transform(d => ({
748
- full_name_arg: d.fullNameArg,
749
- alias_arg: d.aliasArg,
750
- version_num: d.versionNum,
751
- }));
752
-
753
- export const marshalTableDependencySchema: z.ZodType = z
754
- .object({
755
- tableFullName: z.string().optional(),
756
- })
757
- .transform(d => ({
758
- table_full_name: d.tableFullName,
759
- }));
760
-
761
- export const marshalUpdateModelVersionRequestSchema: z.ZodType = z
762
- .object({
763
- fullNameArg: z.string().optional(),
764
- versionArg: z.bigint().optional(),
765
- modelName: z.string().optional(),
766
- catalogName: z.string().optional(),
767
- schemaName: z.string().optional(),
768
- source: z.string().optional(),
769
- comment: z.string().optional(),
770
- runId: z.string().optional(),
771
- runWorkspaceId: z.bigint().optional(),
772
- modelVersionDependencies: z
773
- .lazy(() => marshalDependencyListSchema)
774
- .optional(),
775
- status: z.enum(ModelVersionStatus).optional(),
776
- version: z.bigint().optional(),
777
- storageLocation: z.string().optional(),
778
- metastoreId: z.string().optional(),
779
- createdAt: z.bigint().optional(),
780
- createdBy: z.string().optional(),
781
- updatedAt: z.bigint().optional(),
782
- updatedBy: z.string().optional(),
783
- id: z.string().optional(),
784
- aliases: z
785
- .array(z.lazy(() => marshalRegisteredModelAliasInfoSchema))
786
- .optional(),
787
- })
788
- .transform(d => ({
789
- full_name_arg: d.fullNameArg,
790
- version_arg: d.versionArg,
791
- model_name: d.modelName,
792
- catalog_name: d.catalogName,
793
- schema_name: d.schemaName,
794
- source: d.source,
795
- comment: d.comment,
796
- run_id: d.runId,
797
- run_workspace_id: d.runWorkspaceId,
798
- model_version_dependencies: d.modelVersionDependencies,
799
- status: d.status,
800
- version: d.version,
801
- storage_location: d.storageLocation,
802
- metastore_id: d.metastoreId,
803
- created_at: d.createdAt,
804
- created_by: d.createdBy,
805
- updated_at: d.updatedAt,
806
- updated_by: d.updatedBy,
807
- id: d.id,
808
- aliases: d.aliases,
809
- }));
810
-
811
- export const marshalUpdateRegisteredModelRequestSchema: z.ZodType = z
812
- .object({
813
- fullNameArg: z.string().optional(),
814
- newName: z.string().optional(),
815
- name: z.string().optional(),
816
- catalogName: z.string().optional(),
817
- schemaName: z.string().optional(),
818
- owner: z.string().optional(),
819
- comment: z.string().optional(),
820
- storageLocation: z.string().optional(),
821
- metastoreId: z.string().optional(),
822
- fullName: z.string().optional(),
823
- createdAt: z.bigint().optional(),
824
- createdBy: z.string().optional(),
825
- updatedAt: z.bigint().optional(),
826
- updatedBy: z.string().optional(),
827
- aliases: z
828
- .array(z.lazy(() => marshalRegisteredModelAliasInfoSchema))
829
- .optional(),
830
- browseOnly: z.boolean().optional(),
831
- })
832
- .transform(d => ({
833
- full_name_arg: d.fullNameArg,
834
- new_name: d.newName,
835
- name: d.name,
836
- catalog_name: d.catalogName,
837
- schema_name: d.schemaName,
838
- owner: d.owner,
839
- comment: d.comment,
840
- storage_location: d.storageLocation,
841
- metastore_id: d.metastoreId,
842
- full_name: d.fullName,
843
- created_at: d.createdAt,
844
- created_by: d.createdBy,
845
- updated_at: d.updatedAt,
846
- updated_by: d.updatedBy,
847
- aliases: d.aliases,
848
- browse_only: d.browseOnly,
849
- }));