/* * 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 { LegalEntity, LegalEntity$inboundSchema, LegalEntity$Outbound, LegalEntity$outboundSchema, } from "./legalentity.js"; /** * The response to list Legal Entities. */ export type ListLegalEntitiesResponse = { /** * The list of available legal entities */ legalEntities?: 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 ListLegalEntitiesResponse$inboundSchema: z.ZodType< ListLegalEntitiesResponse, z.ZodTypeDef, unknown > = z.object({ legal_entities: z.array(LegalEntity$inboundSchema).optional(), next_page_token: z.string().optional(), }).transform((v) => { return remap$(v, { "legal_entities": "legalEntities", "next_page_token": "nextPageToken", }); }); /** @internal */ export type ListLegalEntitiesResponse$Outbound = { legal_entities?: Array | undefined; next_page_token?: string | undefined; }; /** @internal */ export const ListLegalEntitiesResponse$outboundSchema: z.ZodType< ListLegalEntitiesResponse$Outbound, z.ZodTypeDef, ListLegalEntitiesResponse > = z.object({ legalEntities: z.array(LegalEntity$outboundSchema).optional(), nextPageToken: z.string().optional(), }).transform((v) => { return remap$(v, { legalEntities: "legal_entities", 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 ListLegalEntitiesResponse$ { /** @deprecated use `ListLegalEntitiesResponse$inboundSchema` instead. */ export const inboundSchema = ListLegalEntitiesResponse$inboundSchema; /** @deprecated use `ListLegalEntitiesResponse$outboundSchema` instead. */ export const outboundSchema = ListLegalEntitiesResponse$outboundSchema; /** @deprecated use `ListLegalEntitiesResponse$Outbound` instead. */ export type Outbound = ListLegalEntitiesResponse$Outbound; } export function listLegalEntitiesResponseToJSON( listLegalEntitiesResponse: ListLegalEntitiesResponse, ): string { return JSON.stringify( ListLegalEntitiesResponse$outboundSchema.parse(listLegalEntitiesResponse), ); } export function listLegalEntitiesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListLegalEntitiesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListLegalEntitiesResponse' from JSON`, ); }