/* * 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 GetApiV3BitcoinStableMemorySizeInBytesFormat = { Json: "json", Csv: "csv", } as const; export type GetApiV3BitcoinStableMemorySizeInBytesFormat = ClosedEnum< typeof GetApiV3BitcoinStableMemorySizeInBytesFormat >; /** * Network */ export const GetApiV3BitcoinStableMemorySizeInBytesNetwork = { Mainnet: "mainnet", Testnet: "testnet", } as const; /** * Network */ export type GetApiV3BitcoinStableMemorySizeInBytesNetwork = ClosedEnum< typeof GetApiV3BitcoinStableMemorySizeInBytesNetwork >; export type GetApiV3BitcoinStableMemorySizeInBytesRequest = { /** * Start Timestamp */ start?: number | null | undefined; /** * End Timestamp */ end?: number | null | undefined; format?: GetApiV3BitcoinStableMemorySizeInBytesFormat | undefined; /** * Float Step value */ step?: number | undefined; /** * Network */ network?: GetApiV3BitcoinStableMemorySizeInBytesNetwork | undefined; }; /** @internal */ export const GetApiV3BitcoinStableMemorySizeInBytesFormat$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3BitcoinStableMemorySizeInBytesFormat); /** @internal */ export const GetApiV3BitcoinStableMemorySizeInBytesFormat$outboundSchema: z.ZodNativeEnum = GetApiV3BitcoinStableMemorySizeInBytesFormat$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3BitcoinStableMemorySizeInBytesFormat$ { /** @deprecated use `GetApiV3BitcoinStableMemorySizeInBytesFormat$inboundSchema` instead. */ export const inboundSchema = GetApiV3BitcoinStableMemorySizeInBytesFormat$inboundSchema; /** @deprecated use `GetApiV3BitcoinStableMemorySizeInBytesFormat$outboundSchema` instead. */ export const outboundSchema = GetApiV3BitcoinStableMemorySizeInBytesFormat$outboundSchema; } /** @internal */ export const GetApiV3BitcoinStableMemorySizeInBytesNetwork$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetApiV3BitcoinStableMemorySizeInBytesNetwork); /** @internal */ export const GetApiV3BitcoinStableMemorySizeInBytesNetwork$outboundSchema: z.ZodNativeEnum = GetApiV3BitcoinStableMemorySizeInBytesNetwork$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3BitcoinStableMemorySizeInBytesNetwork$ { /** @deprecated use `GetApiV3BitcoinStableMemorySizeInBytesNetwork$inboundSchema` instead. */ export const inboundSchema = GetApiV3BitcoinStableMemorySizeInBytesNetwork$inboundSchema; /** @deprecated use `GetApiV3BitcoinStableMemorySizeInBytesNetwork$outboundSchema` instead. */ export const outboundSchema = GetApiV3BitcoinStableMemorySizeInBytesNetwork$outboundSchema; } /** @internal */ export const GetApiV3BitcoinStableMemorySizeInBytesRequest$inboundSchema: z.ZodType< GetApiV3BitcoinStableMemorySizeInBytesRequest, z.ZodTypeDef, unknown > = z.object({ start: z.nullable(z.number()).default(null), end: z.nullable(z.number()).default(null), format: GetApiV3BitcoinStableMemorySizeInBytesFormat$inboundSchema.default( "json", ), step: z.number().default(7200), network: GetApiV3BitcoinStableMemorySizeInBytesNetwork$inboundSchema .default("mainnet"), }); /** @internal */ export type GetApiV3BitcoinStableMemorySizeInBytesRequest$Outbound = { start: number | null; end: number | null; format: string; step: number; network: string; }; /** @internal */ export const GetApiV3BitcoinStableMemorySizeInBytesRequest$outboundSchema: z.ZodType< GetApiV3BitcoinStableMemorySizeInBytesRequest$Outbound, z.ZodTypeDef, GetApiV3BitcoinStableMemorySizeInBytesRequest > = z.object({ start: z.nullable(z.number()).default(null), end: z.nullable(z.number()).default(null), format: GetApiV3BitcoinStableMemorySizeInBytesFormat$outboundSchema.default( "json", ), step: z.number().default(7200), network: GetApiV3BitcoinStableMemorySizeInBytesNetwork$outboundSchema .default("mainnet"), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetApiV3BitcoinStableMemorySizeInBytesRequest$ { /** @deprecated use `GetApiV3BitcoinStableMemorySizeInBytesRequest$inboundSchema` instead. */ export const inboundSchema = GetApiV3BitcoinStableMemorySizeInBytesRequest$inboundSchema; /** @deprecated use `GetApiV3BitcoinStableMemorySizeInBytesRequest$outboundSchema` instead. */ export const outboundSchema = GetApiV3BitcoinStableMemorySizeInBytesRequest$outboundSchema; /** @deprecated use `GetApiV3BitcoinStableMemorySizeInBytesRequest$Outbound` instead. */ export type Outbound = GetApiV3BitcoinStableMemorySizeInBytesRequest$Outbound; } export function getApiV3BitcoinStableMemorySizeInBytesRequestToJSON( getApiV3BitcoinStableMemorySizeInBytesRequest: GetApiV3BitcoinStableMemorySizeInBytesRequest, ): string { return JSON.stringify( GetApiV3BitcoinStableMemorySizeInBytesRequest$outboundSchema.parse( getApiV3BitcoinStableMemorySizeInBytesRequest, ), ); } export function getApiV3BitcoinStableMemorySizeInBytesRequestFromJSON( jsonString: string, ): SafeParseResult< GetApiV3BitcoinStableMemorySizeInBytesRequest, SDKValidationError > { return safeParse( jsonString, (x) => GetApiV3BitcoinStableMemorySizeInBytesRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetApiV3BitcoinStableMemorySizeInBytesRequest' from JSON`, ); }