/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetApiV3MetricsIcpTxnVsEthTxnFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3MetricsIcpTxnVsEthTxnFormat = ClosedEnum< typeof GetApiV3MetricsIcpTxnVsEthTxnFormat >; export type GetApiV3MetricsIcpTxnVsEthTxnRequest = { format?: GetApiV3MetricsIcpTxnVsEthTxnFormat | undefined; }; /** @internal */ export const GetApiV3MetricsIcpTxnVsEthTxnFormat$inboundSchema: z.ZodNativeEnum< typeof GetApiV3MetricsIcpTxnVsEthTxnFormat > = z.nativeEnum(GetApiV3MetricsIcpTxnVsEthTxnFormat); /** @internal */ export const GetApiV3MetricsIcpTxnVsEthTxnFormat$outboundSchema: z.ZodNativeEnum = GetApiV3MetricsIcpTxnVsEthTxnFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3MetricsIcpTxnVsEthTxnFormat$ { /** @deprecated use `GetApiV3MetricsIcpTxnVsEthTxnFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3MetricsIcpTxnVsEthTxnFormat$inboundSchema; /** @deprecated use `GetApiV3MetricsIcpTxnVsEthTxnFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3MetricsIcpTxnVsEthTxnFormat$outboundSchema; } /** @internal */ export const GetApiV3MetricsIcpTxnVsEthTxnRequest$inboundSchema: z.ZodType< GetApiV3MetricsIcpTxnVsEthTxnRequest, z.ZodTypeDef, unknown > = z.object({ format: GetApiV3MetricsIcpTxnVsEthTxnFormat$inboundSchema.default("json"), }); /** @internal */ export type GetApiV3MetricsIcpTxnVsEthTxnRequest$Outbound = { format: string; }; /** @internal */ export const GetApiV3MetricsIcpTxnVsEthTxnRequest$outboundSchema: z.ZodType< GetApiV3MetricsIcpTxnVsEthTxnRequest$Outbound, z.ZodTypeDef, GetApiV3MetricsIcpTxnVsEthTxnRequest > = z.object({ format: GetApiV3MetricsIcpTxnVsEthTxnFormat$outboundSchema.default("json"), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3MetricsIcpTxnVsEthTxnRequest$ { /** @deprecated use `GetApiV3MetricsIcpTxnVsEthTxnRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3MetricsIcpTxnVsEthTxnRequest$inboundSchema; /** @deprecated use `GetApiV3MetricsIcpTxnVsEthTxnRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3MetricsIcpTxnVsEthTxnRequest$outboundSchema; /** @deprecated use `GetApiV3MetricsIcpTxnVsEthTxnRequest$Outbound` instead. */ export type Outbound = GetApiV3MetricsIcpTxnVsEthTxnRequest$Outbound; } export function getApiV3MetricsIcpTxnVsEthTxnRequestToJSON( getApiV3MetricsIcpTxnVsEthTxnRequest: GetApiV3MetricsIcpTxnVsEthTxnRequest, ): string { return JSON.stringify( GetApiV3MetricsIcpTxnVsEthTxnRequest$outboundSchema.parse( getApiV3MetricsIcpTxnVsEthTxnRequest, ), ); } export function getApiV3MetricsIcpTxnVsEthTxnRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetApiV3MetricsIcpTxnVsEthTxnRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetApiV3MetricsIcpTxnVsEthTxnRequest' from JSON`, ); }