@databricks/sdk-lakeview 0.1.0-dev.3 → 0.1.0-dev.5

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,881 +0,0 @@
1
- // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
-
3
- import {Temporal} from '@js-temporal/polyfill';
4
- import {z} from 'zod';
5
-
6
- export enum DashboardView {
7
- /** Includes summary metadata from the dashboard. */
8
- DASHBOARD_VIEW_BASIC = 'DASHBOARD_VIEW_BASIC',
9
- }
10
-
11
- export enum LifecycleState {
12
- /** The dashboard is in an active state (not-trashed). */
13
- ACTIVE = 'ACTIVE',
14
- /** The dashboard is in a trashed state. */
15
- TRASHED = 'TRASHED',
16
- }
17
-
18
- export enum SchedulePauseStatus {
19
- UNPAUSED = 'UNPAUSED',
20
- PAUSED = 'PAUSED',
21
- }
22
-
23
- export interface AuthorizationDetails {
24
- /**
25
- * The type of authorization downscoping policy.
26
- * Ex: `workspace_rule_set` defines access rules for a specific workspace resource
27
- */
28
- type?: string | undefined;
29
- /**
30
- * The resource name to which the authorization rule applies.
31
- * This field is specific to `workspace_rule_set` constraint.
32
- * Format: `workspaces/{workspace_id}/dashboards/{dashboard_id}`
33
- */
34
- resourceName?: string | undefined;
35
- /** The acl path of the tree store resource resource. */
36
- resourceLegacyAclPath?: string | undefined;
37
- /**
38
- * Represents downscoped permission rules with specific access rights.
39
- * This field is specific to `workspace_rule_set` constraint.
40
- */
41
- grantRules?: AuthorizationDetails_GrantRule[] | undefined;
42
- }
43
-
44
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
45
- export interface AuthorizationDetails_GrantRule {
46
- /**
47
- * Permission sets for dashboard are defined in
48
- * iam-common/rbac-common/permission-sets/definitions/TreeStoreBasePermissionSets
49
- * Ex: `permissionSets/dashboard.runner`
50
- */
51
- permissionSet?: string | undefined;
52
- }
53
-
54
- export interface CreateDashboardRequest {
55
- dashboard?: Dashboard | undefined;
56
- /**
57
- * Sets the default catalog for all datasets in this dashboard.
58
- * Does not impact table references that use fully qualified catalog names (ex: samples.nyctaxi.trips).
59
- * Leave blank to keep each dataset’s existing configuration.
60
- */
61
- datasetCatalog?: string | undefined;
62
- /**
63
- * Sets the default schema for all datasets in this dashboard.
64
- * Does not impact table references that use fully qualified schema names (ex: nyctaxi.trips).
65
- * Leave blank to keep each dataset’s existing configuration.
66
- */
67
- datasetSchema?: string | undefined;
68
- }
69
-
70
- export interface CreateScheduleRequest {
71
- /** The schedule to create. A dashboard is limited to 10 schedules. */
72
- schedule?: Schedule | undefined;
73
- }
74
-
75
- export interface CreateSubscriptionRequest {
76
- /** The subscription to create. A schedule is limited to 100 subscriptions. */
77
- subscription?: Subscription | undefined;
78
- }
79
-
80
- export interface CronSchedule {
81
- /**
82
- * A cron expression using quartz syntax. EX: `0 0 8 * * ?` represents everyday at 8am.
83
- * See [Cron Trigger](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html) for details.
84
- */
85
- quartzCronExpression?: string | undefined;
86
- /**
87
- * A Java timezone id. The schedule will be resolved with respect to this timezone.
88
- * See [Java TimeZone](https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html) for details.
89
- */
90
- timezoneId?: string | undefined;
91
- }
92
-
93
- export interface Dashboard {
94
- /** UUID identifying the dashboard. */
95
- dashboardId?: string | undefined;
96
- /** The display name of the dashboard. */
97
- displayName?: string | undefined;
98
- /**
99
- * The workspace path of the dashboard asset, including the file name.
100
- * Exported dashboards always have the file extension `.lvdash.json`.
101
- * This field is excluded in List Dashboards responses.
102
- */
103
- path?: string | undefined;
104
- /** The timestamp of when the dashboard was created. */
105
- createTime?: Temporal.Instant | undefined;
106
- /**
107
- * The timestamp of when the dashboard was last updated by the user.
108
- * This field is excluded in List Dashboards responses.
109
- */
110
- updateTime?: Temporal.Instant | undefined;
111
- /** The warehouse ID used to run the dashboard. */
112
- warehouseId?: string | undefined;
113
- /**
114
- * The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard
115
- * has not been modified since the last read.
116
- * This field is excluded in List Dashboards responses.
117
- */
118
- etag?: string | undefined;
119
- /**
120
- * The contents of the dashboard in serialized string form.
121
- * This field is excluded in List Dashboards responses.
122
- * Use the [get dashboard API](https://docs.databricks.com/api/workspace/lakeview/get)
123
- * to retrieve an example response, which includes the `serialized_dashboard` field.
124
- * This field provides the structure of the JSON string that represents the dashboard's
125
- * layout and components.
126
- */
127
- serializedDashboard?: string | undefined;
128
- /** The state of the dashboard resource. Used for tracking trashed status. */
129
- lifecycleState?: LifecycleState | undefined;
130
- /**
131
- * The workspace path of the folder containing the dashboard. Includes leading slash and no
132
- * trailing slash.
133
- * This field is excluded in List Dashboards responses.
134
- */
135
- parentPath?: string | undefined;
136
- }
137
-
138
- export interface DeleteScheduleRequest {
139
- /** UUID identifying the schedule. */
140
- scheduleId?: string | undefined;
141
- /** UUID identifying the dashboard to which the schedule belongs. */
142
- dashboardId?: string | undefined;
143
- /**
144
- * The etag for the schedule. Optionally, it can be provided to verify that the schedule has not
145
- * been modified from its last retrieval.
146
- */
147
- etag?: string | undefined;
148
- }
149
-
150
- export interface DeleteSubscriptionRequest {
151
- /** UUID identifying the subscription. */
152
- subscriptionId?: string | undefined;
153
- /** UUID identifying the schedule which the subscription belongs. */
154
- scheduleId?: string | undefined;
155
- /** UUID identifying the dashboard which the subscription belongs. */
156
- dashboardId?: string | undefined;
157
- /**
158
- * The etag for the subscription. Can be optionally provided to ensure that the subscription has not been
159
- * modified since the last read.
160
- */
161
- etag?: string | undefined;
162
- }
163
-
164
- export interface GetDashboardRequest {
165
- /** UUID identifying the dashboard. */
166
- dashboardId?: string | undefined;
167
- }
168
-
169
- export interface GetPublishedDashboardRequest {
170
- /** UUID identifying the published dashboard. */
171
- dashboardId?: string | undefined;
172
- }
173
-
174
- export interface GetPublishedDashboardTokenInfoRequest {
175
- /** UUID identifying the published dashboard. */
176
- dashboardId?: string | undefined;
177
- /** Provided external value to be included in the custom claim. */
178
- externalValue?: string | undefined;
179
- /** Provided external viewer id to be included in the custom claim. */
180
- externalViewerId?: string | undefined;
181
- }
182
-
183
- export interface GetPublishedDashboardTokenInfoResponse {
184
- /**
185
- * Custom claim generated from external_value and external_viewer_id.
186
- * Format: `urn:aibi:external_data:<external_value>:<external_viewer_id>:<dashboard_id>`
187
- */
188
- customClaim?: string | undefined;
189
- /** Scope defining access permissions. */
190
- scope?: string | undefined;
191
- /**
192
- * Authorization constraints for accessing the published dashboard.
193
- * Currently includes `workspace_rule_set` and could be enriched with `unity_catalog_privileges` before
194
- * oAuth token generation.
195
- */
196
- authorizationDetails?: AuthorizationDetails[] | undefined;
197
- }
198
-
199
- export interface GetScheduleRequest {
200
- /** UUID identifying the schedule. */
201
- scheduleId?: string | undefined;
202
- /** UUID identifying the dashboard to which the schedule belongs. */
203
- dashboardId?: string | undefined;
204
- }
205
-
206
- export interface GetSubscriptionRequest {
207
- /** UUID identifying the subscription. */
208
- subscriptionId?: string | undefined;
209
- /** UUID identifying the schedule which the subscription belongs. */
210
- scheduleId?: string | undefined;
211
- /** UUID identifying the dashboard which the subscription belongs. */
212
- dashboardId?: string | undefined;
213
- }
214
-
215
- export interface ListDashboardsRequest {
216
- /** The number of dashboards to return per page. */
217
- pageSize?: number | undefined;
218
- /**
219
- * A page token, received from a previous `ListDashboards` call.
220
- * This token can be used to retrieve the subsequent page.
221
- */
222
- pageToken?: string | undefined;
223
- /**
224
- * The flag to include dashboards located in the trash.
225
- * If unspecified, only active dashboards will be returned.
226
- */
227
- showTrashed?: boolean | undefined;
228
- /** `DASHBOARD_VIEW_BASIC`only includes summary metadata from the dashboard. */
229
- view?: DashboardView | undefined;
230
- }
231
-
232
- export interface ListDashboardsResponse {
233
- dashboards?: Dashboard[] | undefined;
234
- /**
235
- * A token, which can be sent as `page_token` to retrieve the next page.
236
- * If this field is omitted, there are no subsequent dashboards.
237
- */
238
- nextPageToken?: string | undefined;
239
- }
240
-
241
- export interface ListSchedulesRequest {
242
- /** UUID identifying the dashboard to which the schedules belongs. */
243
- dashboardId?: string | undefined;
244
- /** The number of schedules to return per page. */
245
- pageSize?: number | undefined;
246
- /**
247
- * A page token, received from a previous `ListSchedules` call.
248
- * Use this to retrieve the subsequent page.
249
- */
250
- pageToken?: string | undefined;
251
- }
252
-
253
- export interface ListSchedulesResponse {
254
- schedules?: Schedule[] | undefined;
255
- /**
256
- * A token that can be used as a `page_token` in subsequent requests to retrieve the next page of results.
257
- * If this field is omitted, there are no subsequent schedules.
258
- */
259
- nextPageToken?: string | undefined;
260
- }
261
-
262
- export interface ListSubscriptionsRequest {
263
- /** UUID identifying the dashboard which the subscriptions belongs. */
264
- dashboardId?: string | undefined;
265
- /** UUID identifying the schedule which the subscriptions belongs. */
266
- scheduleId?: string | undefined;
267
- /** The number of subscriptions to return per page. */
268
- pageSize?: number | undefined;
269
- /**
270
- * A page token, received from a previous `ListSubscriptions` call.
271
- * Use this to retrieve the subsequent page.
272
- */
273
- pageToken?: string | undefined;
274
- }
275
-
276
- export interface ListSubscriptionsResponse {
277
- subscriptions?: Subscription[] | undefined;
278
- /**
279
- * A token that can be used as a `page_token` in subsequent requests to retrieve the next page of results.
280
- * If this field is omitted, there are no subsequent subscriptions.
281
- */
282
- nextPageToken?: string | undefined;
283
- }
284
-
285
- export interface MigrateDashboardRequest {
286
- /** UUID of the dashboard to be migrated. */
287
- sourceDashboardId?: string | undefined;
288
- /** Display name for the new Lakeview dashboard. */
289
- displayName?: string | undefined;
290
- /** The workspace path of the folder to contain the migrated Lakeview dashboard. */
291
- parentPath?: string | undefined;
292
- /**
293
- * Flag to indicate if mustache parameter syntax ({{ param }}) should be auto-updated
294
- * to named syntax (:param) when converting datasets in the dashboard.
295
- */
296
- updateParameterSyntax?: boolean | undefined;
297
- }
298
-
299
- export interface PublishDashboardRequest {
300
- /** UUID identifying the dashboard to be published. */
301
- dashboardId?: string | undefined;
302
- /**
303
- * Flag to indicate if the publisher's credentials should be embedded in the
304
- * published dashboard. These embedded credentials will be used to execute the
305
- * published dashboard's queries.
306
- */
307
- embedCredentials?: boolean | undefined;
308
- /**
309
- * The ID of the warehouse that can be used to override the warehouse which
310
- * was set in the draft.
311
- */
312
- warehouseId?: string | undefined;
313
- }
314
-
315
- export interface PublishedDashboard {
316
- /** The display name of the published dashboard. */
317
- displayName?: string | undefined;
318
- /** The warehouse ID used to run the published dashboard. */
319
- warehouseId?: string | undefined;
320
- /** Indicates whether credentials are embedded in the published dashboard. */
321
- embedCredentials?: boolean | undefined;
322
- /** The timestamp of when the published dashboard was last revised. */
323
- revisionCreateTime?: Temporal.Instant | undefined;
324
- }
325
-
326
- /** Request to revert a dashboard draft to its last published state. */
327
- export interface RevertDashboardRequest {
328
- /** UUID identifying the dashboard. */
329
- dashboardId?: string | undefined;
330
- /**
331
- * The etag for the dashboard. Optionally, it can be provided to verify that the dashboard
332
- * has not been modified from its last retrieval.
333
- * TODO(TSE-3937): update to new non-CMK-encrypted label when available
334
- */
335
- etag?: string | undefined;
336
- }
337
-
338
- /** Response to revert a dashboard draft to its last published state. */
339
- export interface RevertDashboardResponse {
340
- /** The reverted dashboard. */
341
- dashboard?: Dashboard | undefined;
342
- }
343
-
344
- export interface Schedule {
345
- /** UUID identifying the schedule. */
346
- scheduleId?: string | undefined;
347
- /** UUID identifying the dashboard to which the schedule belongs. */
348
- dashboardId?: string | undefined;
349
- /** The cron expression describing the frequency of the periodic refresh for this schedule. */
350
- cronSchedule?: CronSchedule | undefined;
351
- /** The status indicates whether this schedule is paused or not. */
352
- pauseStatus?: SchedulePauseStatus | undefined;
353
- /** The display name for schedule. */
354
- displayName?: string | undefined;
355
- /**
356
- * The etag for the schedule. Must be left empty on create, must be provided on updates to ensure
357
- * that the schedule has not been modified since the last read, and can be optionally provided on delete.
358
- */
359
- etag?: string | undefined;
360
- /** A timestamp indicating when the schedule was created. */
361
- createTime?: Temporal.Instant | undefined;
362
- /** A timestamp indicating when the schedule was last updated. */
363
- updateTime?: Temporal.Instant | undefined;
364
- /** The warehouse id to run the dashboard with for the schedule. */
365
- warehouseId?: string | undefined;
366
- }
367
-
368
- export interface Subscription {
369
- /** UUID identifying the subscription. */
370
- subscriptionId?: string | undefined;
371
- /** UUID identifying the schedule to which the subscription belongs. */
372
- scheduleId?: string | undefined;
373
- /** UUID identifying the dashboard to which the subscription belongs. */
374
- dashboardId?: string | undefined;
375
- /** Subscriber details for users and destinations to be added as subscribers to the schedule. */
376
- subscriber?: Subscription_Subscriber | undefined;
377
- /** UserId of the user who adds subscribers (users or notification destinations) to the dashboard's schedule. */
378
- createdByUserId?: bigint | undefined;
379
- /**
380
- * The etag for the subscription. Must be left empty on create, can be optionally provided on delete
381
- * to ensure that the subscription has not been deleted since the last read.
382
- */
383
- etag?: string | undefined;
384
- /** A timestamp indicating when the subscription was created. */
385
- createTime?: Temporal.Instant | undefined;
386
- /** A timestamp indicating when the subscription was last updated. */
387
- updateTime?: Temporal.Instant | undefined;
388
- /**
389
- * Controls whether notifications are sent to the subscriber for scheduled dashboard refreshes.
390
- * If not defined, defaults to false in the backend to match the current behavior (refresh and notify)
391
- */
392
- skipNotify?: boolean | undefined;
393
- }
394
-
395
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
396
- export interface Subscription_Subscriber {
397
- /**
398
- * The user to receive the subscription email.
399
- * This parameter is mutually exclusive with `destination_subscriber`.
400
- */
401
- userSubscriber?: Subscription_Subscriber_User | undefined;
402
- /**
403
- * The destination to receive the subscription email.
404
- * This parameter is mutually exclusive with `user_subscriber`.
405
- */
406
- destinationSubscriber?: Subscription_Subscriber_Destination | undefined;
407
- }
408
-
409
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
410
- export interface Subscription_Subscriber_Destination {
411
- /** The canonical identifier of the destination to receive email notification. */
412
- destinationId?: string | undefined;
413
- }
414
-
415
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
416
- export interface Subscription_Subscriber_User {
417
- /** UserId of the subscriber. */
418
- userId?: bigint | undefined;
419
- }
420
-
421
- export interface TrashDashboardRequest {
422
- /** UUID identifying the dashboard. */
423
- dashboardId?: string | undefined;
424
- }
425
-
426
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
427
- export interface TrashDashboardResponse {}
428
-
429
- export interface UnpublishDashboardRequest {
430
- /** UUID identifying the published dashboard. */
431
- dashboardId?: string | undefined;
432
- }
433
-
434
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
435
- export interface UnpublishDashboardResponse {}
436
-
437
- export interface UpdateDashboardRequest {
438
- dashboard?: Dashboard | undefined;
439
- /**
440
- * Sets the default catalog for all datasets in this dashboard.
441
- * Does not impact table references that use fully qualified catalog names (ex: samples.nyctaxi.trips).
442
- * Leave blank to keep each dataset’s existing configuration.
443
- */
444
- datasetCatalog?: string | undefined;
445
- /**
446
- * Sets the default schema for all datasets in this dashboard.
447
- * Does not impact table references that use fully qualified schema names (ex: nyctaxi.trips).
448
- * Leave blank to keep each dataset’s existing configuration.
449
- */
450
- datasetSchema?: string | undefined;
451
- }
452
-
453
- export interface UpdateScheduleRequest {
454
- /** The schedule to update. */
455
- schedule?: Schedule | undefined;
456
- }
457
-
458
- export const unmarshalAuthorizationDetailsSchema: z.ZodType<AuthorizationDetails> =
459
- z
460
- .object({
461
- type: z.string().optional(),
462
- resource_name: z.string().optional(),
463
- resource_legacy_acl_path: z.string().optional(),
464
- grant_rules: z
465
- .array(z.lazy(() => unmarshalAuthorizationDetails_GrantRuleSchema))
466
- .optional(),
467
- })
468
- .transform(d => ({
469
- type: d.type,
470
- resourceName: d.resource_name,
471
- resourceLegacyAclPath: d.resource_legacy_acl_path,
472
- grantRules: d.grant_rules,
473
- }));
474
-
475
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
476
- export const unmarshalAuthorizationDetails_GrantRuleSchema: z.ZodType<AuthorizationDetails_GrantRule> =
477
- z
478
- .object({
479
- permission_set: z.string().optional(),
480
- })
481
- .transform(d => ({
482
- permissionSet: d.permission_set,
483
- }));
484
-
485
- export const unmarshalCronScheduleSchema: z.ZodType<CronSchedule> = z
486
- .object({
487
- quartz_cron_expression: z.string().optional(),
488
- timezone_id: z.string().optional(),
489
- })
490
- .transform(d => ({
491
- quartzCronExpression: d.quartz_cron_expression,
492
- timezoneId: d.timezone_id,
493
- }));
494
-
495
- export const unmarshalDashboardSchema: z.ZodType<Dashboard> = z
496
- .object({
497
- dashboard_id: z.string().optional(),
498
- display_name: z.string().optional(),
499
- path: z.string().optional(),
500
- create_time: z
501
- .string()
502
- .transform(s => Temporal.Instant.from(s))
503
- .optional(),
504
- update_time: z
505
- .string()
506
- .transform(s => Temporal.Instant.from(s))
507
- .optional(),
508
- warehouse_id: z.string().optional(),
509
- etag: z.string().optional(),
510
- serialized_dashboard: z.string().optional(),
511
- lifecycle_state: z.enum(LifecycleState).optional(),
512
- parent_path: z.string().optional(),
513
- })
514
- .transform(d => ({
515
- dashboardId: d.dashboard_id,
516
- displayName: d.display_name,
517
- path: d.path,
518
- createTime: d.create_time,
519
- updateTime: d.update_time,
520
- warehouseId: d.warehouse_id,
521
- etag: d.etag,
522
- serializedDashboard: d.serialized_dashboard,
523
- lifecycleState: d.lifecycle_state,
524
- parentPath: d.parent_path,
525
- }));
526
-
527
- export const unmarshalGetPublishedDashboardTokenInfoResponseSchema: z.ZodType<GetPublishedDashboardTokenInfoResponse> =
528
- z
529
- .object({
530
- custom_claim: z.string().optional(),
531
- scope: z.string().optional(),
532
- authorization_details: z
533
- .array(z.lazy(() => unmarshalAuthorizationDetailsSchema))
534
- .optional(),
535
- })
536
- .transform(d => ({
537
- customClaim: d.custom_claim,
538
- scope: d.scope,
539
- authorizationDetails: d.authorization_details,
540
- }));
541
-
542
- export const unmarshalListDashboardsResponseSchema: z.ZodType<ListDashboardsResponse> =
543
- z
544
- .object({
545
- dashboards: z.array(z.lazy(() => unmarshalDashboardSchema)).optional(),
546
- next_page_token: z.string().optional(),
547
- })
548
- .transform(d => ({
549
- dashboards: d.dashboards,
550
- nextPageToken: d.next_page_token,
551
- }));
552
-
553
- export const unmarshalListSchedulesResponseSchema: z.ZodType<ListSchedulesResponse> =
554
- z
555
- .object({
556
- schedules: z.array(z.lazy(() => unmarshalScheduleSchema)).optional(),
557
- next_page_token: z.string().optional(),
558
- })
559
- .transform(d => ({
560
- schedules: d.schedules,
561
- nextPageToken: d.next_page_token,
562
- }));
563
-
564
- export const unmarshalListSubscriptionsResponseSchema: z.ZodType<ListSubscriptionsResponse> =
565
- z
566
- .object({
567
- subscriptions: z
568
- .array(z.lazy(() => unmarshalSubscriptionSchema))
569
- .optional(),
570
- next_page_token: z.string().optional(),
571
- })
572
- .transform(d => ({
573
- subscriptions: d.subscriptions,
574
- nextPageToken: d.next_page_token,
575
- }));
576
-
577
- export const unmarshalPublishedDashboardSchema: z.ZodType<PublishedDashboard> =
578
- z
579
- .object({
580
- display_name: z.string().optional(),
581
- warehouse_id: z.string().optional(),
582
- embed_credentials: z.boolean().optional(),
583
- revision_create_time: z
584
- .string()
585
- .transform(s => Temporal.Instant.from(s))
586
- .optional(),
587
- })
588
- .transform(d => ({
589
- displayName: d.display_name,
590
- warehouseId: d.warehouse_id,
591
- embedCredentials: d.embed_credentials,
592
- revisionCreateTime: d.revision_create_time,
593
- }));
594
-
595
- export const unmarshalRevertDashboardResponseSchema: z.ZodType<RevertDashboardResponse> =
596
- z
597
- .object({
598
- dashboard: z.lazy(() => unmarshalDashboardSchema).optional(),
599
- })
600
- .transform(d => ({
601
- dashboard: d.dashboard,
602
- }));
603
-
604
- export const unmarshalScheduleSchema: z.ZodType<Schedule> = z
605
- .object({
606
- schedule_id: z.string().optional(),
607
- dashboard_id: z.string().optional(),
608
- cron_schedule: z.lazy(() => unmarshalCronScheduleSchema).optional(),
609
- pause_status: z.enum(SchedulePauseStatus).optional(),
610
- display_name: z.string().optional(),
611
- etag: z.string().optional(),
612
- create_time: z
613
- .string()
614
- .transform(s => Temporal.Instant.from(s))
615
- .optional(),
616
- update_time: z
617
- .string()
618
- .transform(s => Temporal.Instant.from(s))
619
- .optional(),
620
- warehouse_id: z.string().optional(),
621
- })
622
- .transform(d => ({
623
- scheduleId: d.schedule_id,
624
- dashboardId: d.dashboard_id,
625
- cronSchedule: d.cron_schedule,
626
- pauseStatus: d.pause_status,
627
- displayName: d.display_name,
628
- etag: d.etag,
629
- createTime: d.create_time,
630
- updateTime: d.update_time,
631
- warehouseId: d.warehouse_id,
632
- }));
633
-
634
- export const unmarshalSubscriptionSchema: z.ZodType<Subscription> = z
635
- .object({
636
- subscription_id: z.string().optional(),
637
- schedule_id: z.string().optional(),
638
- dashboard_id: z.string().optional(),
639
- subscriber: z.lazy(() => unmarshalSubscription_SubscriberSchema).optional(),
640
- created_by_user_id: z
641
- .union([z.number(), z.bigint()])
642
- .transform(v => BigInt(v))
643
- .optional(),
644
- etag: z.string().optional(),
645
- create_time: z
646
- .string()
647
- .transform(s => Temporal.Instant.from(s))
648
- .optional(),
649
- update_time: z
650
- .string()
651
- .transform(s => Temporal.Instant.from(s))
652
- .optional(),
653
- skip_notify: z.boolean().optional(),
654
- })
655
- .transform(d => ({
656
- subscriptionId: d.subscription_id,
657
- scheduleId: d.schedule_id,
658
- dashboardId: d.dashboard_id,
659
- subscriber: d.subscriber,
660
- createdByUserId: d.created_by_user_id,
661
- etag: d.etag,
662
- createTime: d.create_time,
663
- updateTime: d.update_time,
664
- skipNotify: d.skip_notify,
665
- }));
666
-
667
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
668
- export const unmarshalSubscription_SubscriberSchema: z.ZodType<Subscription_Subscriber> =
669
- z
670
- .object({
671
- user_subscriber: z
672
- .lazy(() => unmarshalSubscription_Subscriber_UserSchema)
673
- .optional(),
674
- destination_subscriber: z
675
- .lazy(() => unmarshalSubscription_Subscriber_DestinationSchema)
676
- .optional(),
677
- })
678
- .transform(d => ({
679
- userSubscriber: d.user_subscriber,
680
- destinationSubscriber: d.destination_subscriber,
681
- }));
682
-
683
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
684
- export const unmarshalSubscription_Subscriber_DestinationSchema: z.ZodType<Subscription_Subscriber_Destination> =
685
- z
686
- .object({
687
- destination_id: z.string().optional(),
688
- })
689
- .transform(d => ({
690
- destinationId: d.destination_id,
691
- }));
692
-
693
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
694
- export const unmarshalSubscription_Subscriber_UserSchema: z.ZodType<Subscription_Subscriber_User> =
695
- z
696
- .object({
697
- user_id: z
698
- .union([z.number(), z.bigint()])
699
- .transform(v => BigInt(v))
700
- .optional(),
701
- })
702
- .transform(d => ({
703
- userId: d.user_id,
704
- }));
705
-
706
- export const unmarshalTrashDashboardResponseSchema: z.ZodType<TrashDashboardResponse> =
707
- z.object({});
708
-
709
- export const unmarshalUnpublishDashboardResponseSchema: z.ZodType<UnpublishDashboardResponse> =
710
- z.object({});
711
-
712
- export const marshalCronScheduleSchema: z.ZodType = z
713
- .object({
714
- quartzCronExpression: z.string().optional(),
715
- timezoneId: z.string().optional(),
716
- })
717
- .transform(d => ({
718
- quartz_cron_expression: d.quartzCronExpression,
719
- timezone_id: d.timezoneId,
720
- }));
721
-
722
- export const marshalDashboardSchema: z.ZodType = z
723
- .object({
724
- dashboardId: z.string().optional(),
725
- displayName: z.string().optional(),
726
- path: z.string().optional(),
727
- createTime: z
728
- .any()
729
- .transform((d: Temporal.Instant) => d.toString())
730
- .optional(),
731
- updateTime: z
732
- .any()
733
- .transform((d: Temporal.Instant) => d.toString())
734
- .optional(),
735
- warehouseId: z.string().optional(),
736
- etag: z.string().optional(),
737
- serializedDashboard: z.string().optional(),
738
- lifecycleState: z.enum(LifecycleState).optional(),
739
- parentPath: z.string().optional(),
740
- })
741
- .transform(d => ({
742
- dashboard_id: d.dashboardId,
743
- display_name: d.displayName,
744
- path: d.path,
745
- create_time: d.createTime,
746
- update_time: d.updateTime,
747
- warehouse_id: d.warehouseId,
748
- etag: d.etag,
749
- serialized_dashboard: d.serializedDashboard,
750
- lifecycle_state: d.lifecycleState,
751
- parent_path: d.parentPath,
752
- }));
753
-
754
- export const marshalMigrateDashboardRequestSchema: z.ZodType = z
755
- .object({
756
- sourceDashboardId: z.string().optional(),
757
- displayName: z.string().optional(),
758
- parentPath: z.string().optional(),
759
- updateParameterSyntax: z.boolean().optional(),
760
- })
761
- .transform(d => ({
762
- source_dashboard_id: d.sourceDashboardId,
763
- display_name: d.displayName,
764
- parent_path: d.parentPath,
765
- update_parameter_syntax: d.updateParameterSyntax,
766
- }));
767
-
768
- export const marshalPublishDashboardRequestSchema: z.ZodType = z
769
- .object({
770
- dashboardId: z.string().optional(),
771
- embedCredentials: z.boolean().optional(),
772
- warehouseId: z.string().optional(),
773
- })
774
- .transform(d => ({
775
- dashboard_id: d.dashboardId,
776
- embed_credentials: d.embedCredentials,
777
- warehouse_id: d.warehouseId,
778
- }));
779
-
780
- export const marshalRevertDashboardRequestSchema: z.ZodType = z
781
- .object({
782
- dashboardId: z.string().optional(),
783
- etag: z.string().optional(),
784
- })
785
- .transform(d => ({
786
- dashboard_id: d.dashboardId,
787
- etag: d.etag,
788
- }));
789
-
790
- export const marshalScheduleSchema: z.ZodType = z
791
- .object({
792
- scheduleId: z.string().optional(),
793
- dashboardId: z.string().optional(),
794
- cronSchedule: z.lazy(() => marshalCronScheduleSchema).optional(),
795
- pauseStatus: z.enum(SchedulePauseStatus).optional(),
796
- displayName: z.string().optional(),
797
- etag: z.string().optional(),
798
- createTime: z
799
- .any()
800
- .transform((d: Temporal.Instant) => d.toString())
801
- .optional(),
802
- updateTime: z
803
- .any()
804
- .transform((d: Temporal.Instant) => d.toString())
805
- .optional(),
806
- warehouseId: z.string().optional(),
807
- })
808
- .transform(d => ({
809
- schedule_id: d.scheduleId,
810
- dashboard_id: d.dashboardId,
811
- cron_schedule: d.cronSchedule,
812
- pause_status: d.pauseStatus,
813
- display_name: d.displayName,
814
- etag: d.etag,
815
- create_time: d.createTime,
816
- update_time: d.updateTime,
817
- warehouse_id: d.warehouseId,
818
- }));
819
-
820
- export const marshalSubscriptionSchema: z.ZodType = z
821
- .object({
822
- subscriptionId: z.string().optional(),
823
- scheduleId: z.string().optional(),
824
- dashboardId: z.string().optional(),
825
- subscriber: z.lazy(() => marshalSubscription_SubscriberSchema).optional(),
826
- createdByUserId: z.bigint().optional(),
827
- etag: z.string().optional(),
828
- createTime: z
829
- .any()
830
- .transform((d: Temporal.Instant) => d.toString())
831
- .optional(),
832
- updateTime: z
833
- .any()
834
- .transform((d: Temporal.Instant) => d.toString())
835
- .optional(),
836
- skipNotify: z.boolean().optional(),
837
- })
838
- .transform(d => ({
839
- subscription_id: d.subscriptionId,
840
- schedule_id: d.scheduleId,
841
- dashboard_id: d.dashboardId,
842
- subscriber: d.subscriber,
843
- created_by_user_id: d.createdByUserId,
844
- etag: d.etag,
845
- create_time: d.createTime,
846
- update_time: d.updateTime,
847
- skip_notify: d.skipNotify,
848
- }));
849
-
850
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
851
- export const marshalSubscription_SubscriberSchema: z.ZodType = z
852
- .object({
853
- userSubscriber: z
854
- .lazy(() => marshalSubscription_Subscriber_UserSchema)
855
- .optional(),
856
- destinationSubscriber: z
857
- .lazy(() => marshalSubscription_Subscriber_DestinationSchema)
858
- .optional(),
859
- })
860
- .transform(d => ({
861
- user_subscriber: d.userSubscriber,
862
- destination_subscriber: d.destinationSubscriber,
863
- }));
864
-
865
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
866
- export const marshalSubscription_Subscriber_DestinationSchema: z.ZodType = z
867
- .object({
868
- destinationId: z.string().optional(),
869
- })
870
- .transform(d => ({
871
- destination_id: d.destinationId,
872
- }));
873
-
874
- // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
875
- export const marshalSubscription_Subscriber_UserSchema: z.ZodType = z
876
- .object({
877
- userId: z.bigint().optional(),
878
- })
879
- .transform(d => ({
880
- user_id: d.userId,
881
- }));