/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SnapshotsListSnapshotsRequest = { /** * A CEL string to filter snapshot results; See the [CEL Search](https://developer.apexclearing.com/apex-fintech-solutions/docs/cel-search) page in Guides for more information; */ filter?: string | undefined; /** * The number of snapshots to be returned per page. Defaults to 500. Maximum is 1000. */ pageSize?: number | undefined; /** * The token for retrieving the next page of snapshots, the value of which will have been returned in a previous response. */ pageToken?: string | undefined; }; export type SnapshotsListSnapshotsResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listSnapshotsResponse?: components.ListSnapshotsResponse | undefined; /** * INVALID_ARGUMENT: The request is invalid. */ status?: components.Status | undefined; }; /** @internal */ export const SnapshotsListSnapshotsRequest$inboundSchema: z.ZodType< SnapshotsListSnapshotsRequest, z.ZodTypeDef, unknown > = z.object({ filter: z.string().optional(), page_size: z.number().int().optional(), page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "page_size": "pageSize", "page_token": "pageToken", }); }); /** @internal */ export type SnapshotsListSnapshotsRequest$Outbound = { filter?: string | undefined; page_size?: number | undefined; page_token?: string | undefined; }; /** @internal */ export const SnapshotsListSnapshotsRequest$outboundSchema: z.ZodType< SnapshotsListSnapshotsRequest$Outbound, z.ZodTypeDef, SnapshotsListSnapshotsRequest > = z.object({ filter: z.string().optional(), pageSize: z.number().int().optional(), pageToken: z.string().optional(), }).transform((v) => { return remap$(v, { pageSize: "page_size", pageToken: "page_token", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SnapshotsListSnapshotsRequest$ { /** @deprecated use `SnapshotsListSnapshotsRequest$inboundSchema` instead. */ export const inboundSchema = SnapshotsListSnapshotsRequest$inboundSchema; /** @deprecated use `SnapshotsListSnapshotsRequest$outboundSchema` instead. */ export const outboundSchema = SnapshotsListSnapshotsRequest$outboundSchema; /** @deprecated use `SnapshotsListSnapshotsRequest$Outbound` instead. */ export type Outbound = SnapshotsListSnapshotsRequest$Outbound; } export function snapshotsListSnapshotsRequestToJSON( snapshotsListSnapshotsRequest: SnapshotsListSnapshotsRequest, ): string { return JSON.stringify( SnapshotsListSnapshotsRequest$outboundSchema.parse( snapshotsListSnapshotsRequest, ), ); } export function snapshotsListSnapshotsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SnapshotsListSnapshotsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SnapshotsListSnapshotsRequest' from JSON`, ); } /** @internal */ export const SnapshotsListSnapshotsResponse$inboundSchema: z.ZodType< SnapshotsListSnapshotsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListSnapshotsResponse: components.ListSnapshotsResponse$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListSnapshotsResponse": "listSnapshotsResponse", "Status": "status", }); }); /** @internal */ export type SnapshotsListSnapshotsResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListSnapshotsResponse?: components.ListSnapshotsResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const SnapshotsListSnapshotsResponse$outboundSchema: z.ZodType< SnapshotsListSnapshotsResponse$Outbound, z.ZodTypeDef, SnapshotsListSnapshotsResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listSnapshotsResponse: components.ListSnapshotsResponse$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listSnapshotsResponse: "ListSnapshotsResponse", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SnapshotsListSnapshotsResponse$ { /** @deprecated use `SnapshotsListSnapshotsResponse$inboundSchema` instead. */ export const inboundSchema = SnapshotsListSnapshotsResponse$inboundSchema; /** @deprecated use `SnapshotsListSnapshotsResponse$outboundSchema` instead. */ export const outboundSchema = SnapshotsListSnapshotsResponse$outboundSchema; /** @deprecated use `SnapshotsListSnapshotsResponse$Outbound` instead. */ export type Outbound = SnapshotsListSnapshotsResponse$Outbound; } export function snapshotsListSnapshotsResponseToJSON( snapshotsListSnapshotsResponse: SnapshotsListSnapshotsResponse, ): string { return JSON.stringify( SnapshotsListSnapshotsResponse$outboundSchema.parse( snapshotsListSnapshotsResponse, ), ); } export function snapshotsListSnapshotsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SnapshotsListSnapshotsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SnapshotsListSnapshotsResponse' from JSON`, ); }