/* * 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"; /** * The ICT program for which to locate the report. */ export enum ProgramDateFilterProgram { IctProgramUnspecified = "ICT_PROGRAM_UNSPECIFIED", BrokerPartner = "BROKER_PARTNER", DepositOnly = "DEPOSIT_ONLY", BankingPartner = "BANKING_PARTNER", MoneyTransmitter = "MONEY_TRANSMITTER", WithdrawalOnly = "WITHDRAWAL_ONLY", DigitalPartner = "DIGITAL_PARTNER", } export type IctReconReportsLocateIctReportRequest = { /** * The correspondent id. */ correspondentId: string; /** * The id of the ICT batch for which to locate the report. */ batchId?: string | undefined; /** * The ICT program for which to locate the report. */ programDateFilterProgram?: ProgramDateFilterProgram | undefined; /** * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */ programDateFilterProcessDateYear?: number | undefined; /** * Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */ programDateFilterProcessDateMonth?: number | undefined; /** * Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */ programDateFilterProcessDateDay?: number | undefined; }; export type IctReconReportsLocateIctReportResponse = { httpMeta: components.HTTPMetadata; /** * OK */ locateIctReportResponse?: components.LocateIctReportResponse | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const ProgramDateFilterProgram$inboundSchema: z.ZodNativeEnum< typeof ProgramDateFilterProgram > = z.nativeEnum(ProgramDateFilterProgram); /** @internal */ export const ProgramDateFilterProgram$outboundSchema: z.ZodNativeEnum< typeof ProgramDateFilterProgram > = ProgramDateFilterProgram$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ProgramDateFilterProgram$ { /** @deprecated use `ProgramDateFilterProgram$inboundSchema` instead. */ export const inboundSchema = ProgramDateFilterProgram$inboundSchema; /** @deprecated use `ProgramDateFilterProgram$outboundSchema` instead. */ export const outboundSchema = ProgramDateFilterProgram$outboundSchema; } /** @internal */ export const IctReconReportsLocateIctReportRequest$inboundSchema: z.ZodType< IctReconReportsLocateIctReportRequest, z.ZodTypeDef, unknown > = z.object({ correspondent_id: z.string(), batch_id: z.string().optional(), "program_date_filter.program": ProgramDateFilterProgram$inboundSchema .optional(), "program_date_filter.process_date.year": z.number().int().optional(), "program_date_filter.process_date.month": z.number().int().optional(), "program_date_filter.process_date.day": z.number().int().optional(), }).transform((v) => { return remap$(v, { "correspondent_id": "correspondentId", "batch_id": "batchId", "program_date_filter.program": "programDateFilterProgram", "program_date_filter.process_date.year": "programDateFilterProcessDateYear", "program_date_filter.process_date.month": "programDateFilterProcessDateMonth", "program_date_filter.process_date.day": "programDateFilterProcessDateDay", }); }); /** @internal */ export type IctReconReportsLocateIctReportRequest$Outbound = { correspondent_id: string; batch_id?: string | undefined; "program_date_filter.program"?: string | undefined; "program_date_filter.process_date.year"?: number | undefined; "program_date_filter.process_date.month"?: number | undefined; "program_date_filter.process_date.day"?: number | undefined; }; /** @internal */ export const IctReconReportsLocateIctReportRequest$outboundSchema: z.ZodType< IctReconReportsLocateIctReportRequest$Outbound, z.ZodTypeDef, IctReconReportsLocateIctReportRequest > = z.object({ correspondentId: z.string(), batchId: z.string().optional(), programDateFilterProgram: ProgramDateFilterProgram$outboundSchema.optional(), programDateFilterProcessDateYear: z.number().int().optional(), programDateFilterProcessDateMonth: z.number().int().optional(), programDateFilterProcessDateDay: z.number().int().optional(), }).transform((v) => { return remap$(v, { correspondentId: "correspondent_id", batchId: "batch_id", programDateFilterProgram: "program_date_filter.program", programDateFilterProcessDateYear: "program_date_filter.process_date.year", programDateFilterProcessDateMonth: "program_date_filter.process_date.month", programDateFilterProcessDateDay: "program_date_filter.process_date.day", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IctReconReportsLocateIctReportRequest$ { /** @deprecated use `IctReconReportsLocateIctReportRequest$inboundSchema` instead. */ export const inboundSchema = IctReconReportsLocateIctReportRequest$inboundSchema; /** @deprecated use `IctReconReportsLocateIctReportRequest$outboundSchema` instead. */ export const outboundSchema = IctReconReportsLocateIctReportRequest$outboundSchema; /** @deprecated use `IctReconReportsLocateIctReportRequest$Outbound` instead. */ export type Outbound = IctReconReportsLocateIctReportRequest$Outbound; } export function ictReconReportsLocateIctReportRequestToJSON( ictReconReportsLocateIctReportRequest: IctReconReportsLocateIctReportRequest, ): string { return JSON.stringify( IctReconReportsLocateIctReportRequest$outboundSchema.parse( ictReconReportsLocateIctReportRequest, ), ); } export function ictReconReportsLocateIctReportRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IctReconReportsLocateIctReportRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IctReconReportsLocateIctReportRequest' from JSON`, ); } /** @internal */ export const IctReconReportsLocateIctReportResponse$inboundSchema: z.ZodType< IctReconReportsLocateIctReportResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, LocateIctReportResponse: components.LocateIctReportResponse$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "LocateIctReportResponse": "locateIctReportResponse", "Status": "status", }); }); /** @internal */ export type IctReconReportsLocateIctReportResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; LocateIctReportResponse?: | components.LocateIctReportResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const IctReconReportsLocateIctReportResponse$outboundSchema: z.ZodType< IctReconReportsLocateIctReportResponse$Outbound, z.ZodTypeDef, IctReconReportsLocateIctReportResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, locateIctReportResponse: components.LocateIctReportResponse$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", locateIctReportResponse: "LocateIctReportResponse", 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 IctReconReportsLocateIctReportResponse$ { /** @deprecated use `IctReconReportsLocateIctReportResponse$inboundSchema` instead. */ export const inboundSchema = IctReconReportsLocateIctReportResponse$inboundSchema; /** @deprecated use `IctReconReportsLocateIctReportResponse$outboundSchema` instead. */ export const outboundSchema = IctReconReportsLocateIctReportResponse$outboundSchema; /** @deprecated use `IctReconReportsLocateIctReportResponse$Outbound` instead. */ export type Outbound = IctReconReportsLocateIctReportResponse$Outbound; } export function ictReconReportsLocateIctReportResponseToJSON( ictReconReportsLocateIctReportResponse: IctReconReportsLocateIctReportResponse, ): string { return JSON.stringify( IctReconReportsLocateIctReportResponse$outboundSchema.parse( ictReconReportsLocateIctReportResponse, ), ); } export function ictReconReportsLocateIctReportResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IctReconReportsLocateIctReportResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IctReconReportsLocateIctReportResponse' from JSON`, ); }