/* * 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 AppSchemasV2TransactionCountTransactionCountMetric = { date: string; timestamp: number; count: number; countOverTime: string; }; /** @internal */ export const AppSchemasV2TransactionCountTransactionCountMetric$inboundSchema: z.ZodType< AppSchemasV2TransactionCountTransactionCountMetric, z.ZodTypeDef, unknown > = z.object({ date: z.string(), timestamp: z.number().int(), count: z.number().int(), count_over_time: z.string(), }).transform((v) => { return remap$(v, { "count_over_time": "countOverTime", }); }); /** @internal */ export type AppSchemasV2TransactionCountTransactionCountMetric$Outbound = { date: string; timestamp: number; count: number; count_over_time: string; }; /** @internal */ export const AppSchemasV2TransactionCountTransactionCountMetric$outboundSchema: z.ZodType< AppSchemasV2TransactionCountTransactionCountMetric$Outbound, z.ZodTypeDef, AppSchemasV2TransactionCountTransactionCountMetric > = z.object({ date: z.string(), timestamp: z.number().int(), count: z.number().int(), 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 AppSchemasV2TransactionCountTransactionCountMetric$ { /** @deprecated use `AppSchemasV2TransactionCountTransactionCountMetric$inboundSchema` instead. */ export const inboundSchema = AppSchemasV2TransactionCountTransactionCountMetric$inboundSchema; /** @deprecated use `AppSchemasV2TransactionCountTransactionCountMetric$outboundSchema` instead. */ export const outboundSchema = AppSchemasV2TransactionCountTransactionCountMetric$outboundSchema; /** @deprecated use `AppSchemasV2TransactionCountTransactionCountMetric$Outbound` instead. */ export type Outbound = AppSchemasV2TransactionCountTransactionCountMetric$Outbound; } export function appSchemasV2TransactionCountTransactionCountMetricToJSON( appSchemasV2TransactionCountTransactionCountMetric: AppSchemasV2TransactionCountTransactionCountMetric, ): string { return JSON.stringify( AppSchemasV2TransactionCountTransactionCountMetric$outboundSchema.parse( appSchemasV2TransactionCountTransactionCountMetric, ), ); } export function appSchemasV2TransactionCountTransactionCountMetricFromJSON( jsonString: string, ): SafeParseResult< AppSchemasV2TransactionCountTransactionCountMetric, SDKValidationError > { return safeParse( jsonString, (x) => AppSchemasV2TransactionCountTransactionCountMetric$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AppSchemasV2TransactionCountTransactionCountMetric' from JSON`, ); }