/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export type User = { id: string; name: string | null; email: string; image: string | null; }; export type IdUserIdRole = { /** * Membership ID */ id: string; /** * User ID */ userId: string; /** * Member role (owner, admin, editor, viewer) */ role: string; /** * Membership status */ status?: string | undefined; user: User; /** * ISO timestamp of when member was added */ createdAt: string; /** * ISO timestamp of last update */ updatedAt: string; }; /** @internal */ export const User$inboundSchema: z.ZodMiniType = z.object({ id: types.string(), name: types.nullable(types.string()), email: types.string(), image: types.nullable(types.string()), }); export function userFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => User$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'User' from JSON`, ); } /** @internal */ export const IdUserIdRole$inboundSchema: z.ZodMiniType = z.object({ id: types.string(), userId: types.string(), role: types.string(), status: types.optional(types.string()), user: z.lazy(() => User$inboundSchema), createdAt: types.string(), updatedAt: types.string(), }); export function idUserIdRoleFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IdUserIdRole$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IdUserIdRole' from JSON`, ); }