Skip to content

Commit e373740

Browse files
committed
seperate request and response
1 parent 4631304 commit e373740

173 files changed

Lines changed: 31082 additions & 12353 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.

package-lock.json

Lines changed: 334 additions & 334 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/accessmanagement/src/v1/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export type {
1919
CheckPolicyRequest,
2020
CheckPolicyResponse,
2121
ConsistencyToken,
22+
CreateAccessControlRequest,
23+
CreateCreateGrantRule,
24+
CreateCreateRuleSetUpdateRequest,
25+
CreateGrantRule,
26+
CreateRuleSetUpdateRequest,
2227
DeleteWorkspacePermissionAssignmentRequest,
2328
DeleteWorkspacePermissionAssignmentResponse,
2429
GetObjectPermissionsRequest,

packages/accessmanagement/src/v1/model.ts

Lines changed: 124 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,87 @@ export interface ConsistencyToken {
131131
value?: string | undefined;
132132
}
133133

134+
export interface CreateAccessControlRequest {
135+
principalName?:
136+
| {
137+
$case: 'userName';
138+
/** name of the user */
139+
userName: string;
140+
}
141+
| {
142+
$case: 'groupName';
143+
/** name of the group */
144+
groupName: string;
145+
}
146+
| {
147+
$case: 'servicePrincipalName';
148+
/** application ID of a service principal */
149+
servicePrincipalName: string;
150+
}
151+
| undefined;
152+
permissionLevel?: PermissionLevel | undefined;
153+
}
154+
155+
export interface CreateCreateGrantRule {
156+
/**
157+
* Principals this grant rule applies to.
158+
* A principal can be a user (for end users), a service principal (for applications and
159+
* compute workloads), or an account group. Each principal has its own identifier format:
160+
* * users/<USERNAME>
161+
* * groups/<GROUP_NAME>
162+
* * servicePrincipals/<SERVICE_PRINCIPAL_APPLICATION_ID>
163+
*/
164+
principals?: string[] | undefined;
165+
/** Role that is assigned to the list of principals. */
166+
role: string;
167+
}
168+
169+
export interface CreateCreateRuleSetUpdateRequest {
170+
/** Name of the rule set. */
171+
name: string;
172+
/**
173+
* Identifies the version of the rule set returned.
174+
* Etag used for versioning. The response is at least as fresh as the eTag provided.
175+
* Etag is used for optimistic concurrency control as a way to help prevent simultaneous
176+
* updates of a rule set from overwriting each other. It is strongly suggested that systems
177+
* make use of the etag in the read -> modify -> write pattern to perform rule set updates in
178+
* order to avoid race conditions that is get an etag from a GET rule set request, and pass it
179+
* with the PUT update request to identify the rule set version you are updating.
180+
*/
181+
etag: string;
182+
grantRules?: CreateCreateGrantRule[] | undefined;
183+
}
184+
185+
export interface CreateGrantRule {
186+
/**
187+
* Principals this grant rule applies to.
188+
* A principal can be a user (for end users), a service principal (for applications and
189+
* compute workloads), or an account group. Each principal has its own identifier format:
190+
* * users/<USERNAME>
191+
* * groups/<GROUP_NAME>
192+
* * servicePrincipals/<SERVICE_PRINCIPAL_APPLICATION_ID>
193+
*/
194+
principals?: string[] | undefined;
195+
/** Role that is assigned to the list of principals. */
196+
role: string;
197+
}
198+
199+
export interface CreateRuleSetUpdateRequest {
200+
/** Name of the rule set. */
201+
name: string;
202+
/**
203+
* Identifies the version of the rule set returned.
204+
* Etag used for versioning. The response is at least as fresh as the eTag provided.
205+
* Etag is used for optimistic concurrency control as a way to help prevent simultaneous
206+
* updates of a rule set from overwriting each other. It is strongly suggested that systems
207+
* make use of the etag in the read -> modify -> write pattern to perform rule set updates in
208+
* order to avoid race conditions that is get an etag from a GET rule set request, and pass it
209+
* with the PUT update request to identify the rule set version you are updating.
210+
*/
211+
etag: string;
212+
grantRules?: CreateGrantRule[] | undefined;
213+
}
214+
134215
/** Removes all permission assignments for a workspace given a principal. */
135216
export interface DeleteWorkspacePermissionAssignmentRequest {
136217
/** The account ID. */
@@ -350,23 +431,23 @@ export interface SetObjectPermissionsRequest {
350431
requestObjectType?: string | undefined;
351432
/** The id of the request object. */
352433
requestObjectId?: string | undefined;
353-
accessControlList?: AccessControlRequest[] | undefined;
434+
accessControlList?: CreateAccessControlRequest[] | undefined;
354435
}
355436

356437
export interface UpdateObjectPermissionsRequest {
357438
/** The type of the request object. Can be one of the following: alerts, alertsv2, authorization, clusters, cluster-policies, dashboards, database-projects, dbsql-dashboards, directories, experiments, files, genie, instance-pools, jobs, knowledge-assistants, notebooks, pipelines, queries, registered-models, repos, serving-endpoints, supervisor-agents, vector-search-endpoints, or warehouses. */
358439
requestObjectType?: string | undefined;
359440
/** The id of the request object. */
360441
requestObjectId?: string | undefined;
361-
accessControlList?: AccessControlRequest[] | undefined;
442+
accessControlList?: CreateAccessControlRequest[] | undefined;
362443
}
363444

364445
export interface UpdateRuleSetRequest {
365446
/** <Databricks> account ID. */
366447
accountId?: string | undefined;
367448
/** Name of the rule set. */
368449
name?: string | undefined;
369-
ruleSet?: RuleSetUpdateRequest | undefined;
450+
ruleSet?: CreateCreateRuleSetUpdateRequest | undefined;
370451
}
371452

372453
export interface UpdateWorkspacePermissionAssignmentRequest {
@@ -610,7 +691,27 @@ export const unmarshalWorkspacePermissionAssignmentOutputSchema: z.ZodType<Works
610691
error: d.error,
611692
}));
612693

