@databricks/sdk-settings 0.0.0-dev → 0.1.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1300 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+
3
+ import {z} from 'zod';
4
+
5
+ /**
6
+ * Preview phase for settings that are feature previews.
7
+ * For settings that are not feature previews, the preview_phase field is left unset.
8
+ * Mirrors only the customer-facing phases surfaced in the UI; internal-only phases
9
+ * (DISABLED, DEV, UNDER_MIGRATION, LAUNCHED, etc.) are not exposed here.
10
+ */
11
+ export enum PreviewPhase {
12
+ /** Default value. Indicates the preview phase is unknown or the setting is not a feature preview. */
13
+ PREVIEW_PHASE_UNSPECIFIED = 'PREVIEW_PHASE_UNSPECIFIED',
14
+ /** The feature is in private preview, available only to specifically enrolled customers. */
15
+ PRIVATE_PREVIEW = 'PRIVATE_PREVIEW',
16
+ /**
17
+ * The feature is in public preview, available to all customers. Also used for gated public
18
+ * preview (available to customers who request access) since the distinction is internal.
19
+ */
20
+ PUBLIC_PREVIEW = 'PUBLIC_PREVIEW',
21
+ /** The feature is in beta. */
22
+ BETA = 'BETA',
23
+ /** The feature is approaching general availability. */
24
+ GA_SOON = 'GA_SOON',
25
+ /** The feature has reached general availability. */
26
+ GA = 'GA',
27
+ }
28
+
29
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
30
+ export enum AibiDashboardEmbeddingAccessPolicy_AccessPolicyType {
31
+ ACCESS_POLICY_TYPE_UNSPECIFIED = 'ACCESS_POLICY_TYPE_UNSPECIFIED',
32
+ ALLOW_ALL_DOMAINS = 'ALLOW_ALL_DOMAINS',
33
+ ALLOW_APPROVED_DOMAINS = 'ALLOW_APPROVED_DOMAINS',
34
+ DENY_ALL_DOMAINS = 'DENY_ALL_DOMAINS',
35
+ }
36
+
37
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
38
+ export enum ClusterAutoRestartMessage_MaintenanceWindow_DayOfWeek {
39
+ DAY_OF_WEEK_UNSPECIFIED = 'DAY_OF_WEEK_UNSPECIFIED',
40
+ MONDAY = 'MONDAY',
41
+ TUESDAY = 'TUESDAY',
42
+ WEDNESDAY = 'WEDNESDAY',
43
+ THURSDAY = 'THURSDAY',
44
+ FRIDAY = 'FRIDAY',
45
+ SATURDAY = 'SATURDAY',
46
+ SUNDAY = 'SUNDAY',
47
+ }
48
+
49
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
50
+ export enum ClusterAutoRestartMessage_MaintenanceWindow_WeekDayFrequency {
51
+ WEEK_DAY_FREQUENCY_UNSPECIFIED = 'WEEK_DAY_FREQUENCY_UNSPECIFIED',
52
+ FIRST_OF_MONTH = 'FIRST_OF_MONTH',
53
+ SECOND_OF_MONTH = 'SECOND_OF_MONTH',
54
+ THIRD_OF_MONTH = 'THIRD_OF_MONTH',
55
+ FOURTH_OF_MONTH = 'FOURTH_OF_MONTH',
56
+ FIRST_AND_THIRD_OF_MONTH = 'FIRST_AND_THIRD_OF_MONTH',
57
+ SECOND_AND_FOURTH_OF_MONTH = 'SECOND_AND_FOURTH_OF_MONTH',
58
+ EVERY_WEEK = 'EVERY_WEEK',
59
+ }
60
+
61
+ /**
62
+ * ON: Grants all users in all workspaces access to the Personal Compute default policy, allowing all users to create single-machine compute resources.
63
+ * DELEGATE: Moves access control for the Personal Compute default policy to individual workspaces and requires a workspace’s users or groups to be added to the ACLs of that workspace’s Personal Compute default policy before they will be able to create compute resources through that policy.
64
+ */
65
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
66
+ export enum PersonalComputeMessage_PersonalComputeMessageEnum {
67
+ PERSONAL_COMPUTE_MESSAGE_ENUM_UNSPECIFIED = 'PERSONAL_COMPUTE_MESSAGE_ENUM_UNSPECIFIED',
68
+ ON = 'ON',
69
+ DELEGATE = 'DELEGATE',
70
+ }
71
+
72
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
73
+ export enum RestrictWorkspaceAdminsMessage_Status {
74
+ /** Default value for proto enum */
75
+ STATUS_UNSPECIFIED = 'STATUS_UNSPECIFIED',
76
+ /**
77
+ * Default value for existing workspaces
78
+ * Allows WS admins to create OBO tokens for all SPs in the workspace without explicit permissions.
79
+ */
80
+ ALLOW_ALL = 'ALLOW_ALL',
81
+ /**
82
+ * Default value for new workspaces
83
+ * Restrict WS admins to create OBO tokens for SPs in the workspace unless corresponding permissions are provided
84
+ */
85
+ RESTRICT_TOKENS_AND_JOB_RUN_AS = 'RESTRICT_TOKENS_AND_JOB_RUN_AS',
86
+ }
87
+
88
+ export interface AibiDashboardEmbeddingAccessPolicy {
89
+ accessPolicyType?:
90
+ | AibiDashboardEmbeddingAccessPolicy_AccessPolicyType
91
+ | undefined;
92
+ }
93
+
94
+ export interface AibiDashboardEmbeddingApprovedDomains {
95
+ approvedDomains?: string[] | undefined;
96
+ }
97
+
98
+ export interface AllowedAppsUserApiScopesMessage {
99
+ allowedScopes?: string[] | undefined;
100
+ }
101
+
102
+ export interface BooleanMessage {
103
+ value?: boolean | undefined;
104
+ }
105
+
106
+ export interface ClusterAutoRestartMessage {
107
+ enabled?: boolean | undefined;
108
+ canToggle?: boolean | undefined;
109
+ maintenanceWindow?: ClusterAutoRestartMessage_MaintenanceWindow | undefined;
110
+ enablementDetails?: ClusterAutoRestartMessage_EnablementDetails | undefined;
111
+ restartEvenIfNoUpdatesAvailable?: boolean | undefined;
112
+ }
113
+
114
+ /**
115
+ * Contains an information about the enablement status judging (e.g. whether the enterprise tier
116
+ * is enabled)
117
+ * This is only additional information that MUST NOT be used to decide whether the setting is
118
+ * enabled or not. This is intended to use only for purposes like showing an error message to
119
+ * the customer with the additional details. For example, using these details we can check
120
+ * why exactly the feature is disabled for this customer.
121
+ */
122
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
123
+ export interface ClusterAutoRestartMessage_EnablementDetails {
124
+ /** The feature is unavailable if the customer doesn't have enterprise tier */
125
+ unavailableForNonEnterpriseTier?: boolean | undefined;
126
+ /** The feature is unavailable if the corresponding entitlement disabled (see getShieldEntitlementEnable) */
127
+ unavailableForDisabledEntitlement?: boolean | undefined;
128
+ /** The feature is force enabled if compliance mode is active */
129
+ forcedForComplianceMode?: boolean | undefined;
130
+ }
131
+
132
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
133
+ export interface ClusterAutoRestartMessage_MaintenanceWindow {
134
+ weekDayBasedSchedule?:
135
+ | ClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSchedule
136
+ | undefined;
137
+ }
138
+
139
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
140
+ export interface ClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSchedule {
141
+ frequency?:
142
+ | ClusterAutoRestartMessage_MaintenanceWindow_WeekDayFrequency
143
+ | undefined;
144
+ dayOfWeek?: ClusterAutoRestartMessage_MaintenanceWindow_DayOfWeek | undefined;
145
+ windowStartTime?:
146
+ | ClusterAutoRestartMessage_MaintenanceWindow_WindowStartTime
147
+ | undefined;
148
+ }
149
+
150
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
151
+ export interface ClusterAutoRestartMessage_MaintenanceWindow_WindowStartTime {
152
+ hours?: number | undefined;
153
+ minutes?: number | undefined;
154
+ }
155
+
156
+ export interface GetPublicAccountSettingRequest {
157
+ accountId?: string | undefined;
158
+ name?: string | undefined;
159
+ }
160
+
161
+ export interface GetPublicAccountUserPreferenceRequest {
162
+ /** <Databricks> account ID of the account being managed. */
163
+ accountId?: string | undefined;
164
+ /** User ID of the user whose setting is being retrieved. */
165
+ userId?: string | undefined;
166
+ /** User Setting name. */
167
+ name?: string | undefined;
168
+ }
169
+
170
+ export interface GetPublicWorkspaceSettingRequest {
171
+ /** Name of the setting */
172
+ name?: string | undefined;
173
+ }
174
+
175
+ export interface IntegerMessage {
176
+ value?: number | undefined;
177
+ }
178
+
179
+ export interface ListAccountSettingsMetadataRequest {
180
+ /** <Databricks> account ID of the account being managed. */
181
+ accountId?: string | undefined;
182
+ /**
183
+ * The maximum number of settings to return. The service may return fewer than this value.
184
+ * If unspecified, at most 200 settings will be returned.
185
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
186
+ */
187
+ pageSize?: number | undefined;
188
+ /**
189
+ * A page token, received from a previous `ListAccountSettingsMetadataRequest` call.
190
+ * Provide this to retrieve the subsequent page.
191
+ *
192
+ * When paginating, all other parameters provided to `ListAccountSettingsMetadataRequest` must match
193
+ * the call that provided the page token.
194
+ */
195
+ pageToken?: string | undefined;
196
+ }
197
+
198
+ export interface ListAccountSettingsMetadataResponse {
199
+ /** List of all settings available via public APIs and their metadata */
200
+ settingsMetadata?: SettingsMetadata[] | undefined;
201
+ /**
202
+ * A token that can be sent as `page_token` to retrieve the next page.
203
+ * If this field is omitted, there are no subsequent pages.
204
+ */
205
+ nextPageToken?: string | undefined;
206
+ }
207
+
208
+ export interface ListAccountUserPreferencesMetadataRequest {
209
+ /** <Databricks> account ID of the account being managed. */
210
+ accountId?: string | undefined;
211
+ /** User ID of the user whose settings metadata is being retrieved. */
212
+ userId?: string | undefined;
213
+ /**
214
+ * The maximum number of settings to return. The service may return fewer than this value.
215
+ * If unspecified, at most 200 settings will be returned.
216
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
217
+ */
218
+ pageSize?: number | undefined;
219
+ /**
220
+ * A page token, received from a previous `ListAccountUserPreferencesMetadataRequest` call.
221
+ * Provide this to retrieve the subsequent page.
222
+ *
223
+ * When paginating, all other parameters provided to `ListAccountUserPreferencesMetadataRequest` must match
224
+ * the call that provided the page token.
225
+ */
226
+ pageToken?: string | undefined;
227
+ }
228
+
229
+ export interface ListAccountUserPreferencesMetadataResponse {
230
+ /** List of all settings available via public APIs and their metadata */
231
+ settingsMetadata?: SettingsMetadata[] | undefined;
232
+ /**
233
+ * A token that can be sent as `page_token` to retrieve the next page.
234
+ * If this field is omitted, there are no subsequent pages.
235
+ */
236
+ nextPageToken?: string | undefined;
237
+ }
238
+
239
+ export interface ListWorkspaceSettingsMetadataRequest {
240
+ /**
241
+ * The maximum number of settings to return. The service may return fewer than this value.
242
+ * If unspecified, at most 200 settings will be returned.
243
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
244
+ */
245
+ pageSize?: number | undefined;
246
+ /**
247
+ * A page token, received from a previous `ListWorkspaceSettingsMetadataRequest` call.
248
+ * Provide this to retrieve the subsequent page.
249
+ *
250
+ * When paginating, all other parameters provided to `ListWorkspaceSettingsMetadataRequest` must match
251
+ * the call that provided the page token.
252
+ */
253
+ pageToken?: string | undefined;
254
+ }
255
+
256
+ export interface ListWorkspaceSettingsMetadataResponse {
257
+ /** List of all settings available via public APIs and their metadata */
258
+ settingsMetadata?: SettingsMetadata[] | undefined;
259
+ /**
260
+ * A token that can be sent as `page_token` to retrieve the next page.
261
+ * If this field is omitted, there are no subsequent pages.
262
+ */
263
+ nextPageToken?: string | undefined;
264
+ }
265
+
266
+ export interface OperationalEmailCustomRecipientMessage {
267
+ email?: string | undefined;
268
+ }
269
+
270
+ export interface PatchPublicAccountSettingRequest {
271
+ /** <Databricks> account ID of the account being managed. */
272
+ accountId?: string | undefined;
273
+ name?: string | undefined;
274
+ setting?: Setting | undefined;
275
+ }
276
+
277
+ export interface PatchPublicAccountUserPreferenceRequest {
278
+ /** <Databricks> account ID of the account being managed. */
279
+ accountId?: string | undefined;
280
+ /** User ID of the user whose setting is being updated. */
281
+ userId?: string | undefined;
282
+ name?: string | undefined;
283
+ setting?: UserPreference | undefined;
284
+ }
285
+
286
+ export interface PatchPublicWorkspaceSettingRequest {
287
+ /** Name of the setting */
288
+ name?: string | undefined;
289
+ setting?: Setting | undefined;
290
+ }
291
+
292
+ export interface PersonalComputeMessage {
293
+ value?: PersonalComputeMessage_PersonalComputeMessageEnum | undefined;
294
+ }
295
+
296
+ export interface RestrictWorkspaceAdminsMessage {
297
+ status?: RestrictWorkspaceAdminsMessage_Status | undefined;
298
+ /**
299
+ * When true, workspace admins cannot create governance tags.
300
+ * ALLOW_ALL status does not override this; they are independent.
301
+ */
302
+ disableGovTagCreation?: boolean | undefined;
303
+ }
304
+
305
+ export interface Setting {
306
+ /** Name of the setting. */
307
+ name?: string | undefined;
308
+ /**
309
+ * New fields should be added before the oneof below - unless it's a new Setting value message,
310
+ * in that case it needs to be defined in the oneof below.
311
+ * The user-set value that goes into storage
312
+ */
313
+ value?:
314
+ | {
315
+ $case: 'booleanVal';
316
+ /** Setting value for boolean type setting. This is the setting value set by consumers, check effective_boolean_val for final setting value. */
317
+ booleanVal: BooleanMessage;
318
+ }
319
+ | {
320
+ $case: 'stringVal';
321
+ /** Setting value for string type setting. This is the setting value set by consumers, check effective_string_val for final setting value. */
322
+ stringVal: StringMessage;
323
+ }
324
+ | {
325
+ $case: 'integerVal';
326
+ /** Setting value for integer type setting. This is the setting value set by consumers, check effective_integer_val for final setting value. */
327
+ integerVal: IntegerMessage;
328
+ }
329
+ | {
330
+ $case: 'automaticClusterUpdateWorkspace';
331
+ /** Setting value for automatic_cluster_update_workspace setting. This is the setting value set by consumers, check effective_automatic_cluster_update_workspace for final setting value. */
332
+ automaticClusterUpdateWorkspace: ClusterAutoRestartMessage;
333
+ }
334
+ | {
335
+ $case: 'aibiDashboardEmbeddingApprovedDomains';
336
+ /** Setting value for aibi_dashboard_embedding_approved_domains setting. This is the setting value set by consumers, check effective_aibi_dashboard_embedding_approved_domains for final setting value. */
337
+ aibiDashboardEmbeddingApprovedDomains: AibiDashboardEmbeddingApprovedDomains;
338
+ }
339
+ | {
340
+ $case: 'aibiDashboardEmbeddingAccessPolicy';
341
+ /** Setting value for aibi_dashboard_embedding_access_policy setting. This is the setting value set by consumers, check effective_aibi_dashboard_embedding_access_policy for final setting value. */
342
+ aibiDashboardEmbeddingAccessPolicy: AibiDashboardEmbeddingAccessPolicy;
343
+ }
344
+ | {
345
+ $case: 'restrictWorkspaceAdmins';
346
+ /** Setting value for restrict_workspace_admins setting. This is the setting value set by consumers, check effective_restrict_workspace_admins for final setting value. */
347
+ restrictWorkspaceAdmins: RestrictWorkspaceAdminsMessage;
348
+ }
349
+ | {
350
+ $case: 'personalCompute';
351
+ /** Setting value for personal_compute setting. This is the setting value set by consumers, check effective_personal_compute for final setting value. */
352
+ personalCompute: PersonalComputeMessage;
353
+ }
354
+ | {
355
+ $case: 'allowedAppsUserApiScopes';
356
+ /** Setting value for allowed_apps_user_api_scopes setting. This is the setting value set by consumers, check effective_allowed_apps_user_api_scopes for final setting value. */
357
+ allowedAppsUserApiScopes: AllowedAppsUserApiScopesMessage;
358
+ }
359
+ | {
360
+ $case: 'operationalEmailCustomRecipient';
361
+ /** Setting value for operational_email_custom_recipient setting. This is the setting value set by consumers, check effective_operational_email_custom_recipient for final setting value. */
362
+ operationalEmailCustomRecipient: OperationalEmailCustomRecipientMessage;
363
+ }
364
+ | undefined;
365
+ /**
366
+ * New fields should be added before the oneof below - unless it's a new Setting value message,
367
+ * in that case it needs to be defined in the oneof below.
368
+ * The final effective value from server as per the policy evaluation.
369
+ */
370
+ effectiveValue?:
371
+ | {
372
+ $case: 'effectiveBooleanVal';
373
+ /** Effective setting value for boolean type setting. This is the final effective value of setting. To set a value use boolean_val. */
374
+ effectiveBooleanVal: BooleanMessage;
375
+ }
376
+ | {
377
+ $case: 'effectiveStringVal';
378
+ /** Effective setting value for string type setting. This is the final effective value of setting. To set a value use string_val. */
379
+ effectiveStringVal: StringMessage;
380
+ }
381
+ | {
382
+ $case: 'effectiveIntegerVal';
383
+ /** Effective setting value for integer type setting. This is the final effective value of setting. To set a value use integer_val. */
384
+ effectiveIntegerVal: IntegerMessage;
385
+ }
386
+ | {
387
+ $case: 'effectiveAutomaticClusterUpdateWorkspace';
388
+ /** Effective setting value for automatic_cluster_update_workspace setting. This is the final effective value of setting. To set a value use automatic_cluster_update_workspace. */
389
+ effectiveAutomaticClusterUpdateWorkspace: ClusterAutoRestartMessage;
390
+ }
391
+ | {
392
+ $case: 'effectiveAibiDashboardEmbeddingApprovedDomains';
393
+ /** Effective setting value for aibi_dashboard_embedding_approved_domains setting. This is the final effective value of setting. To set a value use aibi_dashboard_embedding_approved_domains. */
394
+ effectiveAibiDashboardEmbeddingApprovedDomains: AibiDashboardEmbeddingApprovedDomains;
395
+ }
396
+ | {
397
+ $case: 'effectiveAibiDashboardEmbeddingAccessPolicy';
398
+ /** Effective setting value for aibi_dashboard_embedding_access_policy setting. This is the final effective value of setting. To set a value use aibi_dashboard_embedding_access_policy. */
399
+ effectiveAibiDashboardEmbeddingAccessPolicy: AibiDashboardEmbeddingAccessPolicy;
400
+ }
401
+ | {
402
+ $case: 'effectiveRestrictWorkspaceAdmins';
403
+ /** Effective setting value for restrict_workspace_admins setting. This is the final effective value of setting. To set a value use restrict_workspace_admins. */
404
+ effectiveRestrictWorkspaceAdmins: RestrictWorkspaceAdminsMessage;
405
+ }
406
+ | {
407
+ $case: 'effectivePersonalCompute';
408
+ /** Effective setting value for personal_compute setting. This is the final effective value of setting. To set a value use personal_compute. */
409
+ effectivePersonalCompute: PersonalComputeMessage;
410
+ }
411
+ | {
412
+ $case: 'effectiveAllowedAppsUserApiScopes';
413
+ /** Effective setting value for allowed_apps_user_api_scopes setting. This is the final effective value of setting. To set a value use allowed_apps_user_api_scopes. */
414
+ effectiveAllowedAppsUserApiScopes: AllowedAppsUserApiScopesMessage;
415
+ }
416
+ | {
417
+ $case: 'effectiveOperationalEmailCustomRecipient';
418
+ /** Effective setting value for operational_email_custom_recipient setting. This is the final effective value of setting. To set a value use operational_email_custom_recipient. */
419
+ effectiveOperationalEmailCustomRecipient: OperationalEmailCustomRecipientMessage;
420
+ }
421
+ | undefined;
422
+ }
423
+
424
+ export interface SettingsMetadata {
425
+ /** Name of the setting. */
426
+ name?: string | undefined;
427
+ /** Setting description for what this setting controls */
428
+ description?: string | undefined;
429
+ /** Sample message depicting the type of the setting. To set this setting, the value sent must match this type. */
430
+ type?: string | undefined;
431
+ /** Link to databricks documentation for the setting */
432
+ docsLink?: string | undefined;
433
+ /** Preview phase for feature preview settings. This field is not set for non-preview settings. */
434
+ previewPhase?: PreviewPhase | undefined;
435
+ /**
436
+ * Human-readable display name for the setting or feature preview.
437
+ * This field may be unset if no display name is available.
438
+ */
439
+ displayName?: string | undefined;
440
+ }
441
+
442
+ export interface StringMessage {
443
+ /** Represents a generic string value. */
444
+ value?: string | undefined;
445
+ }
446
+
447
+ /**
448
+ * User Preference represents a user-specific setting scoped to an individual user within an account.
449
+ * Unlike workspace or account settings that apply to all users, user preferences allow personal
450
+ * customization (e.g., UI theme, editor preferences) without affecting other users.
451
+ */
452
+ export interface UserPreference {
453
+ /** Name of the setting. */
454
+ name?: string | undefined;
455
+ /** User ID of the user. */
456
+ userId?: string | undefined;
457
+ /**
458
+ * New fields should be added before the oneof below - unless it's a new Setting value message,
459
+ * in that case it needs to be defined in the oneof below.
460
+ * The user-set value that goes into storage.
461
+ */
462
+ value?:
463
+ | {$case: 'booleanVal'; booleanVal: BooleanMessage}
464
+ | {$case: 'stringVal'; stringVal: StringMessage}
465
+ | undefined;
466
+ /**
467
+ * New fields should be added before the oneof below - unless it's a new User Preference value message,
468
+ * in that case it needs to be defined in the oneof below.
469
+ * The final effective value from server as per the policy evaluation.
470
+ */
471
+ effectiveValue?:
472
+ | {$case: 'effectiveBooleanVal'; effectiveBooleanVal: BooleanMessage}
473
+ | {$case: 'effectiveStringVal'; effectiveStringVal: StringMessage}
474
+ | undefined;
475
+ }
476
+
477
+ export const unmarshalAibiDashboardEmbeddingAccessPolicySchema: z.ZodType<AibiDashboardEmbeddingAccessPolicy> =
478
+ z
479
+ .object({
480
+ access_policy_type: z
481
+ .enum(AibiDashboardEmbeddingAccessPolicy_AccessPolicyType)
482
+ .optional(),
483
+ })
484
+ .transform(d => ({
485
+ accessPolicyType: d.access_policy_type,
486
+ }));
487
+
488
+ export const unmarshalAibiDashboardEmbeddingApprovedDomainsSchema: z.ZodType<AibiDashboardEmbeddingApprovedDomains> =
489
+ z
490
+ .object({
491
+ approved_domains: z.array(z.string()).optional(),
492
+ })
493
+ .transform(d => ({
494
+ approvedDomains: d.approved_domains,
495
+ }));
496
+
497
+ export const unmarshalAllowedAppsUserApiScopesMessageSchema: z.ZodType<AllowedAppsUserApiScopesMessage> =
498
+ z
499
+ .object({
500
+ allowed_scopes: z.array(z.string()).optional(),
501
+ })
502
+ .transform(d => ({
503
+ allowedScopes: d.allowed_scopes,
504
+ }));
505
+
506
+ export const unmarshalBooleanMessageSchema: z.ZodType<BooleanMessage> = z
507
+ .object({
508
+ value: z.boolean().optional(),
509
+ })
510
+ .transform(d => ({
511
+ value: d.value,
512
+ }));
513
+
514
+ export const unmarshalClusterAutoRestartMessageSchema: z.ZodType<ClusterAutoRestartMessage> =
515
+ z
516
+ .object({
517
+ enabled: z.boolean().optional(),
518
+ can_toggle: z.boolean().optional(),
519
+ maintenance_window: z
520
+ .lazy(() => unmarshalClusterAutoRestartMessage_MaintenanceWindowSchema)
521
+ .optional(),
522
+ enablement_details: z
523
+ .lazy(() => unmarshalClusterAutoRestartMessage_EnablementDetailsSchema)
524
+ .optional(),
525
+ restart_even_if_no_updates_available: z.boolean().optional(),
526
+ })
527
+ .transform(d => ({
528
+ enabled: d.enabled,
529
+ canToggle: d.can_toggle,
530
+ maintenanceWindow: d.maintenance_window,
531
+ enablementDetails: d.enablement_details,
532
+ restartEvenIfNoUpdatesAvailable: d.restart_even_if_no_updates_available,
533
+ }));
534
+
535
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
536
+ export const unmarshalClusterAutoRestartMessage_EnablementDetailsSchema: z.ZodType<ClusterAutoRestartMessage_EnablementDetails> =
537
+ z
538
+ .object({
539
+ unavailable_for_non_enterprise_tier: z.boolean().optional(),
540
+ unavailable_for_disabled_entitlement: z.boolean().optional(),
541
+ forced_for_compliance_mode: z.boolean().optional(),
542
+ })
543
+ .transform(d => ({
544
+ unavailableForNonEnterpriseTier: d.unavailable_for_non_enterprise_tier,
545
+ unavailableForDisabledEntitlement: d.unavailable_for_disabled_entitlement,
546
+ forcedForComplianceMode: d.forced_for_compliance_mode,
547
+ }));
548
+
549
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
550
+ export const unmarshalClusterAutoRestartMessage_MaintenanceWindowSchema: z.ZodType<ClusterAutoRestartMessage_MaintenanceWindow> =
551
+ z
552
+ .object({
553
+ week_day_based_schedule: z
554
+ .lazy(
555
+ () =>
556
+ unmarshalClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleSchema
557
+ )
558
+ .optional(),
559
+ })
560
+ .transform(d => ({
561
+ weekDayBasedSchedule: d.week_day_based_schedule,
562
+ }));
563
+
564
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
565
+ export const unmarshalClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleSchema: z.ZodType<ClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedSchedule> =
566
+ z
567
+ .object({
568
+ frequency: z
569
+ .enum(ClusterAutoRestartMessage_MaintenanceWindow_WeekDayFrequency)
570
+ .optional(),
571
+ day_of_week: z
572
+ .enum(ClusterAutoRestartMessage_MaintenanceWindow_DayOfWeek)
573
+ .optional(),
574
+ window_start_time: z
575
+ .lazy(
576
+ () =>
577
+ unmarshalClusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeSchema
578
+ )
579
+ .optional(),
580
+ })
581
+ .transform(d => ({
582
+ frequency: d.frequency,
583
+ dayOfWeek: d.day_of_week,
584
+ windowStartTime: d.window_start_time,
585
+ }));
586
+
587
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
588
+ export const unmarshalClusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeSchema: z.ZodType<ClusterAutoRestartMessage_MaintenanceWindow_WindowStartTime> =
589
+ z
590
+ .object({
591
+ hours: z.number().optional(),
592
+ minutes: z.number().optional(),
593
+ })
594
+ .transform(d => ({
595
+ hours: d.hours,
596
+ minutes: d.minutes,
597
+ }));
598
+
599
+ export const unmarshalIntegerMessageSchema: z.ZodType<IntegerMessage> = z
600
+ .object({
601
+ value: z.number().optional(),
602
+ })
603
+ .transform(d => ({
604
+ value: d.value,
605
+ }));
606
+
607
+ export const unmarshalListAccountSettingsMetadataResponseSchema: z.ZodType<ListAccountSettingsMetadataResponse> =
608
+ z
609
+ .object({
610
+ settings_metadata: z
611
+ .array(z.lazy(() => unmarshalSettingsMetadataSchema))
612
+ .optional(),
613
+ next_page_token: z.string().optional(),
614
+ })
615
+ .transform(d => ({
616
+ settingsMetadata: d.settings_metadata,
617
+ nextPageToken: d.next_page_token,
618
+ }));
619
+
620
+ export const unmarshalListAccountUserPreferencesMetadataResponseSchema: z.ZodType<ListAccountUserPreferencesMetadataResponse> =
621
+ z
622
+ .object({
623
+ settings_metadata: z
624
+ .array(z.lazy(() => unmarshalSettingsMetadataSchema))
625
+ .optional(),
626
+ next_page_token: z.string().optional(),
627
+ })
628
+ .transform(d => ({
629
+ settingsMetadata: d.settings_metadata,
630
+ nextPageToken: d.next_page_token,
631
+ }));
632
+
633
+ export const unmarshalListWorkspaceSettingsMetadataResponseSchema: z.ZodType<ListWorkspaceSettingsMetadataResponse> =
634
+ z
635
+ .object({
636
+ settings_metadata: z
637
+ .array(z.lazy(() => unmarshalSettingsMetadataSchema))
638
+ .optional(),
639
+ next_page_token: z.string().optional(),
640
+ })
641
+ .transform(d => ({
642
+ settingsMetadata: d.settings_metadata,
643
+ nextPageToken: d.next_page_token,
644
+ }));
645
+
646
+ export const unmarshalOperationalEmailCustomRecipientMessageSchema: z.ZodType<OperationalEmailCustomRecipientMessage> =
647
+ z
648
+ .object({
649
+ email: z.string().optional(),
650
+ })
651
+ .transform(d => ({
652
+ email: d.email,
653
+ }));
654
+
655
+ export const unmarshalPersonalComputeMessageSchema: z.ZodType<PersonalComputeMessage> =
656
+ z
657
+ .object({
658
+ value: z
659
+ .enum(PersonalComputeMessage_PersonalComputeMessageEnum)
660
+ .optional(),
661
+ })
662
+ .transform(d => ({
663
+ value: d.value,
664
+ }));
665
+
666
+ export const unmarshalRestrictWorkspaceAdminsMessageSchema: z.ZodType<RestrictWorkspaceAdminsMessage> =
667
+ z
668
+ .object({
669
+ status: z.enum(RestrictWorkspaceAdminsMessage_Status).optional(),
670
+ disable_gov_tag_creation: z.boolean().optional(),
671
+ })
672
+ .transform(d => ({
673
+ status: d.status,
674
+ disableGovTagCreation: d.disable_gov_tag_creation,
675
+ }));
676
+
677
+ export const unmarshalSettingSchema: z.ZodType<Setting> = z
678
+ .object({
679
+ name: z.string().optional(),
680
+ boolean_val: z.lazy(() => unmarshalBooleanMessageSchema).optional(),
681
+ string_val: z.lazy(() => unmarshalStringMessageSchema).optional(),
682
+ integer_val: z.lazy(() => unmarshalIntegerMessageSchema).optional(),
683
+ automatic_cluster_update_workspace: z
684
+ .lazy(() => unmarshalClusterAutoRestartMessageSchema)
685
+ .optional(),
686
+ aibi_dashboard_embedding_approved_domains: z
687
+ .lazy(() => unmarshalAibiDashboardEmbeddingApprovedDomainsSchema)
688
+ .optional(),
689
+ aibi_dashboard_embedding_access_policy: z
690
+ .lazy(() => unmarshalAibiDashboardEmbeddingAccessPolicySchema)
691
+ .optional(),
692
+ restrict_workspace_admins: z
693
+ .lazy(() => unmarshalRestrictWorkspaceAdminsMessageSchema)
694
+ .optional(),
695
+ personal_compute: z
696
+ .lazy(() => unmarshalPersonalComputeMessageSchema)
697
+ .optional(),
698
+ allowed_apps_user_api_scopes: z
699
+ .lazy(() => unmarshalAllowedAppsUserApiScopesMessageSchema)
700
+ .optional(),
701
+ operational_email_custom_recipient: z
702
+ .lazy(() => unmarshalOperationalEmailCustomRecipientMessageSchema)
703
+ .optional(),
704
+ effective_boolean_val: z
705
+ .lazy(() => unmarshalBooleanMessageSchema)
706
+ .optional(),
707
+ effective_string_val: z.lazy(() => unmarshalStringMessageSchema).optional(),
708
+ effective_integer_val: z
709
+ .lazy(() => unmarshalIntegerMessageSchema)
710
+ .optional(),
711
+ effective_automatic_cluster_update_workspace: z
712
+ .lazy(() => unmarshalClusterAutoRestartMessageSchema)
713
+ .optional(),
714
+ effective_aibi_dashboard_embedding_approved_domains: z
715
+ .lazy(() => unmarshalAibiDashboardEmbeddingApprovedDomainsSchema)
716
+ .optional(),
717
+ effective_aibi_dashboard_embedding_access_policy: z
718
+ .lazy(() => unmarshalAibiDashboardEmbeddingAccessPolicySchema)
719
+ .optional(),
720
+ effective_restrict_workspace_admins: z
721
+ .lazy(() => unmarshalRestrictWorkspaceAdminsMessageSchema)
722
+ .optional(),
723
+ effective_personal_compute: z
724
+ .lazy(() => unmarshalPersonalComputeMessageSchema)
725
+ .optional(),
726
+ effective_allowed_apps_user_api_scopes: z
727
+ .lazy(() => unmarshalAllowedAppsUserApiScopesMessageSchema)
728
+ .optional(),
729
+ effective_operational_email_custom_recipient: z
730
+ .lazy(() => unmarshalOperationalEmailCustomRecipientMessageSchema)
731
+ .optional(),
732
+ })
733
+ .transform(d => ({
734
+ name: d.name,
735
+ value:
736
+ d.boolean_val !== undefined
737
+ ? {$case: 'booleanVal' as const, booleanVal: d.boolean_val}
738
+ : d.string_val !== undefined
739
+ ? {$case: 'stringVal' as const, stringVal: d.string_val}
740
+ : d.integer_val !== undefined
741
+ ? {$case: 'integerVal' as const, integerVal: d.integer_val}
742
+ : d.automatic_cluster_update_workspace !== undefined
743
+ ? {
744
+ $case: 'automaticClusterUpdateWorkspace' as const,
745
+ automaticClusterUpdateWorkspace:
746
+ d.automatic_cluster_update_workspace,
747
+ }
748
+ : d.aibi_dashboard_embedding_approved_domains !== undefined
749
+ ? {
750
+ $case: 'aibiDashboardEmbeddingApprovedDomains' as const,
751
+ aibiDashboardEmbeddingApprovedDomains:
752
+ d.aibi_dashboard_embedding_approved_domains,
753
+ }
754
+ : d.aibi_dashboard_embedding_access_policy !== undefined
755
+ ? {
756
+ $case: 'aibiDashboardEmbeddingAccessPolicy' as const,
757
+ aibiDashboardEmbeddingAccessPolicy:
758
+ d.aibi_dashboard_embedding_access_policy,
759
+ }
760
+ : d.restrict_workspace_admins !== undefined
761
+ ? {
762
+ $case: 'restrictWorkspaceAdmins' as const,
763
+ restrictWorkspaceAdmins: d.restrict_workspace_admins,
764
+ }
765
+ : d.personal_compute !== undefined
766
+ ? {
767
+ $case: 'personalCompute' as const,
768
+ personalCompute: d.personal_compute,
769
+ }
770
+ : d.allowed_apps_user_api_scopes !== undefined
771
+ ? {
772
+ $case: 'allowedAppsUserApiScopes' as const,
773
+ allowedAppsUserApiScopes:
774
+ d.allowed_apps_user_api_scopes,
775
+ }
776
+ : d.operational_email_custom_recipient !== undefined
777
+ ? {
778
+ $case: 'operationalEmailCustomRecipient' as const,
779
+ operationalEmailCustomRecipient:
780
+ d.operational_email_custom_recipient,
781
+ }
782
+ : undefined,
783
+ effectiveValue:
784
+ d.effective_boolean_val !== undefined
785
+ ? {
786
+ $case: 'effectiveBooleanVal' as const,
787
+ effectiveBooleanVal: d.effective_boolean_val,
788
+ }
789
+ : d.effective_string_val !== undefined
790
+ ? {
791
+ $case: 'effectiveStringVal' as const,
792
+ effectiveStringVal: d.effective_string_val,
793
+ }
794
+ : d.effective_integer_val !== undefined
795
+ ? {
796
+ $case: 'effectiveIntegerVal' as const,
797
+ effectiveIntegerVal: d.effective_integer_val,
798
+ }
799
+ : d.effective_automatic_cluster_update_workspace !== undefined
800
+ ? {
801
+ $case: 'effectiveAutomaticClusterUpdateWorkspace' as const,
802
+ effectiveAutomaticClusterUpdateWorkspace:
803
+ d.effective_automatic_cluster_update_workspace,
804
+ }
805
+ : d.effective_aibi_dashboard_embedding_approved_domains !==
806
+ undefined
807
+ ? {
808
+ $case:
809
+ 'effectiveAibiDashboardEmbeddingApprovedDomains' as const,
810
+ effectiveAibiDashboardEmbeddingApprovedDomains:
811
+ d.effective_aibi_dashboard_embedding_approved_domains,
812
+ }
813
+ : d.effective_aibi_dashboard_embedding_access_policy !==
814
+ undefined
815
+ ? {
816
+ $case:
817
+ 'effectiveAibiDashboardEmbeddingAccessPolicy' as const,
818
+ effectiveAibiDashboardEmbeddingAccessPolicy:
819
+ d.effective_aibi_dashboard_embedding_access_policy,
820
+ }
821
+ : d.effective_restrict_workspace_admins !== undefined
822
+ ? {
823
+ $case: 'effectiveRestrictWorkspaceAdmins' as const,
824
+ effectiveRestrictWorkspaceAdmins:
825
+ d.effective_restrict_workspace_admins,
826
+ }
827
+ : d.effective_personal_compute !== undefined
828
+ ? {
829
+ $case: 'effectivePersonalCompute' as const,
830
+ effectivePersonalCompute:
831
+ d.effective_personal_compute,
832
+ }
833
+ : d.effective_allowed_apps_user_api_scopes !== undefined
834
+ ? {
835
+ $case: 'effectiveAllowedAppsUserApiScopes' as const,
836
+ effectiveAllowedAppsUserApiScopes:
837
+ d.effective_allowed_apps_user_api_scopes,
838
+ }
839
+ : d.effective_operational_email_custom_recipient !==
840
+ undefined
841
+ ? {
842
+ $case:
843
+ 'effectiveOperationalEmailCustomRecipient' as const,
844
+ effectiveOperationalEmailCustomRecipient:
845
+ d.effective_operational_email_custom_recipient,
846
+ }
847
+ : undefined,
848
+ }));
849
+
850
+ export const unmarshalSettingsMetadataSchema: z.ZodType<SettingsMetadata> = z
851
+ .object({
852
+ name: z.string().optional(),
853
+ description: z.string().optional(),
854
+ type: z.string().optional(),
855
+ docs_link: z.string().optional(),
856
+ preview_phase: z.enum(PreviewPhase).optional(),
857
+ display_name: z.string().optional(),
858
+ })
859
+ .transform(d => ({
860
+ name: d.name,
861
+ description: d.description,
862
+ type: d.type,
863
+ docsLink: d.docs_link,
864
+ previewPhase: d.preview_phase,
865
+ displayName: d.display_name,
866
+ }));
867
+
868
+ export const unmarshalStringMessageSchema: z.ZodType<StringMessage> = z
869
+ .object({
870
+ value: z.string().optional(),
871
+ })
872
+ .transform(d => ({
873
+ value: d.value,
874
+ }));
875
+
876
+ export const unmarshalUserPreferenceSchema: z.ZodType<UserPreference> = z
877
+ .object({
878
+ name: z.string().optional(),
879
+ user_id: z.string().optional(),
880
+ boolean_val: z.lazy(() => unmarshalBooleanMessageSchema).optional(),
881
+ string_val: z.lazy(() => unmarshalStringMessageSchema).optional(),
882
+ effective_boolean_val: z
883
+ .lazy(() => unmarshalBooleanMessageSchema)
884
+ .optional(),
885
+ effective_string_val: z.lazy(() => unmarshalStringMessageSchema).optional(),
886
+ })
887
+ .transform(d => ({
888
+ name: d.name,
889
+ userId: d.user_id,
890
+ value:
891
+ d.boolean_val !== undefined
892
+ ? {$case: 'booleanVal' as const, booleanVal: d.boolean_val}
893
+ : d.string_val !== undefined
894
+ ? {$case: 'stringVal' as const, stringVal: d.string_val}
895
+ : undefined,
896
+ effectiveValue:
897
+ d.effective_boolean_val !== undefined
898
+ ? {
899
+ $case: 'effectiveBooleanVal' as const,
900
+ effectiveBooleanVal: d.effective_boolean_val,
901
+ }
902
+ : d.effective_string_val !== undefined
903
+ ? {
904
+ $case: 'effectiveStringVal' as const,
905
+ effectiveStringVal: d.effective_string_val,
906
+ }
907
+ : undefined,
908
+ }));
909
+
910
+ export const marshalAibiDashboardEmbeddingAccessPolicySchema: z.ZodType = z
911
+ .object({
912
+ accessPolicyType: z
913
+ .enum(AibiDashboardEmbeddingAccessPolicy_AccessPolicyType)
914
+ .optional(),
915
+ })
916
+ .transform(d => ({
917
+ access_policy_type: d.accessPolicyType,
918
+ }));
919
+
920
+ export const marshalAibiDashboardEmbeddingApprovedDomainsSchema: z.ZodType = z
921
+ .object({
922
+ approvedDomains: z.array(z.string()).optional(),
923
+ })
924
+ .transform(d => ({
925
+ approved_domains: d.approvedDomains,
926
+ }));
927
+
928
+ export const marshalAllowedAppsUserApiScopesMessageSchema: z.ZodType = z
929
+ .object({
930
+ allowedScopes: z.array(z.string()).optional(),
931
+ })
932
+ .transform(d => ({
933
+ allowed_scopes: d.allowedScopes,
934
+ }));
935
+
936
+ export const marshalBooleanMessageSchema: z.ZodType = z
937
+ .object({
938
+ value: z.boolean().optional(),
939
+ })
940
+ .transform(d => ({
941
+ value: d.value,
942
+ }));
943
+
944
+ export const marshalClusterAutoRestartMessageSchema: z.ZodType = z
945
+ .object({
946
+ enabled: z.boolean().optional(),
947
+ canToggle: z.boolean().optional(),
948
+ maintenanceWindow: z
949
+ .lazy(() => marshalClusterAutoRestartMessage_MaintenanceWindowSchema)
950
+ .optional(),
951
+ enablementDetails: z
952
+ .lazy(() => marshalClusterAutoRestartMessage_EnablementDetailsSchema)
953
+ .optional(),
954
+ restartEvenIfNoUpdatesAvailable: z.boolean().optional(),
955
+ })
956
+ .transform(d => ({
957
+ enabled: d.enabled,
958
+ can_toggle: d.canToggle,
959
+ maintenance_window: d.maintenanceWindow,
960
+ enablement_details: d.enablementDetails,
961
+ restart_even_if_no_updates_available: d.restartEvenIfNoUpdatesAvailable,
962
+ }));
963
+
964
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
965
+ export const marshalClusterAutoRestartMessage_EnablementDetailsSchema: z.ZodType =
966
+ z
967
+ .object({
968
+ unavailableForNonEnterpriseTier: z.boolean().optional(),
969
+ unavailableForDisabledEntitlement: z.boolean().optional(),
970
+ forcedForComplianceMode: z.boolean().optional(),
971
+ })
972
+ .transform(d => ({
973
+ unavailable_for_non_enterprise_tier: d.unavailableForNonEnterpriseTier,
974
+ unavailable_for_disabled_entitlement: d.unavailableForDisabledEntitlement,
975
+ forced_for_compliance_mode: d.forcedForComplianceMode,
976
+ }));
977
+
978
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
979
+ export const marshalClusterAutoRestartMessage_MaintenanceWindowSchema: z.ZodType =
980
+ z
981
+ .object({
982
+ weekDayBasedSchedule: z
983
+ .lazy(
984
+ () =>
985
+ marshalClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleSchema
986
+ )
987
+ .optional(),
988
+ })
989
+ .transform(d => ({
990
+ week_day_based_schedule: d.weekDayBasedSchedule,
991
+ }));
992
+
993
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
994
+ export const marshalClusterAutoRestartMessage_MaintenanceWindow_WeekDayBasedScheduleSchema: z.ZodType =
995
+ z
996
+ .object({
997
+ frequency: z
998
+ .enum(ClusterAutoRestartMessage_MaintenanceWindow_WeekDayFrequency)
999
+ .optional(),
1000
+ dayOfWeek: z
1001
+ .enum(ClusterAutoRestartMessage_MaintenanceWindow_DayOfWeek)
1002
+ .optional(),
1003
+ windowStartTime: z
1004
+ .lazy(
1005
+ () =>
1006
+ marshalClusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeSchema
1007
+ )
1008
+ .optional(),
1009
+ })
1010
+ .transform(d => ({
1011
+ frequency: d.frequency,
1012
+ day_of_week: d.dayOfWeek,
1013
+ window_start_time: d.windowStartTime,
1014
+ }));
1015
+
1016
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
1017
+ export const marshalClusterAutoRestartMessage_MaintenanceWindow_WindowStartTimeSchema: z.ZodType =
1018
+ z
1019
+ .object({
1020
+ hours: z.number().optional(),
1021
+ minutes: z.number().optional(),
1022
+ })
1023
+ .transform(d => ({
1024
+ hours: d.hours,
1025
+ minutes: d.minutes,
1026
+ }));
1027
+
1028
+ export const marshalIntegerMessageSchema: z.ZodType = z
1029
+ .object({
1030
+ value: z.number().optional(),
1031
+ })
1032
+ .transform(d => ({
1033
+ value: d.value,
1034
+ }));
1035
+
1036
+ export const marshalOperationalEmailCustomRecipientMessageSchema: z.ZodType = z
1037
+ .object({
1038
+ email: z.string().optional(),
1039
+ })
1040
+ .transform(d => ({
1041
+ email: d.email,
1042
+ }));
1043
+
1044
+ export const marshalPersonalComputeMessageSchema: z.ZodType = z
1045
+ .object({
1046
+ value: z.enum(PersonalComputeMessage_PersonalComputeMessageEnum).optional(),
1047
+ })
1048
+ .transform(d => ({
1049
+ value: d.value,
1050
+ }));
1051
+
1052
+ export const marshalRestrictWorkspaceAdminsMessageSchema: z.ZodType = z
1053
+ .object({
1054
+ status: z.enum(RestrictWorkspaceAdminsMessage_Status).optional(),
1055
+ disableGovTagCreation: z.boolean().optional(),
1056
+ })
1057
+ .transform(d => ({
1058
+ status: d.status,
1059
+ disable_gov_tag_creation: d.disableGovTagCreation,
1060
+ }));
1061
+
1062
+ export const marshalSettingSchema: z.ZodType = z
1063
+ .object({
1064
+ name: z.string().optional(),
1065
+ value: z
1066
+ .discriminatedUnion('$case', [
1067
+ z.object({
1068
+ $case: z.literal('booleanVal'),
1069
+ booleanVal: z.lazy(() => marshalBooleanMessageSchema),
1070
+ }),
1071
+ z.object({
1072
+ $case: z.literal('stringVal'),
1073
+ stringVal: z.lazy(() => marshalStringMessageSchema),
1074
+ }),
1075
+ z.object({
1076
+ $case: z.literal('integerVal'),
1077
+ integerVal: z.lazy(() => marshalIntegerMessageSchema),
1078
+ }),
1079
+ z.object({
1080
+ $case: z.literal('automaticClusterUpdateWorkspace'),
1081
+ automaticClusterUpdateWorkspace: z.lazy(
1082
+ () => marshalClusterAutoRestartMessageSchema
1083
+ ),
1084
+ }),
1085
+ z.object({
1086
+ $case: z.literal('aibiDashboardEmbeddingApprovedDomains'),
1087
+ aibiDashboardEmbeddingApprovedDomains: z.lazy(
1088
+ () => marshalAibiDashboardEmbeddingApprovedDomainsSchema
1089
+ ),
1090
+ }),
1091
+ z.object({
1092
+ $case: z.literal('aibiDashboardEmbeddingAccessPolicy'),
1093
+ aibiDashboardEmbeddingAccessPolicy: z.lazy(
1094
+ () => marshalAibiDashboardEmbeddingAccessPolicySchema
1095
+ ),
1096
+ }),
1097
+ z.object({
1098
+ $case: z.literal('restrictWorkspaceAdmins'),
1099
+ restrictWorkspaceAdmins: z.lazy(
1100
+ () => marshalRestrictWorkspaceAdminsMessageSchema
1101
+ ),
1102
+ }),
1103
+ z.object({
1104
+ $case: z.literal('personalCompute'),
1105
+ personalCompute: z.lazy(() => marshalPersonalComputeMessageSchema),
1106
+ }),
1107
+ z.object({
1108
+ $case: z.literal('allowedAppsUserApiScopes'),
1109
+ allowedAppsUserApiScopes: z.lazy(
1110
+ () => marshalAllowedAppsUserApiScopesMessageSchema
1111
+ ),
1112
+ }),
1113
+ z.object({
1114
+ $case: z.literal('operationalEmailCustomRecipient'),
1115
+ operationalEmailCustomRecipient: z.lazy(
1116
+ () => marshalOperationalEmailCustomRecipientMessageSchema
1117
+ ),
1118
+ }),
1119
+ ])
1120
+ .optional(),
1121
+ effectiveValue: z
1122
+ .discriminatedUnion('$case', [
1123
+ z.object({
1124
+ $case: z.literal('effectiveBooleanVal'),
1125
+ effectiveBooleanVal: z.lazy(() => marshalBooleanMessageSchema),
1126
+ }),
1127
+ z.object({
1128
+ $case: z.literal('effectiveStringVal'),
1129
+ effectiveStringVal: z.lazy(() => marshalStringMessageSchema),
1130
+ }),
1131
+ z.object({
1132
+ $case: z.literal('effectiveIntegerVal'),
1133
+ effectiveIntegerVal: z.lazy(() => marshalIntegerMessageSchema),
1134
+ }),
1135
+ z.object({
1136
+ $case: z.literal('effectiveAutomaticClusterUpdateWorkspace'),
1137
+ effectiveAutomaticClusterUpdateWorkspace: z.lazy(
1138
+ () => marshalClusterAutoRestartMessageSchema
1139
+ ),
1140
+ }),
1141
+ z.object({
1142
+ $case: z.literal('effectiveAibiDashboardEmbeddingApprovedDomains'),
1143
+ effectiveAibiDashboardEmbeddingApprovedDomains: z.lazy(
1144
+ () => marshalAibiDashboardEmbeddingApprovedDomainsSchema
1145
+ ),
1146
+ }),
1147
+ z.object({
1148
+ $case: z.literal('effectiveAibiDashboardEmbeddingAccessPolicy'),
1149
+ effectiveAibiDashboardEmbeddingAccessPolicy: z.lazy(
1150
+ () => marshalAibiDashboardEmbeddingAccessPolicySchema
1151
+ ),
1152
+ }),
1153
+ z.object({
1154
+ $case: z.literal('effectiveRestrictWorkspaceAdmins'),
1155
+ effectiveRestrictWorkspaceAdmins: z.lazy(
1156
+ () => marshalRestrictWorkspaceAdminsMessageSchema
1157
+ ),
1158
+ }),
1159
+ z.object({
1160
+ $case: z.literal('effectivePersonalCompute'),
1161
+ effectivePersonalCompute: z.lazy(
1162
+ () => marshalPersonalComputeMessageSchema
1163
+ ),
1164
+ }),
1165
+ z.object({
1166
+ $case: z.literal('effectiveAllowedAppsUserApiScopes'),
1167
+ effectiveAllowedAppsUserApiScopes: z.lazy(
1168
+ () => marshalAllowedAppsUserApiScopesMessageSchema
1169
+ ),
1170
+ }),
1171
+ z.object({
1172
+ $case: z.literal('effectiveOperationalEmailCustomRecipient'),
1173
+ effectiveOperationalEmailCustomRecipient: z.lazy(
1174
+ () => marshalOperationalEmailCustomRecipientMessageSchema
1175
+ ),
1176
+ }),
1177
+ ])
1178
+ .optional(),
1179
+ })
1180
+ .transform(d => ({
1181
+ name: d.name,
1182
+ ...(d.value?.$case === 'booleanVal' && {boolean_val: d.value.booleanVal}),
1183
+ ...(d.value?.$case === 'stringVal' && {string_val: d.value.stringVal}),
1184
+ ...(d.value?.$case === 'integerVal' && {integer_val: d.value.integerVal}),
1185
+ ...(d.value?.$case === 'automaticClusterUpdateWorkspace' && {
1186
+ automatic_cluster_update_workspace:
1187
+ d.value.automaticClusterUpdateWorkspace,
1188
+ }),
1189
+ ...(d.value?.$case === 'aibiDashboardEmbeddingApprovedDomains' && {
1190
+ aibi_dashboard_embedding_approved_domains:
1191
+ d.value.aibiDashboardEmbeddingApprovedDomains,
1192
+ }),
1193
+ ...(d.value?.$case === 'aibiDashboardEmbeddingAccessPolicy' && {
1194
+ aibi_dashboard_embedding_access_policy:
1195
+ d.value.aibiDashboardEmbeddingAccessPolicy,
1196
+ }),
1197
+ ...(d.value?.$case === 'restrictWorkspaceAdmins' && {
1198
+ restrict_workspace_admins: d.value.restrictWorkspaceAdmins,
1199
+ }),
1200
+ ...(d.value?.$case === 'personalCompute' && {
1201
+ personal_compute: d.value.personalCompute,
1202
+ }),
1203
+ ...(d.value?.$case === 'allowedAppsUserApiScopes' && {
1204
+ allowed_apps_user_api_scopes: d.value.allowedAppsUserApiScopes,
1205
+ }),
1206
+ ...(d.value?.$case === 'operationalEmailCustomRecipient' && {
1207
+ operational_email_custom_recipient:
1208
+ d.value.operationalEmailCustomRecipient,
1209
+ }),
1210
+ ...(d.effectiveValue?.$case === 'effectiveBooleanVal' && {
1211
+ effective_boolean_val: d.effectiveValue.effectiveBooleanVal,
1212
+ }),
1213
+ ...(d.effectiveValue?.$case === 'effectiveStringVal' && {
1214
+ effective_string_val: d.effectiveValue.effectiveStringVal,
1215
+ }),
1216
+ ...(d.effectiveValue?.$case === 'effectiveIntegerVal' && {
1217
+ effective_integer_val: d.effectiveValue.effectiveIntegerVal,
1218
+ }),
1219
+ ...(d.effectiveValue?.$case ===
1220
+ 'effectiveAutomaticClusterUpdateWorkspace' && {
1221
+ effective_automatic_cluster_update_workspace:
1222
+ d.effectiveValue.effectiveAutomaticClusterUpdateWorkspace,
1223
+ }),
1224
+ ...(d.effectiveValue?.$case ===
1225
+ 'effectiveAibiDashboardEmbeddingApprovedDomains' && {
1226
+ effective_aibi_dashboard_embedding_approved_domains:
1227
+ d.effectiveValue.effectiveAibiDashboardEmbeddingApprovedDomains,
1228
+ }),
1229
+ ...(d.effectiveValue?.$case ===
1230
+ 'effectiveAibiDashboardEmbeddingAccessPolicy' && {
1231
+ effective_aibi_dashboard_embedding_access_policy:
1232
+ d.effectiveValue.effectiveAibiDashboardEmbeddingAccessPolicy,
1233
+ }),
1234
+ ...(d.effectiveValue?.$case === 'effectiveRestrictWorkspaceAdmins' && {
1235
+ effective_restrict_workspace_admins:
1236
+ d.effectiveValue.effectiveRestrictWorkspaceAdmins,
1237
+ }),
1238
+ ...(d.effectiveValue?.$case === 'effectivePersonalCompute' && {
1239
+ effective_personal_compute: d.effectiveValue.effectivePersonalCompute,
1240
+ }),
1241
+ ...(d.effectiveValue?.$case === 'effectiveAllowedAppsUserApiScopes' && {
1242
+ effective_allowed_apps_user_api_scopes:
1243
+ d.effectiveValue.effectiveAllowedAppsUserApiScopes,
1244
+ }),
1245
+ ...(d.effectiveValue?.$case ===
1246
+ 'effectiveOperationalEmailCustomRecipient' && {
1247
+ effective_operational_email_custom_recipient:
1248
+ d.effectiveValue.effectiveOperationalEmailCustomRecipient,
1249
+ }),
1250
+ }));
1251
+
1252
+ export const marshalStringMessageSchema: z.ZodType = z
1253
+ .object({
1254
+ value: z.string().optional(),
1255
+ })
1256
+ .transform(d => ({
1257
+ value: d.value,
1258
+ }));
1259
+
1260
+ export const marshalUserPreferenceSchema: z.ZodType = z
1261
+ .object({
1262
+ name: z.string().optional(),
1263
+ userId: z.string().optional(),
1264
+ value: z
1265
+ .discriminatedUnion('$case', [
1266
+ z.object({
1267
+ $case: z.literal('booleanVal'),
1268
+ booleanVal: z.lazy(() => marshalBooleanMessageSchema),
1269
+ }),
1270
+ z.object({
1271
+ $case: z.literal('stringVal'),
1272
+ stringVal: z.lazy(() => marshalStringMessageSchema),
1273
+ }),
1274
+ ])
1275
+ .optional(),
1276
+ effectiveValue: z
1277
+ .discriminatedUnion('$case', [
1278
+ z.object({
1279
+ $case: z.literal('effectiveBooleanVal'),
1280
+ effectiveBooleanVal: z.lazy(() => marshalBooleanMessageSchema),
1281
+ }),
1282
+ z.object({
1283
+ $case: z.literal('effectiveStringVal'),
1284
+ effectiveStringVal: z.lazy(() => marshalStringMessageSchema),
1285
+ }),
1286
+ ])
1287
+ .optional(),
1288
+ })
1289
+ .transform(d => ({
1290
+ name: d.name,
1291
+ user_id: d.userId,
1292
+ ...(d.value?.$case === 'booleanVal' && {boolean_val: d.value.booleanVal}),
1293
+ ...(d.value?.$case === 'stringVal' && {string_val: d.value.stringVal}),
1294
+ ...(d.effectiveValue?.$case === 'effectiveBooleanVal' && {
1295
+ effective_boolean_val: d.effectiveValue.effectiveBooleanVal,
1296
+ }),
1297
+ ...(d.effectiveValue?.$case === 'effectiveStringVal' && {
1298
+ effective_string_val: d.effectiveValue.effectiveStringVal,
1299
+ }),
1300
+ }));