/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { EffectivePriceRow, EffectivePriceRow$inboundSchema, EffectivePriceRow$Outbound, EffectivePriceRow$outboundSchema, } from "./effectivepricerow.js"; export type EffectivePricesResponse = { object: "list"; currency: string | null; data: Array; }; /** @internal */ export const EffectivePricesResponse$inboundSchema: z.ZodType< EffectivePricesResponse, z.ZodTypeDef, unknown > = z.object({ object: z.literal("list"), currency: z.nullable(z.string()), data: z.array(EffectivePriceRow$inboundSchema), }); /** @internal */ export type EffectivePricesResponse$Outbound = { object: "list"; currency: string | null; data: Array; }; /** @internal */ export const EffectivePricesResponse$outboundSchema: z.ZodType< EffectivePricesResponse$Outbound, z.ZodTypeDef, EffectivePricesResponse > = z.object({ object: z.literal("list"), currency: z.nullable(z.string()), data: z.array(EffectivePriceRow$outboundSchema), }); export function effectivePricesResponseToJSON( effectivePricesResponse: EffectivePricesResponse, ): string { return JSON.stringify( EffectivePricesResponse$outboundSchema.parse(effectivePricesResponse), ); } export function effectivePricesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EffectivePricesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EffectivePricesResponse' from JSON`, ); }