/* * 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 GetForexDataResponse = { success?: true | undefined; data: ForexData; }; /** @internal */ export const GetForexDataResponse$inboundSchema: z.ZodType< GetForexDataResponse, z.ZodTypeDef, unknown > = z.object({ success: z.literal(true).default(true).optional(), data: ForexData$inboundSchema, }); /** @internal */ export type GetForexDataResponse$Outbound = { success: true; data: ForexData$Outbound; }; /** @internal */ export const GetForexDataResponse$outboundSchema: z.ZodType< GetForexDataResponse$Outbound, z.ZodTypeDef, GetForexDataResponse > = z.object({ success: z.literal(true).default(true as const), data: 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 GetForexDataResponse$ { /** @deprecated use `GetForexDataResponse$inboundSchema` instead. */ export const inboundSchema = GetForexDataResponse$inboundSchema; /** @deprecated use `GetForexDataResponse$outboundSchema` instead. */ export const outboundSchema = GetForexDataResponse$outboundSchema; /** @deprecated use `GetForexDataResponse$Outbound` instead. */ export type Outbound = GetForexDataResponse$Outbound; } export function getForexDataResponseToJSON( getForexDataResponse: GetForexDataResponse, ): string { return JSON.stringify( GetForexDataResponse$outboundSchema.parse(getForexDataResponse), ); } export function getForexDataResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetForexDataResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetForexDataResponse' from JSON`, ); }