/* * 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 { LegalNaturalPerson, LegalNaturalPerson$inboundSchema, LegalNaturalPerson$Outbound, LegalNaturalPerson$outboundSchema, } from "./legalnaturalperson.js"; /** * The response to list Legal Natural Persons. */ export type ListLegalNaturalPersonsResponse = { /** * The list of available legal natural persons */ legalNaturalPersons?: Array | undefined; /** * A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. */ nextPageToken?: string | undefined; }; /** @internal */ export const ListLegalNaturalPersonsResponse$inboundSchema: z.ZodType< ListLegalNaturalPersonsResponse, z.ZodTypeDef, unknown > = z.object({ legal_natural_persons: z.array(LegalNaturalPerson$inboundSchema).optional(), next_page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "legal_natural_persons": "legalNaturalPersons", "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListLegalNaturalPersonsResponse$Outbound = { legal_natural_persons?: Array | undefined; next_page_token?: string | undefined; }; /** @internal */ export const ListLegalNaturalPersonsResponse$outboundSchema: z.ZodType< ListLegalNaturalPersonsResponse$Outbound, z.ZodTypeDef, ListLegalNaturalPersonsResponse > = z.object({ legalNaturalPersons: z.array(LegalNaturalPerson$outboundSchema).optional(), nextPageToken: z.string().optional(), }).transform((v) => { return remap$(v, { legalNaturalPersons: "legal_natural_persons", 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 ListLegalNaturalPersonsResponse$ { /** @deprecated use `ListLegalNaturalPersonsResponse$inboundSchema` instead. */ export const inboundSchema = ListLegalNaturalPersonsResponse$inboundSchema; /** @deprecated use `ListLegalNaturalPersonsResponse$outboundSchema` instead. */ export const outboundSchema = ListLegalNaturalPersonsResponse$outboundSchema; /** @deprecated use `ListLegalNaturalPersonsResponse$Outbound` instead. */ export type Outbound = ListLegalNaturalPersonsResponse$Outbound; } export function listLegalNaturalPersonsResponseToJSON( listLegalNaturalPersonsResponse: ListLegalNaturalPersonsResponse, ): string { return JSON.stringify( ListLegalNaturalPersonsResponse$outboundSchema.parse( listLegalNaturalPersonsResponse, ), ); } export function listLegalNaturalPersonsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListLegalNaturalPersonsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListLegalNaturalPersonsResponse' from JSON`, ); }