Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
668 changes: 334 additions & 334 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions packages/accessmanagement/src/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export type {
CheckPolicyRequest,
CheckPolicyResponse,
ConsistencyToken,
CreateAccessControlRequest,
CreateCreateGrantRule,
CreateCreateRuleSetUpdateRequest,
CreateGrantRule,
CreateRuleSetUpdateRequest,
DeleteWorkspacePermissionAssignmentRequest,
DeleteWorkspacePermissionAssignmentResponse,
GetObjectPermissionsRequest,
Expand Down
163 changes: 124 additions & 39 deletions packages/accessmanagement/src/v1/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,87 @@ export interface ConsistencyToken {
value?: string | undefined;
}

export interface CreateAccessControlRequest {
principalName?:
| {
$case: 'userName';
/** name of the user */
userName: string;
}
| {
$case: 'groupName';
/** name of the group */
groupName: string;
}
| {
$case: 'servicePrincipalName';
/** application ID of a service principal */
servicePrincipalName: string;
}
| undefined;
permissionLevel?: PermissionLevel | undefined;
}

export interface CreateCreateGrantRule {
/**
* Principals this grant rule applies to.
* A principal can be a user (for end users), a service principal (for applications and
* compute workloads), or an account group. Each principal has its own identifier format:
* * users/<USERNAME>
* * groups/<GROUP_NAME>
* * servicePrincipals/<SERVICE_PRINCIPAL_APPLICATION_ID>
*/
principals?: string[] | undefined;
/** Role that is assigned to the list of principals. */
role: string;
}

export interface CreateCreateRuleSetUpdateRequest {
/** Name of the rule set. */
name: string;
/**
* Identifies the version of the rule set returned.
* Etag used for versioning. The response is at least as fresh as the eTag provided.
* Etag is used for optimistic concurrency control as a way to help prevent simultaneous
* updates of a rule set from overwriting each other. It is strongly suggested that systems
* make use of the etag in the read -> modify -> write pattern to perform rule set updates in
* order to avoid race conditions that is get an etag from a GET rule set request, and pass it
* with the PUT update request to identify the rule set version you are updating.
*/
etag: string;
grantRules?: CreateCreateGrantRule[] | undefined;
}

export interface CreateGrantRule {
/**
* Principals this grant rule applies to.
* A principal can be a user (for end users), a service principal (for applications and
* compute workloads), or an account group. Each principal has its own identifier format:
* * users/<USERNAME>
* * groups/<GROUP_NAME>
* * servicePrincipals/<SERVICE_PRINCIPAL_APPLICATION_ID>
*/
principals?: string[] | undefined;
/** Role that is assigned to the list of principals. */
role: string;
}

export interface CreateRuleSetUpdateRequest {
/** Name of the rule set. */
name: string;
/**
* Identifies the version of the rule set returned.
* Etag used for versioning. The response is at least as fresh as the eTag provided.
* Etag is used for optimistic concurrency control as a way to help prevent simultaneous
* updates of a rule set from overwriting each other. It is strongly suggested that systems
* make use of the etag in the read -> modify -> write pattern to perform rule set updates in
* order to avoid race conditions that is get an etag from a GET rule set request, and pass it
* with the PUT update request to identify the rule set version you are updating.
*/
etag: string;
grantRules?: CreateGrantRule[] | undefined;
}

/** Removes all permission assignments for a workspace given a principal. */
export interface DeleteWorkspacePermissionAssignmentRequest {
/** The account ID. */
Expand Down Expand Up @@ -350,23 +431,23 @@ export interface SetObjectPermissionsRequest {
requestObjectType?: string | undefined;
/** The id of the request object. */
requestObjectId?: string | undefined;
accessControlList?: AccessControlRequest[] | undefined;
accessControlList?: CreateAccessControlRequest[] | undefined;
}

export interface UpdateObjectPermissionsRequest {
/** 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. */
requestObjectType?: string | undefined;
/** The id of the request object. */
requestObjectId?: string | undefined;
accessControlList?: AccessControlRequest[] | undefined;
accessControlList?: CreateAccessControlRequest[] | undefined;
}

export interface UpdateRuleSetRequest {
/** <Databricks> account ID. */
accountId?: string | undefined;
/** Name of the rule set. */
name?: string | undefined;
ruleSet?: RuleSetUpdateRequest | undefined;
ruleSet?: CreateCreateRuleSetUpdateRequest | undefined;
}

export interface UpdateWorkspacePermissionAssignmentRequest {
Expand Down Expand Up @@ -610,7 +691,27 @@ export const unmarshalWorkspacePermissionAssignmentOutputSchema: z.ZodType<Works
error: d.error,
}));

