/* * 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"; import { Address, Address$inboundSchema } from "./address.js"; /** * The supplier this entity is linked to. */ export type LinkedSupplier = { /** * The ID of the supplier this entity is linked to. */ id?: string | undefined; /** * The display ID of the supplier. */ displayId?: string | null | undefined; /** * The display name of the supplier. */ displayName?: string | null | undefined; /** * The company name of the supplier. */ companyName?: string | null | undefined; address?: Address | undefined; }; /** @internal */ export const LinkedSupplier$inboundSchema: z.ZodType< LinkedSupplier, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ id: types.optional(types.string()), display_id: z.nullable(types.string()).optional(), display_name: z.nullable(types.string()).optional(), company_name: z.nullable(types.string()).optional(), address: types.optional(Address$inboundSchema), }).transform((v) => { return remap$(v, { "display_id": "displayId", "display_name": "displayName", "company_name": "companyName", }); }) ); export function linkedSupplierFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => LinkedSupplier$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'LinkedSupplier' from JSON`, ); }