Skip to content

Commit 3e2bff8

Browse files
committed
Update SDK with latest state of Generator
1 parent b835c01 commit 3e2bff8

68 files changed

Lines changed: 6654 additions & 5121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/accessmanagement/src/v1/model.ts

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,58 @@
33
import {z} from 'zod';
44

55
/** Permission level */
6-
export enum PermissionLevel {
7-
CAN_MANAGE = 'CAN_MANAGE',
8-
CAN_RESTART = 'CAN_RESTART',
9-
CAN_ATTACH_TO = 'CAN_ATTACH_TO',
10-
IS_OWNER = 'IS_OWNER',
11-
CAN_MANAGE_RUN = 'CAN_MANAGE_RUN',
12-
CAN_VIEW = 'CAN_VIEW',
13-
CAN_READ = 'CAN_READ',
14-
CAN_RUN = 'CAN_RUN',
15-
CAN_EDIT = 'CAN_EDIT',
16-
CAN_USE = 'CAN_USE',
17-
CAN_MANAGE_STAGING_VERSIONS = 'CAN_MANAGE_STAGING_VERSIONS',
18-
CAN_MANAGE_PRODUCTION_VERSIONS = 'CAN_MANAGE_PRODUCTION_VERSIONS',
19-
CAN_EDIT_METADATA = 'CAN_EDIT_METADATA',
20-
CAN_VIEW_METADATA = 'CAN_VIEW_METADATA',
21-
CAN_BIND = 'CAN_BIND',
22-
CAN_QUERY = 'CAN_QUERY',
23-
CAN_MONITOR = 'CAN_MONITOR',
24-
CAN_CREATE = 'CAN_CREATE',
25-
CAN_MONITOR_ONLY = 'CAN_MONITOR_ONLY',
26-
CAN_CREATE_APP = 'CAN_CREATE_APP',
27-
}
6+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
7+
export const PermissionLevel = {
8+
CAN_MANAGE: 'CAN_MANAGE',
9+
CAN_RESTART: 'CAN_RESTART',
10+
CAN_ATTACH_TO: 'CAN_ATTACH_TO',
11+
IS_OWNER: 'IS_OWNER',
12+
CAN_MANAGE_RUN: 'CAN_MANAGE_RUN',
13+
CAN_VIEW: 'CAN_VIEW',
14+
CAN_READ: 'CAN_READ',
15+
CAN_RUN: 'CAN_RUN',
16+
CAN_EDIT: 'CAN_EDIT',
17+
CAN_USE: 'CAN_USE',
18+
CAN_MANAGE_STAGING_VERSIONS: 'CAN_MANAGE_STAGING_VERSIONS',
19+
CAN_MANAGE_PRODUCTION_VERSIONS: 'CAN_MANAGE_PRODUCTION_VERSIONS',
20+
CAN_EDIT_METADATA: 'CAN_EDIT_METADATA',
21+
CAN_VIEW_METADATA: 'CAN_VIEW_METADATA',
22+
CAN_BIND: 'CAN_BIND',
23+
CAN_QUERY: 'CAN_QUERY',
24+
CAN_MONITOR: 'CAN_MONITOR',
25+
CAN_CREATE: 'CAN_CREATE',
26+
CAN_MONITOR_ONLY: 'CAN_MONITOR_ONLY',
27+
CAN_CREATE_APP: 'CAN_CREATE_APP',
28+
} as const;
29+
export type PermissionLevel =
30+
| (typeof PermissionLevel)[keyof typeof PermissionLevel]
31+
| (string & {});
2832

2933
/**
3034
* Defines the identity to be used for authZ of the request on the server side. See one pager for
3135
* for more information: http://go/acl/service-identity
3236
*/
33-
export enum RequestAuthzIdentity {
34-
REQUEST_AUTHZ_IDENTITY_UNSPECIFIED = 'REQUEST_AUTHZ_IDENTITY_UNSPECIFIED',
35-
REQUEST_AUTHZ_IDENTITY_USER_CONTEXT = 'REQUEST_AUTHZ_IDENTITY_USER_CONTEXT',
36-
REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY = 'REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY',
37-
}
38-
39-
export enum WorkspacePermission {
40-
UNKNOWN = 'UNKNOWN',
37+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
38+
export const RequestAuthzIdentity = {
39+
REQUEST_AUTHZ_IDENTITY_UNSPECIFIED: 'REQUEST_AUTHZ_IDENTITY_UNSPECIFIED',
40+
REQUEST_AUTHZ_IDENTITY_USER_CONTEXT: 'REQUEST_AUTHZ_IDENTITY_USER_CONTEXT',
41+
REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY:
42+
'REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY',
43+
} as const;
44+
export type RequestAuthzIdentity =
45+
| (typeof RequestAuthzIdentity)[keyof typeof RequestAuthzIdentity]
46+
| (string & {});
47+
48+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
49+
export const WorkspacePermission = {
50+
UNKNOWN: 'UNKNOWN',
4151
/** The most basic workspace permission */
42-
USER = 'USER',
43-
ADMIN = 'ADMIN',
44-
}
52+
USER: 'USER',
53+
ADMIN: 'ADMIN',
54+
} as const;
55+
export type WorkspacePermission =
56+
| (typeof WorkspacePermission)[keyof typeof WorkspacePermission]
57+
| (string & {});
4558