export const marshalAccessControlRequestSchema: z.ZodType = z
export const marshalActorSchema: z.ZodType = z
.object({
kind: z
.discriminatedUnion('$case', [
z.object({$case: z.literal('actorId'), actorId: z.bigint()}),
])
.optional(),
})
.transform(d => ({
...(d.kind?.$case === 'actorId' && {actor_id: d.kind.actorId}),
}));

export const marshalConsistencyTokenSchema: z.ZodType = z
.object({
value: z.string().optional(),
})
.transform(d => ({
value: d.value,
}));

export const marshalCreateAccessControlRequestSchema: z.ZodType = z
.object({
principalName: z
.discriminatedUnion('$case', [
Expand All @@ -637,34 +738,28 @@ export const marshalAccessControlRequestSchema: z.ZodType = z
permission_level: d.permissionLevel,
}));

export const marshalActorSchema: z.ZodType = z
.object({
kind: z
.discriminatedUnion('$case', [
z.object({$case: z.literal('actorId'), actorId: z.bigint()}),
])
.optional(),
})
.transform(d => ({
...(d.kind?.$case === 'actorId' && {actor_id: d.kind.actorId}),
}));

export const marshalConsistencyTokenSchema: z.ZodType = z
export const marshalCreateCreateGrantRuleSchema: z.ZodType = z
.object({
value: z.string().optional(),
principals: z.array(z.string()).optional(),
role: z.string(),
})
.transform(d => ({
value: d.value,
principals: d.principals,
role: d.role,
}));

export const marshalGrantRuleSchema: z.ZodType = z
export const marshalCreateCreateRuleSetUpdateRequestSchema: z.ZodType = z
.object({
principals: z.array(z.string()).optional(),
role: z.string().optional(),
name: z.string(),
etag: z.string(),
grantRules: z
.array(z.lazy(() => marshalCreateCreateGrantRuleSchema))
.optional(),
})
.transform(d => ({
principals: d.principals,
role: d.role,
name: d.name,
etag: d.etag,
grant_rules: d.grantRules,
}));

export const marshalResourceInfoSchema: z.ZodType = z
Expand All @@ -679,24 +774,12 @@ export const marshalResourceInfoSchema: z.ZodType = z
legacy_acl_path: d.legacyAclPath,
}));

export const marshalRuleSetUpdateRequestSchema: z.ZodType = z
.object({
name: z.string().optional(),
etag: z.string().optional(),
grantRules: z.array(z.lazy(() => marshalGrantRuleSchema)).optional(),
})
.transform(d => ({
name: d.name,
etag: d.etag,
grant_rules: d.grantRules,
}));

export const marshalSetObjectPermissionsRequestSchema: z.ZodType = z
.object({
requestObjectType: z.string().optional(),
requestObjectId: z.string().optional(),
accessControlList: z
.array(z.lazy(() => marshalAccessControlRequestSchema))
.array(z.lazy(() => marshalCreateAccessControlRequestSchema))
.optional(),
})
.transform(d => ({
Expand All @@ -710,7 +793,7 @@ export const marshalUpdateObjectPermissionsRequestSchema: z.ZodType = z
requestObjectType: z.string().optional(),
requestObjectId: z.string().optional(),
accessControlList: z
.array(z.lazy(() => marshalAccessControlRequestSchema))
.array(z.lazy(() => marshalCreateAccessControlRequestSchema))
.optional(),
})
.transform(d => ({
Expand All @@ -723,7 +806,9 @@ export const marshalUpdateRuleSetRequestSchema: z.ZodType = z
.object({
accountId: z.string().optional(),
name: z.string().optional(),
ruleSet: z.lazy(() => marshalRuleSetUpdateRequestSchema).optional(),
ruleSet: z
.lazy(() => marshalCreateCreateRuleSetUpdateRequestSchema)
.optional(),
})
.transform(d => ({
account_id: d.accountId,
Expand Down
12 changes: 11 additions & 1 deletion packages/alerts/src/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,26 @@ export type {
AlertOperand,
AlertOperandColumn,
AlertOperandValue,
CreateAlertCondition,
CreateAlertOperand,
CreateAlertOperandColumn,
CreateAlertOperandValue,
CreateAlertRequest,
CreateAlertRequestAlert,
CreateCreateAlertRequestAlert,
Empty,
GetAlertRequest,
ListAlertsRequest,
ListAlertsResponse,
ListAlertsResponseAlert,
TrashAlertRequest,
UpdateAlertCondition,
UpdateAlertOperand,
UpdateAlertOperandColumn,
UpdateAlertOperandValue,
UpdateAlertRequest,
UpdateAlertRequestAlert,
UpdateUpdateAlertRequestAlert,
} from './model';

export {updateAlertRequestAlertFieldMask} from './model';
export {updateUpdateAlertRequestAlertFieldMask} from './model';
Loading
Loading