/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SocialLink = { /** * Unique identifier of the social link */ id?: string | null | undefined; /** * URL of the social link, e.g. https://www.twitter.com/apideck */ url: string; /** * Type of the social link, e.g. twitter */ type?: string | null | undefined; }; /** @internal */ export const SocialLink$inboundSchema: z.ZodType< SocialLink, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(types.string()).optional(), url: types.string(), type: z.nullable(types.string()).optional(), }) ); /** @internal */ export type SocialLink$Outbound = { id?: string | null | undefined; url: string; type?: string | null | undefined; }; /** @internal */ export const SocialLink$outboundSchema: z.ZodType< SocialLink$Outbound, z.ZodTypeDef, SocialLink > = /* @__PURE__ */ lazySchema$(() => z.object({ id: z.nullable(z.string()).optional(), url: z.string(), type: z.nullable(z.string()).optional(), }) ); export function socialLinkToJSON(socialLink: SocialLink): string { return JSON.stringify(SocialLink$outboundSchema.parse(socialLink)); } export function socialLinkFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SocialLink$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SocialLink' from JSON`, ); }