/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; import { RBACRoleV2, RBACRoleV2$inboundSchema, RBACRoleV2$Outbound, RBACRoleV2$outboundSchema, } from "./rbacrolev2.js"; /** * DEPRECATED: Role of the user as of March 9th 2023, this value is no longer updated. */ export const UserWithRolesV2Role = { Viewer: "viewer", Responder: "responder", Administrator: "administrator", Owner: "owner", Unset: "unset", } as const; /** * DEPRECATED: Role of the user as of March 9th 2023, this value is no longer updated. */ export type UserWithRolesV2Role = ClosedEnum; export type UserWithRolesV2 = { baseRole: RBACRoleV2; customRoles: Array; /** * Email address of the user. */ email?: string | undefined; /** * Unique identifier of the user */ id: string; /** * Name of the user */ name: string; /** * DEPRECATED: Role of the user as of March 9th 2023, this value is no longer updated. */ role: UserWithRolesV2Role; /** * Slack ID of the user */ slackUserId?: string | undefined; }; /** @internal */ export const UserWithRolesV2Role$inboundSchema: z.ZodNativeEnum< typeof UserWithRolesV2Role > = z.nativeEnum(UserWithRolesV2Role); /** @internal */ export const UserWithRolesV2Role$outboundSchema: z.ZodNativeEnum< typeof UserWithRolesV2Role > = UserWithRolesV2Role$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UserWithRolesV2Role$ { /** @deprecated use `UserWithRolesV2Role$inboundSchema` instead. */ export const inboundSchema = UserWithRolesV2Role$inboundSchema; /** @deprecated use `UserWithRolesV2Role$outboundSchema` instead. */ export const outboundSchema = UserWithRolesV2Role$outboundSchema; } /** @internal */ export const UserWithRolesV2$inboundSchema: z.ZodType< UserWithRolesV2, z.ZodTypeDef, unknown > = z.object({ base_role: RBACRoleV2$inboundSchema, custom_roles: z.array(RBACRoleV2$inboundSchema), email: z.string().optional(), id: z.string(), name: z.string(), role: UserWithRolesV2Role$inboundSchema, slack_user_id: z.string().optional(), }).transform((v) => { return remap$(v, { "base_role": "baseRole", "custom_roles": "customRoles", "slack_user_id": "slackUserId", }); }); /** @internal */ export type UserWithRolesV2$Outbound = { base_role: RBACRoleV2$Outbound; custom_roles: Array; email?: string | undefined; id: string; name: string; role: string; slack_user_id?: string | undefined; }; /** @internal */ export const UserWithRolesV2$outboundSchema: z.ZodType< UserWithRolesV2$Outbound, z.ZodTypeDef, UserWithRolesV2 > = z.object({ baseRole: RBACRoleV2$outboundSchema, customRoles: z.array(RBACRoleV2$outboundSchema), email: z.string().optional(), id: z.string(), name: z.string(), role: UserWithRolesV2Role$outboundSchema, slackUserId: z.string().optional(), }).transform((v) => { return remap$(v, { baseRole: "base_role", customRoles: "custom_roles", slackUserId: "slack_user_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UserWithRolesV2$ { /** @deprecated use `UserWithRolesV2$inboundSchema` instead. */ export const inboundSchema = UserWithRolesV2$inboundSchema; /** @deprecated use `UserWithRolesV2$outboundSchema` instead. */ export const outboundSchema = UserWithRolesV2$outboundSchema; /** @deprecated use `UserWithRolesV2$Outbound` instead. */ export type Outbound = UserWithRolesV2$Outbound; }