/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CollectionUser = { /** * A unique identifier for an object. */ id?: string | null | undefined; /** * Full name of the user */ name?: string | null | undefined; /** * First name of the user */ firstName?: string | null | undefined; /** * Last name of the user */ lastName?: string | null | undefined; /** * Email address of the user */ email?: string | null | undefined; /** * The URL of the photo of a person. */ photoUrl?: string | null | undefined; /** * When custom mappings are configured on the resource, the result is included here. */ customMappings?: { [k: string]: any } | null | undefined; /** * The date and time when the object was last updated. */ updatedAt?: Date | null | undefined; /** * The date and time when the object was created. */ createdAt?: Date | null | undefined; }; /** @internal */ export const CollectionUser$inboundSchema: z.ZodType< CollectionUser, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(types.string()).optional(), name: z.nullable(types.string()).optional(), first_name: z.nullable(types.string()).optional(), last_name: z.nullable(types.string()).optional(), email: z.nullable(types.string()).optional(), photo_url: z.nullable(types.string()).optional(), custom_mappings: z.nullable(z.record(z.any())).optional(), updated_at: z.nullable(types.date()).optional(), created_at: z.nullable(types.date()).optional(), }).transform((v) => { return remap$(v, { "first_name": "firstName", "last_name": "lastName", "photo_url": "photoUrl", "custom_mappings": "customMappings", "updated_at": "updatedAt", "created_at": "createdAt", }); }) ); export function collectionUserFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CollectionUser$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CollectionUser' from JSON`, ); }