/* * 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"; import * as models from "../index.js"; export type CountLedgersApiV2LedgersCountGetRequest = { network?: Array | undefined; tokenTypes?: Array | undefined; /** * Search for a ledger by name or symbol */ query?: string | undefined; }; /** @internal */ export const CountLedgersApiV2LedgersCountGetRequest$inboundSchema: z.ZodType< CountLedgersApiV2LedgersCountGetRequest, z.ZodTypeDef, unknown > = z.object({ network: z.array(models.Network$inboundSchema).optional(), token_types: z.array(models.AppModelsLedgersTokenType$inboundSchema) .optional(), query: z.string().optional(), }).transform((v) => { return remap$(v, { "token_types": "tokenTypes", }); }); /** @internal */ export type CountLedgersApiV2LedgersCountGetRequest$Outbound = { network?: Array | undefined; token_types?: Array | undefined; query?: string | undefined; }; /** @internal */ export const CountLedgersApiV2LedgersCountGetRequest$outboundSchema: z.ZodType< CountLedgersApiV2LedgersCountGetRequest$Outbound, z.ZodTypeDef, CountLedgersApiV2LedgersCountGetRequest > = z.object({ network: z.array(models.Network$outboundSchema).optional(), tokenTypes: z.array(models.AppModelsLedgersTokenType$outboundSchema) .optional(), query: z.string().optional(), }).transform((v) => { return remap$(v, { tokenTypes: "token_types", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CountLedgersApiV2LedgersCountGetRequest$ { /** @deprecated use `CountLedgersApiV2LedgersCountGetRequest$inboundSchema` instead. */ export const inboundSchema = CountLedgersApiV2LedgersCountGetRequest$inboundSchema; /** @deprecated use `CountLedgersApiV2LedgersCountGetRequest$outboundSchema` instead. */ export const outboundSchema = CountLedgersApiV2LedgersCountGetRequest$outboundSchema; /** @deprecated use `CountLedgersApiV2LedgersCountGetRequest$Outbound` instead. */ export type Outbound = CountLedgersApiV2LedgersCountGetRequest$Outbound; } export function countLedgersApiV2LedgersCountGetRequestToJSON( countLedgersApiV2LedgersCountGetRequest: CountLedgersApiV2LedgersCountGetRequest, ): string { return JSON.stringify( CountLedgersApiV2LedgersCountGetRequest$outboundSchema.parse( countLedgersApiV2LedgersCountGetRequest, ), ); } export function countLedgersApiV2LedgersCountGetRequestFromJSON( jsonString: string, ): SafeParseResult< CountLedgersApiV2LedgersCountGetRequest, SDKValidationError > { return safeParse( jsonString, (x) => CountLedgersApiV2LedgersCountGetRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CountLedgersApiV2LedgersCountGetRequest' from JSON`, ); }