/* * 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 { Order, Order$inboundSchema, Order$Outbound, Order$outboundSchema, } from "./order.js"; /** * The response message containing a list of orders */ export type ListCorrespondentOrdersResponse = { /** * The token that must be provided on the next List request to retrieve the next page of data. This field will be empty if there are no more pages. */ nextPageToken?: string | undefined; /** * The orders belonging to the requested parent resource, and which match the filter criteria. */ orders?: Array | undefined; }; /** @internal */ export const ListCorrespondentOrdersResponse$inboundSchema: z.ZodType< ListCorrespondentOrdersResponse, z.ZodTypeDef, unknown > = z.object({ next_page_token: z.string().optional(), orders: z.array(Order$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListCorrespondentOrdersResponse$Outbound = { next_page_token?: string | undefined; orders?: Array | undefined; }; /** @internal */ export const ListCorrespondentOrdersResponse$outboundSchema: z.ZodType< ListCorrespondentOrdersResponse$Outbound, z.ZodTypeDef, ListCorrespondentOrdersResponse > = z.object({ nextPageToken: z.string().optional(), orders: z.array(Order$outboundSchema).optional(), }).transform((v) => { return remap$(v, { nextPageToken: "next_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 ListCorrespondentOrdersResponse$ { /** @deprecated use `ListCorrespondentOrdersResponse$inboundSchema` instead. */ export const inboundSchema = ListCorrespondentOrdersResponse$inboundSchema; /** @deprecated use `ListCorrespondentOrdersResponse$outboundSchema` instead. */ export const outboundSchema = ListCorrespondentOrdersResponse$outboundSchema; /** @deprecated use `ListCorrespondentOrdersResponse$Outbound` instead. */ export type Outbound = ListCorrespondentOrdersResponse$Outbound; } export function listCorrespondentOrdersResponseToJSON( listCorrespondentOrdersResponse: ListCorrespondentOrdersResponse, ): string { return JSON.stringify( ListCorrespondentOrdersResponse$outboundSchema.parse( listCorrespondentOrdersResponse, ), ); } export function listCorrespondentOrdersResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListCorrespondentOrdersResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListCorrespondentOrdersResponse' from JSON`, ); }