/* * 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 InvestigationServiceListInvestigationsRequest = { /** * The maximum number of records to return. Default is 50 The maximum is 200, values exceeding this will be set to 200 */ pageSize?: number | undefined; /** * The page token used to request a specific page of the search results */ pageToken?: string | undefined; /** * A CEL string to filter results; See the [CEL Search](https://developer.apexclearing.com/apex-fintech-solutions/docs/cel-search) page in Guides for more information; Filter options include: * * @remarks * ListInvestigationStatesResponse.investigation_states */ filter?: string | undefined; /** * The order in which investigations are listed. Only one field and direction can be specified. Supported fields (followed by 'asc' or 'desc'; 'asc' is default if left blank): * * @remarks * - investigation_request_state * - correspondent_id * - scope * - identity_verification * - watchlist_screen * - person.given_name * - person.family_name * - entity.legal_name * - created_at * - updated_at */ orderBy?: string | undefined; }; export type InvestigationServiceListInvestigationsResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listInvestigationsResponse?: | components.ListInvestigationsResponse | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const InvestigationServiceListInvestigationsRequest$inboundSchema: z.ZodType< InvestigationServiceListInvestigationsRequest, z.ZodTypeDef, unknown > = z.object({ page_size: z.number().int().optional(), page_token: z.string().optional(), filter: z.string().optional(), order_by: z.string().optional(), }).transform((v) => { return remap$(v, { "page_size": "pageSize", "page_token": "pageToken", "order_by": "orderBy", }); }); /** @internal */ export type InvestigationServiceListInvestigationsRequest$Outbound = { page_size?: number | undefined; page_token?: string | undefined; filter?: string | undefined; order_by?: string | undefined; }; /** @internal */ export const InvestigationServiceListInvestigationsRequest$outboundSchema: z.ZodType< InvestigationServiceListInvestigationsRequest$Outbound, z.ZodTypeDef, InvestigationServiceListInvestigationsRequest > = z.object({ pageSize: z.number().int().optional(), pageToken: z.string().optional(), filter: z.string().optional(), orderBy: 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 InvestigationServiceListInvestigationsRequest$ { /** @deprecated use `InvestigationServiceListInvestigationsRequest$inboundSchema` instead. */ export const inboundSchema = InvestigationServiceListInvestigationsRequest$inboundSchema; /** @deprecated use `InvestigationServiceListInvestigationsRequest$outboundSchema` instead. */ export const outboundSchema = InvestigationServiceListInvestigationsRequest$outboundSchema; /** @deprecated use `InvestigationServiceListInvestigationsRequest$Outbound` instead. */ export type Outbound = InvestigationServiceListInvestigationsRequest$Outbound; } export function investigationServiceListInvestigationsRequestToJSON( investigationServiceListInvestigationsRequest: InvestigationServiceListInvestigationsRequest, ): string { return JSON.stringify( InvestigationServiceListInvestigationsRequest$outboundSchema.parse( investigationServiceListInvestigationsRequest, ), ); } export function investigationServiceListInvestigationsRequestFromJSON( jsonString: string, ): SafeParseResult< InvestigationServiceListInvestigationsRequest, SDKValidationError > { return safeParse( jsonString, (x) => InvestigationServiceListInvestigationsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestigationServiceListInvestigationsRequest' from JSON`, ); } /** @internal */ export const InvestigationServiceListInvestigationsResponse$inboundSchema: z.ZodType< InvestigationServiceListInvestigationsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListInvestigationsResponse: components .ListInvestigationsResponse$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListInvestigationsResponse": "listInvestigationsResponse", "Status": "status", }); }); /** @internal */ export type InvestigationServiceListInvestigationsResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListInvestigationsResponse?: | components.ListInvestigationsResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const InvestigationServiceListInvestigationsResponse$outboundSchema: z.ZodType< InvestigationServiceListInvestigationsResponse$Outbound, z.ZodTypeDef, InvestigationServiceListInvestigationsResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listInvestigationsResponse: components .ListInvestigationsResponse$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listInvestigationsResponse: "ListInvestigationsResponse", 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 InvestigationServiceListInvestigationsResponse$ { /** @deprecated use `InvestigationServiceListInvestigationsResponse$inboundSchema` instead. */ export const inboundSchema = InvestigationServiceListInvestigationsResponse$inboundSchema; /** @deprecated use `InvestigationServiceListInvestigationsResponse$outboundSchema` instead. */ export const outboundSchema = InvestigationServiceListInvestigationsResponse$outboundSchema; /** @deprecated use `InvestigationServiceListInvestigationsResponse$Outbound` instead. */ export type Outbound = InvestigationServiceListInvestigationsResponse$Outbound; } export function investigationServiceListInvestigationsResponseToJSON( investigationServiceListInvestigationsResponse: InvestigationServiceListInvestigationsResponse, ): string { return JSON.stringify( InvestigationServiceListInvestigationsResponse$outboundSchema.parse( investigationServiceListInvestigationsResponse, ), ); } export function investigationServiceListInvestigationsResponseFromJSON( jsonString: string, ): SafeParseResult< InvestigationServiceListInvestigationsResponse, SDKValidationError > { return safeParse( jsonString, (x) => InvestigationServiceListInvestigationsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestigationServiceListInvestigationsResponse' from JSON`, ); }