/* * 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 AccountsListLegalEntitiesRequest = { /** * The maximum number of legal entities to return. The service may return fewer than this value. If unspecified, at most 25 legal entities will be returned. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number | undefined; /** * A page token, received from a previous `ListLegalEntities` call. Provide this to retrieve the subsequent page. * * @remarks * * When paginating, all other parameters provided to `ListLegalEntities` must match the call that provided the page token. */ pageToken?: string | undefined; /** * The order in which legal entities are listed. */ orderBy?: string | undefined; /** * A CEL string to filter results; Use `upperAscii()` for case-insensitive searches; E.g. `entity_name.upperAscii()=="AcMe,InC".upperAscii()`; See the [CEL Search](https://developer.apexclearing.com/apex-fintech-solutions/docs/cel-search) page in Guides for more information; Filter options include: * * @remarks * `legal_entity_id` * `investigation_id` * `exempt_customer_reason` * `exempt_verifying_beneficial_owners` */ filter?: string | undefined; }; export type AccountsListLegalEntitiesResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listLegalEntitiesResponse?: components.ListLegalEntitiesResponse | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsListLegalEntitiesRequest$inboundSchema: z.ZodType< AccountsListLegalEntitiesRequest, z.ZodTypeDef, unknown > = z.object({ page_size: z.number().int().optional(), page_token: z.string().optional(), order_by: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { "page_size": "pageSize", "page_token": "pageToken", "order_by": "orderBy", }); }); /** @internal */ export type AccountsListLegalEntitiesRequest$Outbound = { page_size?: number | undefined; page_token?: string | undefined; order_by?: string | undefined; filter?: string | undefined; }; /** @internal */ export const AccountsListLegalEntitiesRequest$outboundSchema: z.ZodType< AccountsListLegalEntitiesRequest$Outbound, z.ZodTypeDef, AccountsListLegalEntitiesRequest > = z.object({ pageSize: z.number().int().optional(), pageToken: z.string().optional(), orderBy: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { pageSize: "page_size", pageToken: "page_token", orderBy: "order_by", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsListLegalEntitiesRequest$ { /** @deprecated use `AccountsListLegalEntitiesRequest$inboundSchema` instead. */ export const inboundSchema = AccountsListLegalEntitiesRequest$inboundSchema; /** @deprecated use `AccountsListLegalEntitiesRequest$outboundSchema` instead. */ export const outboundSchema = AccountsListLegalEntitiesRequest$outboundSchema; /** @deprecated use `AccountsListLegalEntitiesRequest$Outbound` instead. */ export type Outbound = AccountsListLegalEntitiesRequest$Outbound; } export function accountsListLegalEntitiesRequestToJSON( accountsListLegalEntitiesRequest: AccountsListLegalEntitiesRequest, ): string { return JSON.stringify( AccountsListLegalEntitiesRequest$outboundSchema.parse( accountsListLegalEntitiesRequest, ), ); } export function accountsListLegalEntitiesRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsListLegalEntitiesRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsListLegalEntitiesRequest' from JSON`, ); } /** @internal */ export const AccountsListLegalEntitiesResponse$inboundSchema: z.ZodType< AccountsListLegalEntitiesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListLegalEntitiesResponse: components.ListLegalEntitiesResponse$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListLegalEntitiesResponse": "listLegalEntitiesResponse", "Status": "status", }); }); /** @internal */ export type AccountsListLegalEntitiesResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListLegalEntitiesResponse?: | components.ListLegalEntitiesResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsListLegalEntitiesResponse$outboundSchema: z.ZodType< AccountsListLegalEntitiesResponse$Outbound, z.ZodTypeDef, AccountsListLegalEntitiesResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listLegalEntitiesResponse: components.ListLegalEntitiesResponse$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listLegalEntitiesResponse: "ListLegalEntitiesResponse", 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 AccountsListLegalEntitiesResponse$ { /** @deprecated use `AccountsListLegalEntitiesResponse$inboundSchema` instead. */ export const inboundSchema = AccountsListLegalEntitiesResponse$inboundSchema; /** @deprecated use `AccountsListLegalEntitiesResponse$outboundSchema` instead. */ export const outboundSchema = AccountsListLegalEntitiesResponse$outboundSchema; /** @deprecated use `AccountsListLegalEntitiesResponse$Outbound` instead. */ export type Outbound = AccountsListLegalEntitiesResponse$Outbound; } export function accountsListLegalEntitiesResponseToJSON( accountsListLegalEntitiesResponse: AccountsListLegalEntitiesResponse, ): string { return JSON.stringify( AccountsListLegalEntitiesResponse$outboundSchema.parse( accountsListLegalEntitiesResponse, ), ); } export function accountsListLegalEntitiesResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsListLegalEntitiesResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsListLegalEntitiesResponse' from JSON`, ); }