/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Contact, Contact$inboundSchema } from "./contact.js"; export type Organization = { abuseContacts?: Array | null | undefined; address?: string | undefined; adminContacts?: Array | null | undefined; city?: string | undefined; country?: string | undefined; handle?: string | undefined; name?: string | undefined; postalCode?: string | undefined; state?: string | undefined; street?: string | undefined; techContacts?: Array | null | undefined; }; /** @internal */ export const Organization$inboundSchema: z.ZodType< Organization, z.ZodTypeDef, unknown > = z.object({ abuse_contacts: z.nullable(z.array(Contact$inboundSchema)).optional(), address: z.string().optional(), admin_contacts: z.nullable(z.array(Contact$inboundSchema)).optional(), city: z.string().optional(), country: z.string().optional(), handle: z.string().optional(), name: z.string().optional(), postal_code: z.string().optional(), state: z.string().optional(), street: z.string().optional(), tech_contacts: z.nullable(z.array(Contact$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "abuse_contacts": "abuseContacts", "admin_contacts": "adminContacts", "postal_code": "postalCode", "tech_contacts": "techContacts", }); }); export function organizationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Organization$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Organization' from JSON`, ); }