/* * 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 InvestorCommunicationServiceListDocumentsRequest = { /** * The maximum number of items to return; The service may return fewer than this value */ pageSize?: number | undefined; /** * Token used to get a specific page of results */ pageToken?: string | undefined; /** * CEL filter to be applied against the documents; Providing a correspondent to search for is required; Only one correspondent can be searched at a time */ filter?: string | undefined; }; export type InvestorCommunicationServiceListDocumentsResponse = { httpMeta: components.HTTPMetadata; /** * OK */ listDocumentsResponse?: components.ListDocumentsResponse | undefined; /** * INVALID_ARGUMENT: The request was not well formed. */ status?: components.Status | undefined; }; /** @internal */ export const InvestorCommunicationServiceListDocumentsRequest$inboundSchema: z.ZodType< InvestorCommunicationServiceListDocumentsRequest, z.ZodTypeDef, unknown > = z.object({ page_size: z.number().int().optional(), page_token: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { "page_size": "pageSize", "page_token": "pageToken", }); }); /** @internal */ export type InvestorCommunicationServiceListDocumentsRequest$Outbound = { page_size?: number | undefined; page_token?: string | undefined; filter?: string | undefined; }; /** @internal */ export const InvestorCommunicationServiceListDocumentsRequest$outboundSchema: z.ZodType< InvestorCommunicationServiceListDocumentsRequest$Outbound, z.ZodTypeDef, InvestorCommunicationServiceListDocumentsRequest > = z.object({ pageSize: z.number().int().optional(), pageToken: z.string().optional(), filter: z.string().optional(), }).transform((v) => { return remap$(v, { pageSize: "page_size", pageToken: "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 InvestorCommunicationServiceListDocumentsRequest$ { /** @deprecated use `InvestorCommunicationServiceListDocumentsRequest$inboundSchema` instead. */ export const inboundSchema = InvestorCommunicationServiceListDocumentsRequest$inboundSchema; /** @deprecated use `InvestorCommunicationServiceListDocumentsRequest$outboundSchema` instead. */ export const outboundSchema = InvestorCommunicationServiceListDocumentsRequest$outboundSchema; /** @deprecated use `InvestorCommunicationServiceListDocumentsRequest$Outbound` instead. */ export type Outbound = InvestorCommunicationServiceListDocumentsRequest$Outbound; } export function investorCommunicationServiceListDocumentsRequestToJSON( investorCommunicationServiceListDocumentsRequest: InvestorCommunicationServiceListDocumentsRequest, ): string { return JSON.stringify( InvestorCommunicationServiceListDocumentsRequest$outboundSchema.parse( investorCommunicationServiceListDocumentsRequest, ), ); } export function investorCommunicationServiceListDocumentsRequestFromJSON( jsonString: string, ): SafeParseResult< InvestorCommunicationServiceListDocumentsRequest, SDKValidationError > { return safeParse( jsonString, (x) => InvestorCommunicationServiceListDocumentsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestorCommunicationServiceListDocumentsRequest' from JSON`, ); } /** @internal */ export const InvestorCommunicationServiceListDocumentsResponse$inboundSchema: z.ZodType< InvestorCommunicationServiceListDocumentsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, ListDocumentsResponse: components.ListDocumentsResponse$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "ListDocumentsResponse": "listDocumentsResponse", "Status": "status", }); }); /** @internal */ export type InvestorCommunicationServiceListDocumentsResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; ListDocumentsResponse?: components.ListDocumentsResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const InvestorCommunicationServiceListDocumentsResponse$outboundSchema: z.ZodType< InvestorCommunicationServiceListDocumentsResponse$Outbound, z.ZodTypeDef, InvestorCommunicationServiceListDocumentsResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, listDocumentsResponse: components.ListDocumentsResponse$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", listDocumentsResponse: "ListDocumentsResponse", 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 InvestorCommunicationServiceListDocumentsResponse$ { /** @deprecated use `InvestorCommunicationServiceListDocumentsResponse$inboundSchema` instead. */ export const inboundSchema = InvestorCommunicationServiceListDocumentsResponse$inboundSchema; /** @deprecated use `InvestorCommunicationServiceListDocumentsResponse$outboundSchema` instead. */ export const outboundSchema = InvestorCommunicationServiceListDocumentsResponse$outboundSchema; /** @deprecated use `InvestorCommunicationServiceListDocumentsResponse$Outbound` instead. */ export type Outbound = InvestorCommunicationServiceListDocumentsResponse$Outbound; } export function investorCommunicationServiceListDocumentsResponseToJSON( investorCommunicationServiceListDocumentsResponse: InvestorCommunicationServiceListDocumentsResponse, ): string { return JSON.stringify( InvestorCommunicationServiceListDocumentsResponse$outboundSchema.parse( investorCommunicationServiceListDocumentsResponse, ), ); } export function investorCommunicationServiceListDocumentsResponseFromJSON( jsonString: string, ): SafeParseResult< InvestorCommunicationServiceListDocumentsResponse, SDKValidationError > { return safeParse( jsonString, (x) => InvestorCommunicationServiceListDocumentsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestorCommunicationServiceListDocumentsResponse' from JSON`, ); }