/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 { Address, Address$inboundSchema, Address$Outbound, Address$outboundSchema, } from "./address.js"; /** * The supplier this entity is linked to. * * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. */ export type DeprecatedLinkedSupplierInput = { /** * The display name of the supplier. */ displayName?: string | null | undefined; address?: Address | undefined; }; /** @internal */ export const DeprecatedLinkedSupplierInput$inboundSchema: z.ZodType< DeprecatedLinkedSupplierInput, z.ZodTypeDef, unknown > = z.object({ display_name: z.nullable(z.string()).optional(), address: Address$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "display_name": "displayName", }); }); /** @internal */ export type DeprecatedLinkedSupplierInput$Outbound = { display_name?: string | null | undefined; address?: Address$Outbound | undefined; }; /** @internal */ export const DeprecatedLinkedSupplierInput$outboundSchema: z.ZodType< DeprecatedLinkedSupplierInput$Outbound, z.ZodTypeDef, DeprecatedLinkedSupplierInput > = z.object({ displayName: z.nullable(z.string()).optional(), address: Address$outboundSchema.optional(), }).transform((v) => { return remap$(v, { displayName: "display_name", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DeprecatedLinkedSupplierInput$ { /** @deprecated use `DeprecatedLinkedSupplierInput$inboundSchema` instead. */ export const inboundSchema = DeprecatedLinkedSupplierInput$inboundSchema; /** @deprecated use `DeprecatedLinkedSupplierInput$outboundSchema` instead. */ export const outboundSchema = DeprecatedLinkedSupplierInput$outboundSchema; /** @deprecated use `DeprecatedLinkedSupplierInput$Outbound` instead. */ export type Outbound = DeprecatedLinkedSupplierInput$Outbound; } export function deprecatedLinkedSupplierInputToJSON( deprecatedLinkedSupplierInput: DeprecatedLinkedSupplierInput, ): string { return JSON.stringify( DeprecatedLinkedSupplierInput$outboundSchema.parse( deprecatedLinkedSupplierInput, ), ); } export function deprecatedLinkedSupplierInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeprecatedLinkedSupplierInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeprecatedLinkedSupplierInput' from JSON`, ); }