4659
export interface AccessControlRequest {
4760
principalName?:
@@ -491,7 +504,7 @@ export const unmarshalListWorkspacePermissionsResponseSchema: z.ZodType<ListWork
491504

492505
export const unmarshalPermissionSchema: z.ZodType<Permission> = z
493506
.object({
494-
permission_level: z.enum(PermissionLevel).optional(),
507+
permission_level: z.string().optional(),
495508
inherited: z.boolean().optional(),
496509
inherited_from_object: z.array(z.string()).optional(),
497510
})
@@ -503,7 +516,7 @@ export const unmarshalPermissionSchema: z.ZodType<Permission> = z
503516

504517
export const unmarshalPermissionOutputSchema: z.ZodType<PermissionOutput> = z
505518
.object({
506-
permission_level: z.enum(WorkspacePermission).optional(),
519+
permission_level: z.string().optional(),
507520
description: z.string().optional(),
508521
})
509522
.transform(d => ({
@@ -514,7 +527,7 @@ export const unmarshalPermissionOutputSchema: z.ZodType<PermissionOutput> = z
514527
export const unmarshalPermissionsDescriptionSchema: z.ZodType<PermissionsDescription> =
515528
z
516529
.object({
517-
permission_level: z.enum(PermissionLevel).optional(),
530+
permission_level: z.string().optional(),
518531
description: z.string().optional(),
519532
})
520533
.transform(d => ({
@@ -588,7 +601,7 @@ export const unmarshalWorkspacePermissionAssignmentOutputSchema: z.ZodType<Works
588601
z
589602
.object({
590603
principal: z.lazy(() => unmarshalPrincipalOutputSchema).optional(),
591-
permissions: z.array(z.enum(WorkspacePermission)).optional(),
604+
permissions: z.array(z.string()).optional(),
592605
error: z.string().optional(),
593606
})
594607
.transform(d => ({
@@ -609,7 +622,7 @@ export const marshalAccessControlRequestSchema: z.ZodType = z
609622
}),
610623
])
611624
.optional(),
612-
permissionLevel: z.enum(PermissionLevel).optional(),
625+
permissionLevel: z.string().optional(),
613626
})
614627
.transform(d => ({
615628
...(d.principalName?.$case === 'userName' && {
@@ -724,7 +737,7 @@ export const marshalUpdateWorkspacePermissionAssignmentRequestSchema: z.ZodType
724737
accountId: z.string().optional(),
725738
workspaceId: z.bigint().optional(),
726739
principalId: z.bigint().optional(),
727-
permissions: z.array(z.enum(WorkspacePermission)).optional(),
740+
permissions: z.array(z.string()).optional(),
728741
})
729742
.transform(d => ({
730743
account_id: d.accountId,

packages/alerts/src/v1/model.ts

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,38 @@ import {FieldMask} from '@databricks/sdk-core/wkt';
55
import type {FieldMaskSchema} from '@databricks/sdk-core/wkt';
66
import {z} from 'zod';
77

8-
export enum AlertOperator {
9-
GREATER_THAN = 'GREATER_THAN',
10-
GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL',
11-
LESS_THAN = 'LESS_THAN',
12-
LESS_THAN_OR_EQUAL = 'LESS_THAN_OR_EQUAL',
13-
EQUAL = 'EQUAL',
14-
NOT_EQUAL = 'NOT_EQUAL',
15-
IS_NULL = 'IS_NULL',
16-
}
17-
18-
export enum AlertState {
19-
UNKNOWN = 'UNKNOWN',
20-
OK = 'OK',
21-
TRIGGERED = 'TRIGGERED',
22-
}
23-
24-
export enum LifecycleState {
25-
ACTIVE = 'ACTIVE',
26-
TRASHED = 'TRASHED',
27-
}
8+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
9+
export const AlertOperator = {
10+
GREATER_THAN: 'GREATER_THAN',
11+
GREATER_THAN_OR_EQUAL: 'GREATER_THAN_OR_EQUAL',
12+
LESS_THAN: 'LESS_THAN',
13+
LESS_THAN_OR_EQUAL: 'LESS_THAN_OR_EQUAL',
14+
EQUAL: 'EQUAL',
15+
NOT_EQUAL: 'NOT_EQUAL',
16+
IS_NULL: 'IS_NULL',
17+
} as const;
18+
export type AlertOperator =
19+
| (typeof AlertOperator)[keyof typeof AlertOperator]
20+
| (string & {});
21+
22+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
23+
export const AlertState = {
24+
UNKNOWN: 'UNKNOWN',
25+
OK: 'OK',
26+
TRIGGERED: 'TRIGGERED',
27+
} as const;
28+
export type AlertState =
29+
| (typeof AlertState)[keyof typeof AlertState]
30+
| (string & {});
31+
32+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
33+
export const LifecycleState = {
34+
ACTIVE: 'ACTIVE',
35+
TRASHED: 'TRASHED',
36+
} as const;
37+
export type LifecycleState =
38+
| (typeof LifecycleState)[keyof typeof LifecycleState]
39+
| (string & {});
2840

2941
export interface Alert {
3042
/** UUID identifying the alert. */
@@ -234,9 +246,9 @@ export const unmarshalAlertSchema: z.ZodType<Alert> = z
234246
id: z.string().optional(),
235247
display_name: z.string().optional(),
236248
query_id: z.string().optional(),
237-
state: z.enum(AlertState).optional(),
249+
state: z.string().optional(),
238250
seconds_to_retrigger: z.number().optional(),
239-
lifecycle_state: z.enum(LifecycleState).optional(),
251+
lifecycle_state: z.string().optional(),
240252
trigger_time: z
241253
.string()
242254
.transform(s => Temporal.Instant.from(s))
@@ -276,10 +288,10 @@ export const unmarshalAlertSchema: z.ZodType<Alert> = z
276288

277289
export const unmarshalAlertConditionSchema: z.ZodType<AlertCondition> = z
278290
.object({
279-
op: z.enum(AlertOperator).optional(),
291+
op: z.string().optional(),
280292
operand: z.lazy(() => unmarshalAlertOperandSchema).optional(),
281293
threshold: z.lazy(() => unmarshalAlertOperandSchema).optional(),
282-
empty_result_state: z.enum(AlertState).optional(),
294+
empty_result_state: z.string().optional(),
283295
})
284296
.transform(d => ({
285297
op: d.op,
@@ -349,9 +361,9 @@ export const unmarshalListAlertsResponseAlertSchema: z.ZodType<ListAlertsRespons
349361
id: z.string().optional(),
350362
display_name: z.string().optional(),
351363
query_id: z.string().optional(),
352-
state: z.enum(AlertState).optional(),
364+
state: z.string().optional(),
353365
seconds_to_retrigger: z.number().optional(),
354-
lifecycle_state: z.enum(LifecycleState).optional(),
366+
lifecycle_state: z.string().optional(),
355367
trigger_time: z
356368
.string()
357369
.transform(s => Temporal.Instant.from(s))
@@ -391,10 +403,10 @@ export const unmarshalListAlertsResponseAlertSchema: z.ZodType<ListAlertsRespons
391403

392404
export const marshalAlertConditionSchema: z.ZodType = z
393405
.object({
394-
op: z.enum(AlertOperator).optional(),
406+
op: z.string().optional(),
395407
operand: z.lazy(() => marshalAlertOperandSchema).optional(),
396408
threshold: z.lazy(() => marshalAlertOperandSchema).optional(),
397-
emptyResultState: z.enum(AlertState).optional(),
409+
emptyResultState: z.string().optional(),
398410
})
399411
.transform(d => ({
400412
op: d.op,
@@ -468,9 +480,9 @@ export const marshalCreateAlertRequestAlertSchema: z.ZodType = z
468480
id: z.string().optional(),
469481
displayName: z.string().optional(),
470482
queryId: z.string().optional(),
471-
state: z.enum(AlertState).optional(),
483+
state: z.string().optional(),
472484
secondsToRetrigger: z.number().optional(),
473-
lifecycleState: z.enum(LifecycleState).optional(),
485+
lifecycleState: z.string().optional(),
474486
triggerTime: z
475487
.any()
476488
.transform((d: Temporal.Instant) => d.toString())
@@ -530,9 +542,9 @@ export const marshalUpdateAlertRequestAlertSchema: z.ZodType = z
530542
id: z.string().optional(),
531543
displayName: z.string().optional(),
532544
queryId: z.string().optional(),
533-
state: z.enum(AlertState).optional(),
545+
state: z.string().optional(),
534546
secondsToRetrigger: z.number().optional(),
535-
lifecycleState: z.enum(LifecycleState).optional(),
547+
lifecycleState: z.string().optional(),
536548
triggerTime: z
537549
.any()
538550
.transform((d: Temporal.Instant) => d.toString())

0 commit comments

Comments
 (0)