@databricks/sdk-modelregistry 0.0.0-dev → 0.1.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,950 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+ import { z } from 'zod';
3
+ /**
4
+ * An action that a user (with sufficient permissions) could take on an activity or comment.
5
+ *
6
+ * For activities, valid values are:
7
+ * * `APPROVE_TRANSITION_REQUEST`: Approve a transition request
8
+ *
9
+ * * `REJECT_TRANSITION_REQUEST`: Reject a transition request
10
+ *
11
+ * * `CANCEL_TRANSITION_REQUEST`: Cancel (delete) a transition request
12
+ *
13
+ * For comments, valid values are:
14
+ * * `EDIT_COMMENT`: Edit the comment
15
+ *
16
+ * * `DELETE_COMMENT`: Delete the comment
17
+ */
18
+ export var ActivityAction;
19
+ (function (ActivityAction) {
20
+ /** Approve a transition request. Available to users with sufficient permissions. */
21
+ ActivityAction["APPROVE_TRANSITION_REQUEST"] = "APPROVE_TRANSITION_REQUEST";
22
+ /** Reject a transition request. Available to users with sufficient permissions. */
23
+ ActivityAction["REJECT_TRANSITION_REQUEST"] = "REJECT_TRANSITION_REQUEST";
24
+ /** Cancel a transition request. Available to the user who created the request. */
25
+ ActivityAction["CANCEL_TRANSITION_REQUEST"] = "CANCEL_TRANSITION_REQUEST";
26
+ /** Edit the comment */
27
+ ActivityAction["EDIT_COMMENT"] = "EDIT_COMMENT";
28
+ /** Delete the comment */
29
+ ActivityAction["DELETE_COMMENT"] = "DELETE_COMMENT";
30
+ })(ActivityAction || (ActivityAction = {}));
31
+ /**
32
+ * Type of activity. Valid values are:
33
+ * * `APPLIED_TRANSITION`: User applied the corresponding stage transition.
34
+ *
35
+ * * `REQUESTED_TRANSITION`: User requested the corresponding stage transition.
36
+ *
37
+ * * `CANCELLED_REQUEST`: User cancelled an existing transition request.
38
+ *
39
+ * * `APPROVED_REQUEST`: User approved the corresponding stage transition.
40
+ *
41
+ * * `REJECTED_REQUEST`: User rejected the coressponding stage transition.
42
+ *
43
+ * * `SYSTEM_TRANSITION`: For events performed as a side effect, such as archiving existing model versions in a stage.
44
+ */
45
+ export var ActivityType;
46
+ (function (ActivityType) {
47
+ /** Indicates that the corresponding stage transition was applied by user. */
48
+ ActivityType["APPLIED_TRANSITION"] = "APPLIED_TRANSITION";
49
+ /** Corresponding stage transition was requested by user. */
50
+ ActivityType["REQUESTED_TRANSITION"] = "REQUESTED_TRANSITION";
51
+ /** User cancelled an existing request. */
52
+ ActivityType["CANCELLED_REQUEST"] = "CANCELLED_REQUEST";
53
+ /** Corresponding transition request was approved by user. */
54
+ ActivityType["APPROVED_REQUEST"] = "APPROVED_REQUEST";
55
+ /** Corresponding transition request was rejected by user. */
56
+ ActivityType["REJECTED_REQUEST"] = "REJECTED_REQUEST";
57
+ /** User posted a new comment */
58
+ ActivityType["NEW_COMMENT"] = "NEW_COMMENT";
59
+ /** Corresponding transition for events such as archiving existing model versions */
60
+ ActivityType["SYSTEM_TRANSITION"] = "SYSTEM_TRANSITION";
61
+ })(ActivityType || (ActivityType = {}));
62
+ /**
63
+ * The status of the model version. Valid values are:
64
+ * * `PENDING_REGISTRATION`: Request to register a new model version is pending as server performs background tasks.
65
+ *
66
+ * * `FAILED_REGISTRATION`: Request to register a new model version has failed.
67
+ *
68
+ * * `READY`: Model version is ready for use.
69
+ */
70
+ export var ModelVersionStatus;
71
+ (function (ModelVersionStatus) {
72
+ /** Request to register a new model version is pending as server performs background tasks. */
73
+ ModelVersionStatus["PENDING_REGISTRATION"] = "PENDING_REGISTRATION";
74
+ /** Request to register a new model version has failed. */
75
+ ModelVersionStatus["FAILED_REGISTRATION"] = "FAILED_REGISTRATION";
76
+ /** Model version is ready for use. */
77
+ ModelVersionStatus["READY"] = "READY";
78
+ })(ModelVersionStatus || (ModelVersionStatus = {}));
79
+ /** Permission level of the requesting user on the object. For what is allowed at each level, see [MLflow Model permissions](..). */
80
+ export var PermissionLevel;
81
+ (function (PermissionLevel) {
82
+ PermissionLevel["CAN_MANAGE"] = "CAN_MANAGE";
83
+ /** reserved 1; // IS_OWNER = 1; was DEPRECATED */
84
+ PermissionLevel["CAN_EDIT"] = "CAN_EDIT";
85
+ PermissionLevel["CAN_READ"] = "CAN_READ";
86
+ PermissionLevel["CAN_MANAGE_STAGING_VERSIONS"] = "CAN_MANAGE_STAGING_VERSIONS";
87
+ PermissionLevel["CAN_MANAGE_PRODUCTION_VERSIONS"] = "CAN_MANAGE_PRODUCTION_VERSIONS";
88
+ /**
89
+ * Only applicable to the root ACL path, for which it is the default value if no permissions are
90
+ * set explicitly for the user. It is the default set by the MLflow service and The ACL database
91
+ * does not understand this value.
92
+ */
93
+ PermissionLevel["CAN_CREATE_REGISTERED_MODEL"] = "CAN_CREATE_REGISTERED_MODEL";
94
+ })(PermissionLevel || (PermissionLevel = {}));
95
+ /**
96
+ * .. note::
97
+ * Experimental: This entity may change or be removed in a future release without warning.
98
+ * Email subscription types for registry notifications:
99
+ * - `ALL_EVENTS`: Subscribed to all events.
100
+ * - `DEFAULT`: Default subscription type.
101
+ * - `SUBSCRIBED`: Subscribed to notifications.
102
+ * - `UNSUBSCRIBED`: Not subscribed to notifications.
103
+ */
104
+ export var RegistryEmailSubscriptionType;
105
+ (function (RegistryEmailSubscriptionType) {
106
+ RegistryEmailSubscriptionType["ALL_EVENTS"] = "ALL_EVENTS";
107
+ RegistryEmailSubscriptionType["DEFAULT"] = "DEFAULT";
108
+ RegistryEmailSubscriptionType["SUBSCRIBED"] = "SUBSCRIBED";
109
+ RegistryEmailSubscriptionType["UNSUBSCRIBED"] = "UNSUBSCRIBED";
110
+ })(RegistryEmailSubscriptionType || (RegistryEmailSubscriptionType = {}));
111
+ export var RegistryWebhookEvent;
112
+ (function (RegistryWebhookEvent) {
113
+ RegistryWebhookEvent["MODEL_VERSION_CREATED"] = "MODEL_VERSION_CREATED";
114
+ RegistryWebhookEvent["MODEL_VERSION_TRANSITIONED_STAGE"] = "MODEL_VERSION_TRANSITIONED_STAGE";
115
+ RegistryWebhookEvent["TRANSITION_REQUEST_CREATED"] = "TRANSITION_REQUEST_CREATED";
116
+ RegistryWebhookEvent["COMMENT_CREATED"] = "COMMENT_CREATED";
117
+ RegistryWebhookEvent["REGISTERED_MODEL_CREATED"] = "REGISTERED_MODEL_CREATED";
118
+ RegistryWebhookEvent["MODEL_VERSION_TAG_SET"] = "MODEL_VERSION_TAG_SET";
119
+ RegistryWebhookEvent["MODEL_VERSION_TRANSITIONED_TO_STAGING"] = "MODEL_VERSION_TRANSITIONED_TO_STAGING";
120
+ RegistryWebhookEvent["MODEL_VERSION_TRANSITIONED_TO_PRODUCTION"] = "MODEL_VERSION_TRANSITIONED_TO_PRODUCTION";
121
+ RegistryWebhookEvent["MODEL_VERSION_TRANSITIONED_TO_ARCHIVED"] = "MODEL_VERSION_TRANSITIONED_TO_ARCHIVED";
122
+ RegistryWebhookEvent["TRANSITION_REQUEST_TO_STAGING_CREATED"] = "TRANSITION_REQUEST_TO_STAGING_CREATED";
123
+ RegistryWebhookEvent["TRANSITION_REQUEST_TO_PRODUCTION_CREATED"] = "TRANSITION_REQUEST_TO_PRODUCTION_CREATED";
124
+ RegistryWebhookEvent["TRANSITION_REQUEST_TO_ARCHIVED_CREATED"] = "TRANSITION_REQUEST_TO_ARCHIVED_CREATED";
125
+ })(RegistryWebhookEvent || (RegistryWebhookEvent = {}));
126
+ /**
127
+ * Enable or disable triggering the webhook, or put the webhook into test mode. The default is `ACTIVE`:
128
+ * * `ACTIVE`: Webhook is triggered when an associated event happens.
129
+ *
130
+ * * `DISABLED`: Webhook is not triggered.
131
+ *
132
+ * * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a real event.
133
+ */
134
+ export var RegistryWebhookStatus;
135
+ (function (RegistryWebhookStatus) {
136
+ /** Event and test triggers will be sent. */
137
+ RegistryWebhookStatus["ACTIVE"] = "ACTIVE";
138
+ /** No triggers will be sent. */
139
+ RegistryWebhookStatus["DISABLED"] = "DISABLED";
140
+ /** Test triggers will be sent, but not actual events. */
141
+ RegistryWebhookStatus["TEST_MODE"] = "TEST_MODE";
142
+ })(RegistryWebhookStatus || (RegistryWebhookStatus = {}));
143
+ export const unmarshalActivitySchema = z
144
+ .object({
145
+ creation_timestamp: z
146
+ .union([z.number(), z.bigint()])
147
+ .transform(v => BigInt(v))
148
+ .optional(),
149
+ user_id: z.string().optional(),
150
+ activity_type: z.enum(ActivityType).optional(),
151
+ comment: z.string().optional(),
152
+ last_updated_timestamp: z
153
+ .union([z.number(), z.bigint()])
154
+ .transform(v => BigInt(v))
155
+ .optional(),
156
+ from_stage: z.string().optional(),
157
+ to_stage: z.string().optional(),
158
+ system_comment: z.string().optional(),
159
+ available_actions: z.array(z.enum(ActivityAction)).optional(),
160
+ id: z.string().optional(),
161
+ })
162
+ .transform(d => ({
163
+ creationTimestamp: d.creation_timestamp,
164
+ userId: d.user_id,
165
+ activityType: d.activity_type,
166
+ comment: d.comment,
167
+ lastUpdatedTimestamp: d.last_updated_timestamp,
168
+ fromStage: d.from_stage,
169
+ toStage: d.to_stage,
170
+ systemComment: d.system_comment,
171
+ availableActions: d.available_actions,
172
+ id: d.id,
173
+ }));
174
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
175
+ export const unmarshalApproveTransitionRequest_ResponseSchema = z
176
+ .object({
177
+ activity: z.lazy(() => unmarshalActivitySchema).optional(),
178
+ })
179
+ .transform(d => ({
180
+ activity: d.activity,
181
+ }));
182
+ export const unmarshalCommentObjectSchema = z
183
+ .object({
184
+ creation_timestamp: z
185
+ .union([z.number(), z.bigint()])
186
+ .transform(v => BigInt(v))
187
+ .optional(),
188
+ user_id: z.string().optional(),
189
+ activity_type: z.enum(ActivityType).optional(),
190
+ comment: z.string().optional(),
191
+ last_updated_timestamp: z
192
+ .union([z.number(), z.bigint()])
193
+ .transform(v => BigInt(v))
194
+ .optional(),
195
+ from_stage: z.string().optional(),
196
+ to_stage: z.string().optional(),
197
+ system_comment: z.string().optional(),
198
+ available_actions: z.array(z.enum(ActivityAction)).optional(),
199
+ id: z.string().optional(),
200
+ })
201
+ .transform(d => ({
202
+ creationTimestamp: d.creation_timestamp,
203
+ userId: d.user_id,
204
+ activityType: d.activity_type,
205
+ comment: d.comment,
206
+ lastUpdatedTimestamp: d.last_updated_timestamp,
207
+ fromStage: d.from_stage,
208
+ toStage: d.to_stage,
209
+ systemComment: d.system_comment,
210
+ availableActions: d.available_actions,
211
+ id: d.id,
212
+ }));
213
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
214
+ export const unmarshalCreateCommentRequest_ResponseSchema = z
215
+ .object({
216
+ comment: z.lazy(() => unmarshalCommentObjectSchema).optional(),
217
+ })
218
+ .transform(d => ({
219
+ comment: d.comment,
220
+ }));
221
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
222
+ export const unmarshalCreateModelVersionRequest_ResponseSchema = z
223
+ .object({
224
+ model_version: z.lazy(() => unmarshalModelVersionSchema).optional(),
225
+ })
226
+ .transform(d => ({
227
+ modelVersion: d.model_version,
228
+ }));
229
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
230
+ export const unmarshalCreateRegisteredModelRequest_ResponseSchema = z
231
+ .object({
232
+ registered_model: z.lazy(() => unmarshalRegisteredModelSchema).optional(),
233
+ })
234
+ .transform(d => ({
235
+ registeredModel: d.registered_model,
236
+ }));
237
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
238
+ export const unmarshalCreateRegistryWebhookRequest_ResponseSchema = z
239
+ .object({
240
+ webhook: z.lazy(() => unmarshalRegistryWebhookSchema).optional(),
241
+ })
242
+ .transform(d => ({
243
+ webhook: d.webhook,
244
+ }));
245
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
246
+ export const unmarshalCreateTransitionRequest_ResponseSchema = z
247
+ .object({
248
+ request: z.lazy(() => unmarshalTransitionRequestSchema).optional(),
249
+ })
250
+ .transform(d => ({
251
+ request: d.request,
252
+ }));
253
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
254
+ export const unmarshalDeleteCommentRequest_ResponseSchema = z.object({});
255
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
256
+ export const unmarshalDeleteModelVersionRequest_ResponseSchema = z.object({});
257
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
258
+ export const unmarshalDeleteModelVersionTagRequest_ResponseSchema = z.object({});
259
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
260
+ export const unmarshalDeleteRegisteredModelRequest_ResponseSchema = z.object({});
261
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
262
+ export const unmarshalDeleteRegisteredModelTagRequest_ResponseSchema = z.object({});
263
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
264
+ export const unmarshalDeleteRegistryWebhookRequest_ResponseSchema = z.object({});
265
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
266
+ export const unmarshalDeleteTransitionRequest_ResponseSchema = z
267
+ .object({
268
+ activity: z.lazy(() => unmarshalActivitySchema).optional(),
269
+ })
270
+ .transform(d => ({
271
+ activity: d.activity,
272
+ }));
273
+ export const unmarshalFeatureListSchema = z
274
+ .object({
275
+ features: z.array(z.lazy(() => unmarshalLinkedFeatureSchema)).optional(),
276
+ })
277
+ .transform(d => ({
278
+ features: d.features,
279
+ }));
280
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
281
+ export const unmarshalGetModelVersionDownloadUriRequest_ResponseSchema = z
282
+ .object({
283
+ artifact_uri: z.string().optional(),
284
+ })
285
+ .transform(d => ({
286
+ artifactUri: d.artifact_uri,
287
+ }));
288
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
289
+ export const unmarshalGetModelVersionRequest_ResponseSchema = z
290
+ .object({
291
+ model_version: z.lazy(() => unmarshalModelVersionSchema).optional(),
292
+ })
293
+ .transform(d => ({
294
+ modelVersion: d.model_version,
295
+ }));
296
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
297
+ export const unmarshalGetRegisteredModelDatabricksRequest_ResponseSchema = z
298
+ .object({
299
+ registered_model_databricks: z
300
+ .lazy(() => unmarshalRegisteredModelDatabricksSchema)
301
+ .optional(),
302
+ })
303
+ .transform(d => ({
304
+ registeredModelDatabricks: d.registered_model_databricks,
305
+ }));
306
+ export const unmarshalHttpUrlSpecSchema = z
307
+ .object({
308
+ url: z.string().optional(),
309
+ enable_ssl_verification: z.boolean().optional(),
310
+ secret: z.string().optional(),
311
+ authorization: z.string().optional(),
312
+ })
313
+ .transform(d => ({
314
+ url: d.url,
315
+ enableSslVerification: d.enable_ssl_verification,
316
+ secret: d.secret,
317
+ authorization: d.authorization,
318
+ }));
319
+ export const unmarshalJobSpecSchema = z
320
+ .object({
321
+ job_id: z.string().optional(),
322
+ workspace_url: z.string().optional(),
323
+ access_token: z.string().optional(),
324
+ })
325
+ .transform(d => ({
326
+ jobId: d.job_id,
327
+ workspaceUrl: d.workspace_url,
328
+ accessToken: d.access_token,
329
+ }));
330
+ export const unmarshalLinkedFeatureSchema = z
331
+ .object({
332
+ feature_table_name: z.string().optional(),
333
+ feature_name: z.string().optional(),
334
+ feature_table_id: z.string().optional(),
335
+ })
336
+ .transform(d => ({
337
+ featureTableName: d.feature_table_name,
338
+ featureName: d.feature_name,
339
+ featureTableId: d.feature_table_id,
340
+ }));
341
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
342
+ export const unmarshalListLatestVersionsRequest_ResponseSchema = z
343
+ .object({
344
+ model_versions: z
345
+ .array(z.lazy(() => unmarshalModelVersionSchema))
346
+ .optional(),
347
+ })
348
+ .transform(d => ({
349
+ modelVersions: d.model_versions,
350
+ }));
351
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
352
+ export const unmarshalListRegisteredModelsRequest_ResponseSchema = z
353
+ .object({
354
+ registered_models: z
355
+ .array(z.lazy(() => unmarshalRegisteredModelSchema))
356
+ .optional(),
357
+ next_page_token: z.string().optional(),
358
+ })
359
+ .transform(d => ({
360
+ registeredModels: d.registered_models,
361
+ nextPageToken: d.next_page_token,
362
+ }));
363
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
364
+ export const unmarshalListRegistryWebhooksRequest_ResponseSchema = z
365
+ .object({
366
+ webhooks: z
367
+ .array(z.lazy(() => unmarshalRegistryWebhookSchema))
368
+ .optional(),
369
+ next_page_token: z.string().optional(),
370
+ })
371
+ .transform(d => ({
372
+ webhooks: d.webhooks,
373
+ nextPageToken: d.next_page_token,
374
+ }));
375
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
376
+ export const unmarshalListTransitionRequest_ResponseSchema = z
377
+ .object({
378
+ requests: z.array(z.lazy(() => unmarshalActivitySchema)).optional(),
379
+ })
380
+ .transform(d => ({
381
+ requests: d.requests,
382
+ }));
383
+ export const unmarshalModelVersionSchema = z
384
+ .object({
385
+ name: z.string().optional(),
386
+ version: z.string().optional(),
387
+ creation_timestamp: z
388
+ .union([z.number(), z.bigint()])
389
+ .transform(v => BigInt(v))
390
+ .optional(),
391
+ last_updated_timestamp: z
392
+ .union([z.number(), z.bigint()])
393
+ .transform(v => BigInt(v))
394
+ .optional(),
395
+ user_id: z.string().optional(),
396
+ current_stage: z.string().optional(),
397
+ description: z.string().optional(),
398
+ source: z.string().optional(),
399
+ run_id: z.string().optional(),
400
+ status: z.enum(ModelVersionStatus).optional(),
401
+ status_message: z.string().optional(),
402
+ tags: z.array(z.lazy(() => unmarshalModelVersionTagSchema)).optional(),
403
+ run_link: z.string().optional(),
404
+ })
405
+ .transform(d => ({
406
+ name: d.name,
407
+ version: d.version,
408
+ creationTimestamp: d.creation_timestamp,
409
+ lastUpdatedTimestamp: d.last_updated_timestamp,
410
+ userId: d.user_id,
411
+ currentStage: d.current_stage,
412
+ description: d.description,
413
+ source: d.source,
414
+ runId: d.run_id,
415
+ status: d.status,
416
+ statusMessage: d.status_message,
417
+ tags: d.tags,
418
+ runLink: d.run_link,
419
+ }));
420
+ export const unmarshalModelVersionDatabricksSchema = z
421
+ .object({
422
+ name: z.string().optional(),
423
+ version: z.string().optional(),
424
+ creation_timestamp: z
425
+ .union([z.number(), z.bigint()])
426
+ .transform(v => BigInt(v))
427
+ .optional(),
428
+ last_updated_timestamp: z
429
+ .union([z.number(), z.bigint()])
430
+ .transform(v => BigInt(v))
431
+ .optional(),
432
+ user_id: z.string().optional(),
433
+ current_stage: z.string().optional(),
434
+ description: z.string().optional(),
435
+ source: z.string().optional(),
436
+ run_id: z.string().optional(),
437
+ status: z.enum(ModelVersionStatus).optional(),
438
+ status_message: z.string().optional(),
439
+ open_requests: z.array(z.lazy(() => unmarshalActivitySchema)).optional(),
440
+ permission_level: z.enum(PermissionLevel).optional(),
441
+ tags: z.array(z.lazy(() => unmarshalModelVersionTagSchema)).optional(),
442
+ run_link: z.string().optional(),
443
+ email_subscription_status: z
444
+ .enum(RegistryEmailSubscriptionType)
445
+ .optional(),
446
+ feature_list: z.lazy(() => unmarshalFeatureListSchema).optional(),
447
+ })
448
+ .transform(d => ({
449
+ name: d.name,
450
+ version: d.version,
451
+ creationTimestamp: d.creation_timestamp,
452
+ lastUpdatedTimestamp: d.last_updated_timestamp,
453
+ userId: d.user_id,
454
+ currentStage: d.current_stage,
455
+ description: d.description,
456
+ source: d.source,
457
+ runId: d.run_id,
458
+ status: d.status,
459
+ statusMessage: d.status_message,
460
+ openRequests: d.open_requests,
461
+ permissionLevel: d.permission_level,
462
+ tags: d.tags,
463
+ runLink: d.run_link,
464
+ emailSubscriptionStatus: d.email_subscription_status,
465
+ featureList: d.feature_list,
466
+ }));
467
+ export const unmarshalModelVersionTagSchema = z
468
+ .object({
469
+ key: z.string().optional(),
470
+ value: z.string().optional(),
471
+ })
472
+ .transform(d => ({
473
+ key: d.key,
474
+ value: d.value,
475
+ }));
476
+ export const unmarshalRegisteredModelSchema = z
477
+ .object({
478
+ name: z.string().optional(),
479
+ creation_timestamp: z
480
+ .union([z.number(), z.bigint()])
481
+ .transform(v => BigInt(v))
482
+ .optional(),
483
+ last_updated_timestamp: z
484
+ .union([z.number(), z.bigint()])
485
+ .transform(v => BigInt(v))
486
+ .optional(),
487
+ user_id: z.string().optional(),
488
+ description: z.string().optional(),
489
+ latest_versions: z
490
+ .array(z.lazy(() => unmarshalModelVersionSchema))
491
+ .optional(),
492
+ tags: z.array(z.lazy(() => unmarshalRegisteredModelTagSchema)).optional(),
493
+ })
494
+ .transform(d => ({
495
+ name: d.name,
496
+ creationTimestamp: d.creation_timestamp,
497
+ lastUpdatedTimestamp: d.last_updated_timestamp,
498
+ userId: d.user_id,
499
+ description: d.description,
500
+ latestVersions: d.latest_versions,
501
+ tags: d.tags,
502
+ }));
503
+ export const unmarshalRegisteredModelDatabricksSchema = z
504
+ .object({
505
+ name: z.string().optional(),
506
+ creation_timestamp: z
507
+ .union([z.number(), z.bigint()])
508
+ .transform(v => BigInt(v))
509
+ .optional(),
510
+ last_updated_timestamp: z
511
+ .union([z.number(), z.bigint()])
512
+ .transform(v => BigInt(v))
513
+ .optional(),
514
+ user_id: z.string().optional(),
515
+ description: z.string().optional(),
516
+ latest_versions: z
517
+ .array(z.lazy(() => unmarshalModelVersionSchema))
518
+ .optional(),
519
+ id: z.string().optional(),
520
+ permission_level: z.enum(PermissionLevel).optional(),
521
+ tags: z.array(z.lazy(() => unmarshalRegisteredModelTagSchema)).optional(),
522
+ })
523
+ .transform(d => ({
524
+ name: d.name,
525
+ creationTimestamp: d.creation_timestamp,
526
+ lastUpdatedTimestamp: d.last_updated_timestamp,
527
+ userId: d.user_id,
528
+ description: d.description,
529
+ latestVersions: d.latest_versions,
530
+ id: d.id,
531
+ permissionLevel: d.permission_level,
532
+ tags: d.tags,
533
+ }));
534
+ export const unmarshalRegisteredModelTagSchema = z
535
+ .object({
536
+ key: z.string().optional(),
537
+ value: z.string().optional(),
538
+ })
539
+ .transform(d => ({
540
+ key: d.key,
541
+ value: d.value,
542
+ }));
543
+ export const unmarshalRegistryWebhookSchema = z
544
+ .object({
545
+ id: z.string().optional(),
546
+ events: z.array(z.enum(RegistryWebhookEvent)).optional(),
547
+ creation_timestamp: z
548
+ .union([z.number(), z.bigint()])
549
+ .transform(v => BigInt(v))
550
+ .optional(),
551
+ last_updated_timestamp: z
552
+ .union([z.number(), z.bigint()])
553
+ .transform(v => BigInt(v))
554
+ .optional(),
555
+ description: z.string().optional(),
556
+ status: z.enum(RegistryWebhookStatus).optional(),
557
+ http_url_spec: z.lazy(() => unmarshalHttpUrlSpecSchema).optional(),
558
+ job_spec: z.lazy(() => unmarshalJobSpecSchema).optional(),
559
+ model_name: z.string().optional(),
560
+ })
561
+ .transform(d => ({
562
+ id: d.id,
563
+ events: d.events,
564
+ creationTimestamp: d.creation_timestamp,
565
+ lastUpdatedTimestamp: d.last_updated_timestamp,
566
+ description: d.description,
567
+ status: d.status,
568
+ httpUrlSpec: d.http_url_spec,
569
+ jobSpec: d.job_spec,
570
+ modelName: d.model_name,
571
+ }));
572
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
573
+ export const unmarshalRejectTransitionRequest_ResponseSchema = z
574
+ .object({
575
+ activity: z.lazy(() => unmarshalActivitySchema).optional(),
576
+ })
577
+ .transform(d => ({
578
+ activity: d.activity,
579
+ }));
580
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
581
+ export const unmarshalRenameRegisteredModelRequest_ResponseSchema = z
582
+ .object({
583
+ registered_model: z.lazy(() => unmarshalRegisteredModelSchema).optional(),
584
+ })
585
+ .transform(d => ({
586
+ registeredModel: d.registered_model,
587
+ }));
588
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
589
+ export const unmarshalSearchModelVersionsRequest_ResponseSchema = z
590
+ .object({
591
+ model_versions: z
592
+ .array(z.lazy(() => unmarshalModelVersionSchema))
593
+ .optional(),
594
+ next_page_token: z.string().optional(),
595
+ })
596
+ .transform(d => ({
597
+ modelVersions: d.model_versions,
598
+ nextPageToken: d.next_page_token,
599
+ }));
600
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
601
+ export const unmarshalSearchRegisteredModelsRequest_ResponseSchema = z
602
+ .object({
603
+ registered_models: z
604
+ .array(z.lazy(() => unmarshalRegisteredModelSchema))
605
+ .optional(),
606
+ next_page_token: z.string().optional(),
607
+ })
608
+ .transform(d => ({
609
+ registeredModels: d.registered_models,
610
+ nextPageToken: d.next_page_token,
611
+ }));
612
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
613
+ export const unmarshalSetModelVersionTagRequest_ResponseSchema = z.object({});
614
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
615
+ export const unmarshalSetRegisteredModelTagRequest_ResponseSchema = z.object({});
616
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
617
+ export const unmarshalTestRegistryWebhookRequest_ResponseSchema = z
618
+ .object({
619
+ status_code: z.number().optional(),
620
+ body: z.string().optional(),
621
+ })
622
+ .transform(d => ({
623
+ statusCode: d.status_code,
624
+ body: d.body,
625
+ }));
626
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
627
+ export const unmarshalTransitionModelVersionStageDatabricksRequest_ResponseSchema = z
628
+ .object({
629
+ model_version_databricks: z
630
+ .lazy(() => unmarshalModelVersionDatabricksSchema)
631
+ .optional(),
632
+ })
633
+ .transform(d => ({
634
+ modelVersionDatabricks: d.model_version_databricks,
635
+ }));
636
+ export const unmarshalTransitionRequestSchema = z
637
+ .object({
638
+ creation_timestamp: z
639
+ .union([z.number(), z.bigint()])
640
+ .transform(v => BigInt(v))
641
+ .optional(),
642
+ user_id: z.string().optional(),
643
+ activity_type: z.enum(ActivityType).optional(),
644
+ comment: z.string().optional(),
645
+ last_updated_timestamp: z
646
+ .union([z.number(), z.bigint()])
647
+ .transform(v => BigInt(v))
648
+ .optional(),
649
+ from_stage: z.string().optional(),
650
+ to_stage: z.string().optional(),
651
+ system_comment: z.string().optional(),
652
+ available_actions: z.array(z.enum(ActivityAction)).optional(),
653
+ id: z.string().optional(),
654
+ })
655
+ .transform(d => ({
656
+ creationTimestamp: d.creation_timestamp,
657
+ userId: d.user_id,
658
+ activityType: d.activity_type,
659
+ comment: d.comment,
660
+ lastUpdatedTimestamp: d.last_updated_timestamp,
661
+ fromStage: d.from_stage,
662
+ toStage: d.to_stage,
663
+ systemComment: d.system_comment,
664
+ availableActions: d.available_actions,
665
+ id: d.id,
666
+ }));
667
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
668
+ export const unmarshalUpdateCommentRequest_ResponseSchema = z
669
+ .object({
670
+ comment: z.lazy(() => unmarshalCommentObjectSchema).optional(),
671
+ })
672
+ .transform(d => ({
673
+ comment: d.comment,
674
+ }));
675
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
676
+ export const unmarshalUpdateModelVersionRequest_ResponseSchema = z
677
+ .object({
678
+ model_version: z.lazy(() => unmarshalModelVersionSchema).optional(),
679
+ })
680
+ .transform(d => ({
681
+ modelVersion: d.model_version,
682
+ }));
683
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
684
+ export const unmarshalUpdateRegisteredModelRequest_ResponseSchema = z
685
+ .object({
686
+ registered_model: z.lazy(() => unmarshalRegisteredModelSchema).optional(),
687
+ })
688
+ .transform(d => ({
689
+ registeredModel: d.registered_model,
690
+ }));
691
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
692
+ export const unmarshalUpdateRegistryWebhookRequest_ResponseSchema = z
693
+ .object({
694
+ webhook: z.lazy(() => unmarshalRegistryWebhookSchema).optional(),
695
+ })
696
+ .transform(d => ({
697
+ webhook: d.webhook,
698
+ }));
699
+ export const marshalApproveTransitionRequestSchema = z
700
+ .object({
701
+ name: z.string().optional(),
702
+ version: z.string().optional(),
703
+ stage: z.string().optional(),
704
+ archiveExistingVersions: z.boolean().optional(),
705
+ comment: z.string().optional(),
706
+ })
707
+ .transform(d => ({
708
+ name: d.name,
709
+ version: d.version,
710
+ stage: d.stage,
711
+ archive_existing_versions: d.archiveExistingVersions,
712
+ comment: d.comment,
713
+ }));
714
+ export const marshalCreateCommentRequestSchema = z
715
+ .object({
716
+ name: z.string().optional(),
717
+ version: z.string().optional(),
718
+ comment: z.string().optional(),
719
+ })
720
+ .transform(d => ({
721
+ name: d.name,
722
+ version: d.version,
723
+ comment: d.comment,
724
+ }));
725
+ export const marshalCreateModelVersionRequestSchema = z
726
+ .object({
727
+ name: z.string().optional(),
728
+ source: z.string().optional(),
729
+ runId: z.string().optional(),
730
+ tags: z.array(z.lazy(() => marshalModelVersionTagSchema)).optional(),
731
+ runLink: z.string().optional(),
732
+ description: z.string().optional(),
733
+ })
734
+ .transform(d => ({
735
+ name: d.name,
736
+ source: d.source,
737
+ run_id: d.runId,
738
+ tags: d.tags,
739
+ run_link: d.runLink,
740
+ description: d.description,
741
+ }));
742
+ export const marshalCreateRegisteredModelRequestSchema = z
743
+ .object({
744
+ name: z.string().optional(),
745
+ tags: z.array(z.lazy(() => marshalRegisteredModelTagSchema)).optional(),
746
+ description: z.string().optional(),
747
+ })
748
+ .transform(d => ({
749
+ name: d.name,
750
+ tags: d.tags,
751
+ description: d.description,
752
+ }));
753
+ export const marshalCreateRegistryWebhookRequestSchema = z
754
+ .object({
755
+ modelName: z.string().optional(),
756
+ events: z.array(z.enum(RegistryWebhookEvent)).optional(),
757
+ description: z.string().optional(),
758
+ status: z.enum(RegistryWebhookStatus).optional(),
759
+ httpUrlSpec: z.lazy(() => marshalHttpUrlSpecSchema).optional(),
760
+ jobSpec: z.lazy(() => marshalJobSpecSchema).optional(),
761
+ })
762
+ .transform(d => ({
763
+ model_name: d.modelName,
764
+ events: d.events,
765
+ description: d.description,
766
+ status: d.status,
767
+ http_url_spec: d.httpUrlSpec,
768
+ job_spec: d.jobSpec,
769
+ }));
770
+ export const marshalCreateTransitionRequestSchema = z
771
+ .object({
772
+ name: z.string().optional(),
773
+ version: z.string().optional(),
774
+ stage: z.string().optional(),
775
+ comment: z.string().optional(),
776
+ })
777
+ .transform(d => ({
778
+ name: d.name,
779
+ version: d.version,
780
+ stage: d.stage,
781
+ comment: d.comment,
782
+ }));
783
+ export const marshalHttpUrlSpecSchema = z
784
+ .object({
785
+ url: z.string().optional(),
786
+ enableSslVerification: z.boolean().optional(),
787
+ secret: z.string().optional(),
788
+ authorization: z.string().optional(),
789
+ })
790
+ .transform(d => ({
791
+ url: d.url,
792
+ enable_ssl_verification: d.enableSslVerification,
793
+ secret: d.secret,
794
+ authorization: d.authorization,
795
+ }));
796
+ export const marshalJobSpecSchema = z
797
+ .object({
798
+ jobId: z.string().optional(),
799
+ workspaceUrl: z.string().optional(),
800
+ accessToken: z.string().optional(),
801
+ })
802
+ .transform(d => ({
803
+ job_id: d.jobId,
804
+ workspace_url: d.workspaceUrl,
805
+ access_token: d.accessToken,
806
+ }));
807
+ export const marshalListLatestVersionsRequestSchema = z
808
+ .object({
809
+ name: z.string().optional(),
810
+ stages: z.array(z.string()).optional(),
811
+ })
812
+ .transform(d => ({
813
+ name: d.name,
814
+ stages: d.stages,
815
+ }));
816
+ export const marshalModelVersionTagSchema = z
817
+ .object({
818
+ key: z.string().optional(),
819
+ value: z.string().optional(),
820
+ })
821
+ .transform(d => ({
822
+ key: d.key,
823
+ value: d.value,
824
+ }));
825
+ export const marshalRegisteredModelTagSchema = z
826
+ .object({
827
+ key: z.string().optional(),
828
+ value: z.string().optional(),
829
+ })
830
+ .transform(d => ({
831
+ key: d.key,
832
+ value: d.value,
833
+ }));
834
+ export const marshalRejectTransitionRequestSchema = z
835
+ .object({
836
+ name: z.string().optional(),
837
+ version: z.string().optional(),
838
+ stage: z.string().optional(),
839
+ comment: z.string().optional(),
840
+ })
841
+ .transform(d => ({
842
+ name: d.name,
843
+ version: d.version,
844
+ stage: d.stage,
845
+ comment: d.comment,
846
+ }));
847
+ export const marshalRenameRegisteredModelRequestSchema = z
848
+ .object({
849
+ name: z.string().optional(),
850
+ newName: z.string().optional(),
851
+ })
852
+ .transform(d => ({
853
+ name: d.name,
854
+ new_name: d.newName,
855
+ }));
856
+ export const marshalSetModelVersionTagRequestSchema = z
857
+ .object({
858
+ name: z.string().optional(),
859
+ version: z.string().optional(),
860
+ key: z.string().optional(),
861
+ value: z.string().optional(),
862
+ })
863
+ .transform(d => ({
864
+ name: d.name,
865
+ version: d.version,
866
+ key: d.key,
867
+ value: d.value,
868
+ }));
869
+ export const marshalSetRegisteredModelTagRequestSchema = z
870
+ .object({
871
+ name: z.string().optional(),
872
+ key: z.string().optional(),
873
+ value: z.string().optional(),
874
+ })
875
+ .transform(d => ({
876
+ name: d.name,
877
+ key: d.key,
878
+ value: d.value,
879
+ }));
880
+ export const marshalTestRegistryWebhookRequestSchema = z
881
+ .object({
882
+ id: z.string().optional(),
883
+ event: z.enum(RegistryWebhookEvent).optional(),
884
+ })
885
+ .transform(d => ({
886
+ id: d.id,
887
+ event: d.event,
888
+ }));
889
+ export const marshalTransitionModelVersionStageDatabricksRequestSchema = z
890
+ .object({
891
+ name: z.string().optional(),
892
+ version: z.string().optional(),
893
+ stage: z.string().optional(),
894
+ archiveExistingVersions: z.boolean().optional(),
895
+ comment: z.string().optional(),
896
+ })
897
+ .transform(d => ({
898
+ name: d.name,
899
+ version: d.version,
900
+ stage: d.stage,
901
+ archive_existing_versions: d.archiveExistingVersions,
902
+ comment: d.comment,
903
+ }));
904
+ export const marshalUpdateCommentRequestSchema = z
905
+ .object({
906
+ id: z.string().optional(),
907
+ comment: z.string().optional(),
908
+ })
909
+ .transform(d => ({
910
+ id: d.id,
911
+ comment: d.comment,
912
+ }));
913
+ export const marshalUpdateModelVersionRequestSchema = z
914
+ .object({
915
+ name: z.string().optional(),
916
+ version: z.string().optional(),
917
+ description: z.string().optional(),
918
+ })
919
+ .transform(d => ({
920
+ name: d.name,
921
+ version: d.version,
922
+ description: d.description,
923
+ }));
924
+ export const marshalUpdateRegisteredModelRequestSchema = z
925
+ .object({
926
+ name: z.string().optional(),
927
+ description: z.string().optional(),
928
+ })
929
+ .transform(d => ({
930
+ name: d.name,
931
+ description: d.description,
932
+ }));
933
+ export const marshalUpdateRegistryWebhookRequestSchema = z
934
+ .object({
935
+ id: z.string().optional(),
936
+ events: z.array(z.enum(RegistryWebhookEvent)).optional(),
937
+ description: z.string().optional(),
938
+ status: z.enum(RegistryWebhookStatus).optional(),
939
+ httpUrlSpec: z.lazy(() => marshalHttpUrlSpecSchema).optional(),
940
+ jobSpec: z.lazy(() => marshalJobSpecSchema).optional(),
941
+ })
942
+ .transform(d => ({
943
+ id: d.id,
944
+ events: d.events,
945
+ description: d.description,
946
+ status: d.status,
947
+ http_url_spec: d.httpUrlSpec,
948
+ job_spec: d.jobSpec,
949
+ }));
950
+ //# sourceMappingURL=model.js.map