/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ForexData, ForexData$inboundSchema, ForexData$Outbound, ForexData$outboundSchema, } from "./forexdata.js"; export type GetAllForexDataResponse = { success?: true | undefined; data: Array; }; /** @internal */ export const GetAllForexDataResponse$inboundSchema: z.ZodType< GetAllForexDataResponse, z.ZodTypeDef, unknown > = z.object({ success: z.literal(true).default(true).optional(), data: z.array(ForexData$inboundSchema), }); /** @internal */ export type GetAllForexDataResponse$Outbound = { success: true; data: Array; }; /** @internal */ export const GetAllForexDataResponse$outboundSchema: z.ZodType< GetAllForexDataResponse$Outbound, z.ZodTypeDef, GetAllForexDataResponse > = z.object({ success: z.literal(true).default(true as const), data: z.array(ForexData$outboundSchema), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetAllForexDataResponse$ { /** @deprecated use `GetAllForexDataResponse$inboundSchema` instead. */ export const inboundSchema = GetAllForexDataResponse$inboundSchema; /** @deprecated use `GetAllForexDataResponse$outboundSchema` instead. */ export const outboundSchema = GetAllForexDataResponse$outboundSchema; /** @deprecated use `GetAllForexDataResponse$Outbound` instead. */ export type Outbound = GetAllForexDataResponse$Outbound; } export function getAllForexDataResponseToJSON( getAllForexDataResponse: GetAllForexDataResponse, ): string { return JSON.stringify( GetAllForexDataResponse$outboundSchema.parse(getAllForexDataResponse), ); } export function getAllForexDataResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetAllForexDataResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAllForexDataResponse' from JSON`, ); }