/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 80e3ee18f008 */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { UserIdentityApiKey, UserIdentityApiKey$inboundSchema, } from "./useridentityapikey.js"; import { UserIdentityOrganization, UserIdentityOrganization$inboundSchema, } from "./useridentityorganization.js"; import { UserIdentityWorkspace, UserIdentityWorkspace$inboundSchema, } from "./useridentityworkspace.js"; export type UserIdentity = { id: string; email: string | null; firstName: string | null; lastName: string | null; workspace?: UserIdentityWorkspace | null | undefined; organization?: UserIdentityOrganization | null | undefined; apiKey?: UserIdentityApiKey | null | undefined; }; /** @internal */ export const UserIdentity$inboundSchema: z.ZodType = z .object({ id: z.string(), email: z.nullable(z.string()), first_name: z.nullable(z.string()), last_name: z.nullable(z.string()), workspace: z.nullable(UserIdentityWorkspace$inboundSchema).optional(), organization: z.nullable(UserIdentityOrganization$inboundSchema).optional(), api_key: z.nullable(UserIdentityApiKey$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", "api_key": "apiKey", }); }); export function userIdentityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UserIdentity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserIdentity' from JSON`, ); }