/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f3016dd9de4e */ import * as z from "zod"; import { ClosedEnum } from "../types/enums.js"; import { PrincipalType, PrincipalType$zodSchema } from "./principaltype.js"; /** * The user, group, or API key whose role assignments are being modified. */ export type Principal = { type: PrincipalType; id: string }; export const Principal$zodSchema: z.ZodType = z.object({ id: z.string().describe( "The unique identifier of the principal. For `apiKey`, provide the API key value.", ), type: PrincipalType$zodSchema.describe("The type of principal."), }).describe( "The user, group, or API key whose role assignments are being modified.", ); /** * The operation to perform on the principal’s role assignments. `add` grants the specified roles; `remove` revokes them. */ export const Operation = { Add: "add", Remove: "remove", } as const; /** * The operation to perform on the principal’s role assignments. `add` grants the specified roles; `remove` revokes them. */ export type Operation = ClosedEnum; export const Operation$zodSchema = z.enum([ "add", "remove", ]).describe( "The operation to perform on the principal’s role assignments. `add` grants the specified roles; `remove` revokes them.", ); export type AssignFolderRolesRequest = { principal: Principal; operation: Operation; roles: Array; }; export const AssignFolderRolesRequest$zodSchema: z.ZodType< AssignFolderRolesRequest > = z.object({ operation: Operation$zodSchema.describe( "The operation to perform on the principal’s role assignments. `add` grants the specified roles; `remove` revokes them.", ), principal: z.lazy(() => Principal$zodSchema).describe( "The user, group, or API key whose role assignments are being modified.", ), roles: z.array(z.string()).describe("The role IDs to add or remove."), });