/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The type of website */ export const WebsiteType = { Primary: "primary", Secondary: "secondary", Work: "work", Personal: "personal", Other: "other", } as const; /** * The type of website */ export type WebsiteType = OpenEnum; export type Website = { /** * Unique identifier for the website */ id?: string | null | undefined; /** * The website URL */ url: string; /** * The type of website */ type?: WebsiteType | null | undefined; }; /** @internal */ export const WebsiteType$inboundSchema: z.ZodType< WebsiteType, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => openEnums.inboundSchema(WebsiteType)); /** @internal */ export const WebsiteType$outboundSchema: z.ZodType< string, z.ZodTypeDef, WebsiteType > = /* @__PURE__ */ lazySchema$(() => openEnums.outboundSchema(WebsiteType)); /** @internal */ export const Website$inboundSchema: z.ZodType = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(types.string()).optional(), url: types.string(), type: z.nullable(WebsiteType$inboundSchema).optional(), }) ); /** @internal */ export type Website$Outbound = { id?: string | null | undefined; url: string; type?: string | null | undefined; }; /** @internal */ export const Website$outboundSchema: z.ZodType< Website$Outbound, z.ZodTypeDef, Website > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(z.string()).optional(), url: z.string(), type: z.nullable(WebsiteType$outboundSchema).optional(), }) ); export function websiteToJSON(website: Website): string { return JSON.stringify(Website$outboundSchema.parse(website)); } export function websiteFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Website$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Website' from JSON`, ); }