/* * 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"; export type TransactionVolumeMetric = { date: string; timestamp: number; count: number; volume: string; countOverTime: string; }; /** @internal */ export const TransactionVolumeMetric$inboundSchema: z.ZodType< TransactionVolumeMetric, z.ZodTypeDef, unknown > = z.object({ date: z.string(), timestamp: z.number().int(), count: z.number().int(), volume: z.string(), count_over_time: z.string(), }).transform((v) => { return remap$(v, { "count_over_time": "countOverTime", }); }); /** @internal */ export type TransactionVolumeMetric$Outbound = { date: string; timestamp: number; count: number; volume: string; count_over_time: string; }; /** @internal */ export const TransactionVolumeMetric$outboundSchema: z.ZodType< TransactionVolumeMetric$Outbound, z.ZodTypeDef, TransactionVolumeMetric > = z.object({ date: z.string(), timestamp: z.number().int(), count: z.number().int(), volume: z.string(), countOverTime: z.string(), }).transform((v) => { return remap$(v, { countOverTime: "count_over_time", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace TransactionVolumeMetric$ { /** @deprecated use `TransactionVolumeMetric$inboundSchema` instead. */ export const inboundSchema = TransactionVolumeMetric$inboundSchema; /** @deprecated use `TransactionVolumeMetric$outboundSchema` instead. */ export const outboundSchema = TransactionVolumeMetric$outboundSchema; /** @deprecated use `TransactionVolumeMetric$Outbound` instead. */ export type Outbound = TransactionVolumeMetric$Outbound; } export function transactionVolumeMetricToJSON( transactionVolumeMetric: TransactionVolumeMetric, ): string { return JSON.stringify( TransactionVolumeMetric$outboundSchema.parse(transactionVolumeMetric), ); } export function transactionVolumeMetricFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TransactionVolumeMetric$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TransactionVolumeMetric' from JSON`, ); }