613-
export const marshalAccessControlRequestSchema: z.ZodType = z
694+
export const marshalActorSchema: z.ZodType = z
695+
.object({
696+
kind: z
697+
.discriminatedUnion('$case', [
698+
z.object({$case: z.literal('actorId'), actorId: z.bigint()}),
699+
])
700+
.optional(),
701+
})
702+
.transform(d => ({
703+
...(d.kind?.$case === 'actorId' && {actor_id: d.kind.actorId}),
704+
}));
705+
706+
export const marshalConsistencyTokenSchema: z.ZodType = z
707+
.object({
708+
value: z.string().optional(),
709+
})
710+
.transform(d => ({
711+
value: d.value,
712+
}));
713+
714+
export const marshalCreateAccessControlRequestSchema: z.ZodType = z
614715
.object({
615716
principalName: z
616717
.discriminatedUnion('$case', [
@@ -637,34 +738,28 @@ export const marshalAccessControlRequestSchema: z.ZodType = z
637738
permission_level: d.permissionLevel,
638739
}));
639740

640-
export const marshalActorSchema: z.ZodType = z
641-
.object({
642-
kind: z
643-
.discriminatedUnion('$case', [
644-
z.object({$case: z.literal('actorId'), actorId: z.bigint()}),
645-
])
646-
.optional(),
647-
})
648-
.transform(d => ({
649-
...(d.kind?.$case === 'actorId' && {actor_id: d.kind.actorId}),
650-
}));
651-
652-
export const marshalConsistencyTokenSchema: z.ZodType = z
741+
export const marshalCreateCreateGrantRuleSchema: z.ZodType = z
653742
.object({
654-
value: z.string().optional(),
743+
principals: z.array(z.string()).optional(),
744+
role: z.string(),
655745
})
656746
.transform(d => ({
657-
value: d.value,
747+
principals: d.principals,
748+
role: d.role,
658749
}));
659750

660-
export const marshalGrantRuleSchema: z.ZodType = z
751+
export const marshalCreateCreateRuleSetUpdateRequestSchema: z.ZodType = z
661752
.object({
662-
principals: z.array(z.string()).optional(),
663-
role: z.string().optional(),
753+
name: z.string(),
754+
etag: z.string(),
755+
grantRules: z
756+
.array(z.lazy(() => marshalCreateCreateGrantRuleSchema))
757+
.optional(),
664758
})
665759
.transform(d => ({
666-
principals: d.principals,
667-
role: d.role,
760+
name: d.name,
761+
etag: d.etag,
762+
grant_rules: d.grantRules,
668763
}));
669764

670765
export const marshalResourceInfoSchema: z.ZodType = z
@@ -679,24 +774,12 @@ export const marshalResourceInfoSchema: z.ZodType = z
679774
legacy_acl_path: d.legacyAclPath,
680775
}));
681776

