/* * 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 AppSchemasTransactionCountTransactionCountMetric = { date: string; timestamp: number; count: number; countOverTime: string; }; /** @internal */ export const AppSchemasTransactionCountTransactionCountMetric$inboundSchema: z.ZodType< AppSchemasTransactionCountTransactionCountMetric, 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 AppSchemasTransactionCountTransactionCountMetric$Outbound = { date: string; timestamp: number; count: number; count_over_time: string; }; /** @internal */ export const AppSchemasTransactionCountTransactionCountMetric$outboundSchema: z.ZodType< AppSchemasTransactionCountTransactionCountMetric$Outbound, z.ZodTypeDef, AppSchemasTransactionCountTransactionCountMetric > = 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 AppSchemasTransactionCountTransactionCountMetric$ { /** @deprecated use `AppSchemasTransactionCountTransactionCountMetric$inboundSchema` instead. */ export const inboundSchema = AppSchemasTransactionCountTransactionCountMetric$inboundSchema; /** @deprecated use `AppSchemasTransactionCountTransactionCountMetric$outboundSchema` instead. */ export const outboundSchema = AppSchemasTransactionCountTransactionCountMetric$outboundSchema; /** @deprecated use `AppSchemasTransactionCountTransactionCountMetric$Outbound` instead. */ export type Outbound = AppSchemasTransactionCountTransactionCountMetric$Outbound; } export function appSchemasTransactionCountTransactionCountMetricToJSON( appSchemasTransactionCountTransactionCountMetric: AppSchemasTransactionCountTransactionCountMetric, ): string { return JSON.stringify( AppSchemasTransactionCountTransactionCountMetric$outboundSchema.parse( appSchemasTransactionCountTransactionCountMetric, ), ); } export function appSchemasTransactionCountTransactionCountMetricFromJSON( jsonString: string, ): SafeParseResult< AppSchemasTransactionCountTransactionCountMetric, SDKValidationError > { return safeParse( jsonString, (x) => AppSchemasTransactionCountTransactionCountMetric$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AppSchemasTransactionCountTransactionCountMetric' from JSON`, ); }