682-
export const marshalRuleSetUpdateRequestSchema: z.ZodType = z
683-
.object({
684-
name: z.string().optional(),
685-
etag: z.string().optional(),
686-
grantRules: z.array(z.lazy(() => marshalGrantRuleSchema)).optional(),
687-
})
688-
.transform(d => ({
689-
name: d.name,
690-
etag: d.etag,
691-
grant_rules: d.grantRules,
692-
}));
693-
694777
export const marshalSetObjectPermissionsRequestSchema: z.ZodType = z
695778
.object({
696779
requestObjectType: z.string().optional(),
697780
requestObjectId: z.string().optional(),
698781
accessControlList: z
699-
.array(z.lazy(() => marshalAccessControlRequestSchema))
782+
.array(z.lazy(() => marshalCreateAccessControlRequestSchema))
700783
.optional(),
701784
})
702785
.transform(d => ({
@@ -710,7 +793,7 @@ export const marshalUpdateObjectPermissionsRequestSchema: z.ZodType = z
710793
requestObjectType: z.string().optional(),
711794
requestObjectId: z.string().optional(),
712795
accessControlList: z
713-
.array(z.lazy(() => marshalAccessControlRequestSchema))
796+
.array(z.lazy(() => marshalCreateAccessControlRequestSchema))
714797
.optional(),
715798
})
716799
.transform(d => ({
@@ -723,7 +806,9 @@ export const marshalUpdateRuleSetRequestSchema: z.ZodType = z
723806
.object({
724807
accountId: z.string().optional(),
725808
name: z.string().optional(),
726-
ruleSet: z.lazy(() => marshalRuleSetUpdateRequestSchema).optional(),
809+
ruleSet: z
810+
.lazy(() => marshalCreateCreateRuleSetUpdateRequestSchema)
811+
.optional(),
727812
})
728813
.transform(d => ({
729814
account_id: d.accountId,

packages/alerts/src/v1/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,26 @@ export type {
1414
AlertOperand,
1515
AlertOperandColumn,
1616
AlertOperandValue,
17+
CreateAlertCondition,
18+
CreateAlertOperand,
19+
CreateAlertOperandColumn,
20+
CreateAlertOperandValue,
1721
CreateAlertRequest,
1822
CreateAlertRequestAlert,
23+
CreateCreateAlertRequestAlert,
1924
Empty,
2025
GetAlertRequest,
2126
ListAlertsRequest,
2227
ListAlertsResponse,
2328
ListAlertsResponseAlert,
2429
TrashAlertRequest,
30+
UpdateAlertCondition,
31+
UpdateAlertOperand,
32+
UpdateAlertOperandColumn,
33+
UpdateAlertOperandValue,
2534
UpdateAlertRequest,
2635
UpdateAlertRequestAlert,
36+
UpdateUpdateAlertRequestAlert,
2737
} from './model';
2838

29-
export {updateAlertRequestAlertFieldMask} from './model';
39+
export {updateUpdateAlertRequestAlertFieldMask} from './model';

0 commit comments

Comments
 (0)