/* * 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 { catchUnrecognizedEnum, OpenEnum, Unrecognized, } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AcatsAsset, AcatsAsset$inboundSchema, AcatsAsset$Outbound, AcatsAsset$outboundSchema, } from "./acatsasset.js"; /** * The external account information */ export type AcceptTransferResponseExternalAccount = { /** * The account identifier The account number for external communications */ accountNumber?: string | undefined; /** * Account owner title */ accountTitle?: string | undefined; /** * The NSCC brokerage / clearing house identifier */ participantNumber?: string | undefined; }; /** * The delivering party information */ export type AcceptTransferResponseDeliverer = { /** * The internal apex account id */ apexAccountId?: string | undefined; /** * The external account information */ externalAccount?: AcceptTransferResponseExternalAccount | null | undefined; }; /** * The direction of the transfer */ export enum AcceptTransferResponseDirection { DirectionUnspecified = "DIRECTION_UNSPECIFIED", Outgoing = "OUTGOING", Incoming = "INCOMING", } /** * The direction of the transfer */ export type AcceptTransferResponseDirectionOpen = OpenEnum< typeof AcceptTransferResponseDirection >; /** * The NSCC transfer status */ export enum AcceptTransferResponseNsccStatus { NsccStatusUnspecified = "NSCC_STATUS_UNSPECIFIED", Request = "REQUEST", RequestAdjust = "REQUEST_ADJUST", RequestAdjustPast = "REQUEST_ADJUST_PAST", RequestPast = "REQUEST_PAST", RequestReject = "REQUEST_REJECT", Review = "REVIEW", ReviewAdjustDeliverer = "REVIEW_ADJUST_DELIVERER", ReviewError = "REVIEW_ERROR", ReviewAccelerate = "REVIEW_ACCELERATE", ReviewAdjustReceiverAccelerate = "REVIEW_ADJUST_RECEIVER_ACCELERATE", SettlePrep = "SETTLE_PREP", SettleClose = "SETTLE_CLOSE", ClosePurge = "CLOSE_PURGE", PartialRequest = "PARTIAL_REQUEST", MemoPurgePartialTransferRequestReceiver = "MEMO_PURGE_PARTIAL_TRANSFER_REQUEST_RECEIVER", Reject = "REJECT", SystemPurge = "SYSTEM_PURGE", } /** * The NSCC transfer status */ export type AcceptTransferResponseNsccStatusOpen = OpenEnum< typeof AcceptTransferResponseNsccStatus >; /** * The external account information */ export type AcceptTransferResponseTransferExternalAccount = { /** * The account identifier The account number for external communications */ accountNumber?: string | undefined; /** * Account owner title */ accountTitle?: string | undefined; /** * The NSCC brokerage / clearing house identifier */ participantNumber?: string | undefined; }; /** * The receiving party information */ export type AcceptTransferResponseReceiver = { /** * The internal apex account id */ apexAccountId?: string | undefined; /** * The external account information */ externalAccount?: | AcceptTransferResponseTransferExternalAccount | null | undefined; }; /** * The reject code */ export enum AcceptTransferResponseRejectCode { RejectCodeUnspecified = "REJECT_CODE_UNSPECIFIED", RejectCodeSsnTaxIdMismatch = "REJECT_CODE_SSN_TAX_ID_MISMATCH", RejectCodeAccountTitleMismatch = "REJECT_CODE_ACCOUNT_TITLE_MISMATCH", RejectCodeDocumentationNeeded = "REJECT_CODE_DOCUMENTATION_NEEDED", RejectCodeAccountFlat = "REJECT_CODE_ACCOUNT_FLAT", RejectCodeInvalidAccountNumber = "REJECT_CODE_INVALID_ACCOUNT_NUMBER", RejectCodeDuplicate = "REJECT_CODE_DUPLICATE", RejectCodeAccountInDistributionOrTransfer = "REJECT_CODE_ACCOUNT_IN_DISTRIBUTION_OR_TRANSFER", RejectCodeClientRescinded = "REJECT_CODE_CLIENT_RESCINDED", RejectCodeMissingAuthorizationSignature = "REJECT_CODE_MISSING_AUTHORIZATION_SIGNATURE", RejectCodeAccountViolatesCreditPolicyOfReceivingFirm = "REJECT_CODE_ACCOUNT_VIOLATES_CREDIT_POLICY_OF_RECEIVING_FIRM", RejectCodeUnrecognizedForResidualCreditBalance = "REJECT_CODE_UNRECOGNIZED_FOR_RESIDUAL_CREDIT_BALANCE", RejectCodePartialTransferDeliverer = "REJECT_CODE_PARTIAL_TRANSFER_DELIVERER", RejectCodeFailReversal = "REJECT_CODE_FAIL_REVERSAL", RejectCodeReclaim = "REJECT_CODE_RECLAIM", RejectCodeMutualFundCleanup = "REJECT_CODE_MUTUAL_FUND_CLEANUP", } /** * The reject code */ export type AcceptTransferResponseRejectCodeOpen = OpenEnum< typeof AcceptTransferResponseRejectCode >; /** * The transfer state */ export enum AcceptTransferResponseState { StateUnspecified = "STATE_UNSPECIFIED", Received = "RECEIVED", Submitted = "SUBMITTED", Rejected = "REJECTED", PendingContraResponse = "PENDING_CONTRA_RESPONSE", Error = "ERROR", Accepted = "ACCEPTED", PendingReview = "PENDING_REVIEW", PendingRejection = "PENDING_REJECTION", PendingSettlement = "PENDING_SETTLEMENT", PendingBookkeeping = "PENDING_BOOKKEEPING", Completed = "COMPLETED", Purged = "PURGED", } /** * The transfer state */ export type AcceptTransferResponseStateOpen = OpenEnum< typeof AcceptTransferResponseState >; /** * The type of transfer */ export enum AcceptTransferResponseTransferType { TransferTypeUnspecified = "TRANSFER_TYPE_UNSPECIFIED", FailReversalBrokerToBrokerOnly = "FAIL_REVERSAL_BROKER_TO_BROKER_ONLY", FullTransfer = "FULL_TRANSFER", MutualFundCleanup = "MUTUAL_FUND_CLEANUP", PartialTransferDeliverer = "PARTIAL_TRANSFER_DELIVERER", PartialTransferReceiver = "PARTIAL_TRANSFER_RECEIVER", PositionTransferFundFirmToMutualFundCompanyOnly = "POSITION_TRANSFER_FUND_FIRM_TO_MUTUAL_FUND_COMPANY_ONLY", Reclaim = "RECLAIM", ResidualCredit = "RESIDUAL_CREDIT", } /** * The type of transfer */ export type AcceptTransferResponseTransferTypeOpen = OpenEnum< typeof AcceptTransferResponseTransferType >; /** * The accepted transfer's resource */ export type Transfer = { /** * The NSCC transfer identifier */ acatControlNumber?: string | undefined; /** * The assets being transferred (Cash, Equities, etc.) */ assets?: Array | undefined; /** * User supplied comment */ comment?: string | undefined; /** * The transfer creation timestamp */ createTime?: Date | null | undefined; /** * The delivering party information */ deliverer?: AcceptTransferResponseDeliverer | null | undefined; /** * The direction of the transfer */ direction?: AcceptTransferResponseDirectionOpen | undefined; /** * The service generated name of the transfer. Format: correspondents/{correspondent_id}/accounts/{account_id}/transfers/{transfer_id} */ name?: string | undefined; /** * The NSCC transfer status */ nsccStatus?: AcceptTransferResponseNsccStatusOpen | undefined; /** * An associated NSCC transfer identifier, if applicable */ originalControlNumber?: string | undefined; /** * The receiving party information */ receiver?: AcceptTransferResponseReceiver | null | undefined; /** * The reject code */ rejectCode?: AcceptTransferResponseRejectCodeOpen | undefined; /** * The transfer state */ state?: AcceptTransferResponseStateOpen | undefined; /** * A reason for the state if applicable */ stateReason?: string | undefined; /** * The type of transfer */ transferType?: AcceptTransferResponseTransferTypeOpen | undefined; }; /** * Response from accepting internal Ascend transfers. If this is the second side (delivering/receiving) of an internal transfer that is being accepted, bookkeeping is performed immediately and both sides of the internal transfer would be complete barring any errors. */ export type AcceptTransferResponse = { /** * The accepted transfer's resource */ transfer?: Transfer | null | undefined; }; /** @internal */ export const AcceptTransferResponseExternalAccount$inboundSchema: z.ZodType< AcceptTransferResponseExternalAccount, z.ZodTypeDef, unknown > = z.object({ account_number: z.string().optional(), account_title: z.string().optional(), participant_number: z.string().optional(), }).transform((v) => { return remap$(v, { "account_number": "accountNumber", "account_title": "accountTitle", "participant_number": "participantNumber", }); }); /** @internal */ export type AcceptTransferResponseExternalAccount$Outbound = { account_number?: string | undefined; account_title?: string | undefined; participant_number?: string | undefined; }; /** @internal */ export const AcceptTransferResponseExternalAccount$outboundSchema: z.ZodType< AcceptTransferResponseExternalAccount$Outbound, z.ZodTypeDef, AcceptTransferResponseExternalAccount > = z.object({ accountNumber: z.string().optional(), accountTitle: z.string().optional(), participantNumber: z.string().optional(), }).transform((v) => { return remap$(v, { accountNumber: "account_number", accountTitle: "account_title", participantNumber: "participant_number", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseExternalAccount$ { /** @deprecated use `AcceptTransferResponseExternalAccount$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseExternalAccount$inboundSchema; /** @deprecated use `AcceptTransferResponseExternalAccount$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseExternalAccount$outboundSchema; /** @deprecated use `AcceptTransferResponseExternalAccount$Outbound` instead. */ export type Outbound = AcceptTransferResponseExternalAccount$Outbound; } export function acceptTransferResponseExternalAccountToJSON( acceptTransferResponseExternalAccount: AcceptTransferResponseExternalAccount, ): string { return JSON.stringify( AcceptTransferResponseExternalAccount$outboundSchema.parse( acceptTransferResponseExternalAccount, ), ); } export function acceptTransferResponseExternalAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AcceptTransferResponseExternalAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AcceptTransferResponseExternalAccount' from JSON`, ); } /** @internal */ export const AcceptTransferResponseDeliverer$inboundSchema: z.ZodType< AcceptTransferResponseDeliverer, z.ZodTypeDef, unknown > = z.object({ apex_account_id: z.string().optional(), external_account: z.nullable( z.lazy(() => AcceptTransferResponseExternalAccount$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "apex_account_id": "apexAccountId", "external_account": "externalAccount", }); }); /** @internal */ export type AcceptTransferResponseDeliverer$Outbound = { apex_account_id?: string | undefined; external_account?: | AcceptTransferResponseExternalAccount$Outbound | null | undefined; }; /** @internal */ export const AcceptTransferResponseDeliverer$outboundSchema: z.ZodType< AcceptTransferResponseDeliverer$Outbound, z.ZodTypeDef, AcceptTransferResponseDeliverer > = z.object({ apexAccountId: z.string().optional(), externalAccount: z.nullable( z.lazy(() => AcceptTransferResponseExternalAccount$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { apexAccountId: "apex_account_id", externalAccount: "external_account", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseDeliverer$ { /** @deprecated use `AcceptTransferResponseDeliverer$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseDeliverer$inboundSchema; /** @deprecated use `AcceptTransferResponseDeliverer$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseDeliverer$outboundSchema; /** @deprecated use `AcceptTransferResponseDeliverer$Outbound` instead. */ export type Outbound = AcceptTransferResponseDeliverer$Outbound; } export function acceptTransferResponseDelivererToJSON( acceptTransferResponseDeliverer: AcceptTransferResponseDeliverer, ): string { return JSON.stringify( AcceptTransferResponseDeliverer$outboundSchema.parse( acceptTransferResponseDeliverer, ), ); } export function acceptTransferResponseDelivererFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AcceptTransferResponseDeliverer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AcceptTransferResponseDeliverer' from JSON`, ); } /** @internal */ export const AcceptTransferResponseDirection$inboundSchema: z.ZodType< AcceptTransferResponseDirectionOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AcceptTransferResponseDirection), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AcceptTransferResponseDirection$outboundSchema: z.ZodType< AcceptTransferResponseDirectionOpen, z.ZodTypeDef, AcceptTransferResponseDirectionOpen > = z.union([ z.nativeEnum(AcceptTransferResponseDirection), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseDirection$ { /** @deprecated use `AcceptTransferResponseDirection$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseDirection$inboundSchema; /** @deprecated use `AcceptTransferResponseDirection$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseDirection$outboundSchema; } /** @internal */ export const AcceptTransferResponseNsccStatus$inboundSchema: z.ZodType< AcceptTransferResponseNsccStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AcceptTransferResponseNsccStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AcceptTransferResponseNsccStatus$outboundSchema: z.ZodType< AcceptTransferResponseNsccStatusOpen, z.ZodTypeDef, AcceptTransferResponseNsccStatusOpen > = z.union([ z.nativeEnum(AcceptTransferResponseNsccStatus), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseNsccStatus$ { /** @deprecated use `AcceptTransferResponseNsccStatus$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseNsccStatus$inboundSchema; /** @deprecated use `AcceptTransferResponseNsccStatus$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseNsccStatus$outboundSchema; } /** @internal */ export const AcceptTransferResponseTransferExternalAccount$inboundSchema: z.ZodType< AcceptTransferResponseTransferExternalAccount, z.ZodTypeDef, unknown > = z.object({ account_number: z.string().optional(), account_title: z.string().optional(), participant_number: z.string().optional(), }).transform((v) => { return remap$(v, { "account_number": "accountNumber", "account_title": "accountTitle", "participant_number": "participantNumber", }); }); /** @internal */ export type AcceptTransferResponseTransferExternalAccount$Outbound = { account_number?: string | undefined; account_title?: string | undefined; participant_number?: string | undefined; }; /** @internal */ export const AcceptTransferResponseTransferExternalAccount$outboundSchema: z.ZodType< AcceptTransferResponseTransferExternalAccount$Outbound, z.ZodTypeDef, AcceptTransferResponseTransferExternalAccount > = z.object({ accountNumber: z.string().optional(), accountTitle: z.string().optional(), participantNumber: z.string().optional(), }).transform((v) => { return remap$(v, { accountNumber: "account_number", accountTitle: "account_title", participantNumber: "participant_number", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseTransferExternalAccount$ { /** @deprecated use `AcceptTransferResponseTransferExternalAccount$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseTransferExternalAccount$inboundSchema; /** @deprecated use `AcceptTransferResponseTransferExternalAccount$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseTransferExternalAccount$outboundSchema; /** @deprecated use `AcceptTransferResponseTransferExternalAccount$Outbound` instead. */ export type Outbound = AcceptTransferResponseTransferExternalAccount$Outbound; } export function acceptTransferResponseTransferExternalAccountToJSON( acceptTransferResponseTransferExternalAccount: AcceptTransferResponseTransferExternalAccount, ): string { return JSON.stringify( AcceptTransferResponseTransferExternalAccount$outboundSchema.parse( acceptTransferResponseTransferExternalAccount, ), ); } export function acceptTransferResponseTransferExternalAccountFromJSON( jsonString: string, ): SafeParseResult< AcceptTransferResponseTransferExternalAccount, SDKValidationError > { return safeParse( jsonString, (x) => AcceptTransferResponseTransferExternalAccount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AcceptTransferResponseTransferExternalAccount' from JSON`, ); } /** @internal */ export const AcceptTransferResponseReceiver$inboundSchema: z.ZodType< AcceptTransferResponseReceiver, z.ZodTypeDef, unknown > = z.object({ apex_account_id: z.string().optional(), external_account: z.nullable( z.lazy(() => AcceptTransferResponseTransferExternalAccount$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "apex_account_id": "apexAccountId", "external_account": "externalAccount", }); }); /** @internal */ export type AcceptTransferResponseReceiver$Outbound = { apex_account_id?: string | undefined; external_account?: | AcceptTransferResponseTransferExternalAccount$Outbound | null | undefined; }; /** @internal */ export const AcceptTransferResponseReceiver$outboundSchema: z.ZodType< AcceptTransferResponseReceiver$Outbound, z.ZodTypeDef, AcceptTransferResponseReceiver > = z.object({ apexAccountId: z.string().optional(), externalAccount: z.nullable( z.lazy(() => AcceptTransferResponseTransferExternalAccount$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { apexAccountId: "apex_account_id", externalAccount: "external_account", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseReceiver$ { /** @deprecated use `AcceptTransferResponseReceiver$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseReceiver$inboundSchema; /** @deprecated use `AcceptTransferResponseReceiver$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseReceiver$outboundSchema; /** @deprecated use `AcceptTransferResponseReceiver$Outbound` instead. */ export type Outbound = AcceptTransferResponseReceiver$Outbound; } export function acceptTransferResponseReceiverToJSON( acceptTransferResponseReceiver: AcceptTransferResponseReceiver, ): string { return JSON.stringify( AcceptTransferResponseReceiver$outboundSchema.parse( acceptTransferResponseReceiver, ), ); } export function acceptTransferResponseReceiverFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AcceptTransferResponseReceiver$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AcceptTransferResponseReceiver' from JSON`, ); } /** @internal */ export const AcceptTransferResponseRejectCode$inboundSchema: z.ZodType< AcceptTransferResponseRejectCodeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AcceptTransferResponseRejectCode), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AcceptTransferResponseRejectCode$outboundSchema: z.ZodType< AcceptTransferResponseRejectCodeOpen, z.ZodTypeDef, AcceptTransferResponseRejectCodeOpen > = z.union([ z.nativeEnum(AcceptTransferResponseRejectCode), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseRejectCode$ { /** @deprecated use `AcceptTransferResponseRejectCode$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseRejectCode$inboundSchema; /** @deprecated use `AcceptTransferResponseRejectCode$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseRejectCode$outboundSchema; } /** @internal */ export const AcceptTransferResponseState$inboundSchema: z.ZodType< AcceptTransferResponseStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AcceptTransferResponseState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AcceptTransferResponseState$outboundSchema: z.ZodType< AcceptTransferResponseStateOpen, z.ZodTypeDef, AcceptTransferResponseStateOpen > = z.union([ z.nativeEnum(AcceptTransferResponseState), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseState$ { /** @deprecated use `AcceptTransferResponseState$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseState$inboundSchema; /** @deprecated use `AcceptTransferResponseState$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseState$outboundSchema; } /** @internal */ export const AcceptTransferResponseTransferType$inboundSchema: z.ZodType< AcceptTransferResponseTransferTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(AcceptTransferResponseTransferType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const AcceptTransferResponseTransferType$outboundSchema: z.ZodType< AcceptTransferResponseTransferTypeOpen, z.ZodTypeDef, AcceptTransferResponseTransferTypeOpen > = z.union([ z.nativeEnum(AcceptTransferResponseTransferType), z.string().and(z.custom>()), ]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponseTransferType$ { /** @deprecated use `AcceptTransferResponseTransferType$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponseTransferType$inboundSchema; /** @deprecated use `AcceptTransferResponseTransferType$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponseTransferType$outboundSchema; } /** @internal */ export const Transfer$inboundSchema: z.ZodType< Transfer, z.ZodTypeDef, unknown > = z.object({ acat_control_number: z.string().optional(), assets: z.array(AcatsAsset$inboundSchema).optional(), comment: z.string().optional(), create_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), deliverer: z.nullable( z.lazy(() => AcceptTransferResponseDeliverer$inboundSchema), ).optional(), direction: AcceptTransferResponseDirection$inboundSchema.optional(), name: z.string().optional(), nscc_status: AcceptTransferResponseNsccStatus$inboundSchema.optional(), original_control_number: z.string().optional(), receiver: z.nullable( z.lazy(() => AcceptTransferResponseReceiver$inboundSchema), ).optional(), reject_code: AcceptTransferResponseRejectCode$inboundSchema.optional(), state: AcceptTransferResponseState$inboundSchema.optional(), state_reason: z.string().optional(), transfer_type: AcceptTransferResponseTransferType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "acat_control_number": "acatControlNumber", "create_time": "createTime", "nscc_status": "nsccStatus", "original_control_number": "originalControlNumber", "reject_code": "rejectCode", "state_reason": "stateReason", "transfer_type": "transferType", }); }); /** @internal */ export type Transfer$Outbound = { acat_control_number?: string | undefined; assets?: Array | undefined; comment?: string | undefined; create_time?: string | null | undefined; deliverer?: AcceptTransferResponseDeliverer$Outbound | null | undefined; direction?: string | undefined; name?: string | undefined; nscc_status?: string | undefined; original_control_number?: string | undefined; receiver?: AcceptTransferResponseReceiver$Outbound | null | undefined; reject_code?: string | undefined; state?: string | undefined; state_reason?: string | undefined; transfer_type?: string | undefined; }; /** @internal */ export const Transfer$outboundSchema: z.ZodType< Transfer$Outbound, z.ZodTypeDef, Transfer > = z.object({ acatControlNumber: z.string().optional(), assets: z.array(AcatsAsset$outboundSchema).optional(), comment: z.string().optional(), createTime: z.nullable(z.date().transform(v => v.toISOString())).optional(), deliverer: z.nullable( z.lazy(() => AcceptTransferResponseDeliverer$outboundSchema), ).optional(), direction: AcceptTransferResponseDirection$outboundSchema.optional(), name: z.string().optional(), nsccStatus: AcceptTransferResponseNsccStatus$outboundSchema.optional(), originalControlNumber: z.string().optional(), receiver: z.nullable( z.lazy(() => AcceptTransferResponseReceiver$outboundSchema), ).optional(), rejectCode: AcceptTransferResponseRejectCode$outboundSchema.optional(), state: AcceptTransferResponseState$outboundSchema.optional(), stateReason: z.string().optional(), transferType: AcceptTransferResponseTransferType$outboundSchema.optional(), }).transform((v) => { return remap$(v, { acatControlNumber: "acat_control_number", createTime: "create_time", nsccStatus: "nscc_status", originalControlNumber: "original_control_number", rejectCode: "reject_code", stateReason: "state_reason", transferType: "transfer_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Transfer$ { /** @deprecated use `Transfer$inboundSchema` instead. */ export const inboundSchema = Transfer$inboundSchema; /** @deprecated use `Transfer$outboundSchema` instead. */ export const outboundSchema = Transfer$outboundSchema; /** @deprecated use `Transfer$Outbound` instead. */ export type Outbound = Transfer$Outbound; } export function transferToJSON(transfer: Transfer): string { return JSON.stringify(Transfer$outboundSchema.parse(transfer)); } export function transferFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Transfer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Transfer' from JSON`, ); } /** @internal */ export const AcceptTransferResponse$inboundSchema: z.ZodType< AcceptTransferResponse, z.ZodTypeDef, unknown > = z.object({ transfer: z.nullable(z.lazy(() => Transfer$inboundSchema)).optional(), }); /** @internal */ export type AcceptTransferResponse$Outbound = { transfer?: Transfer$Outbound | null | undefined; }; /** @internal */ export const AcceptTransferResponse$outboundSchema: z.ZodType< AcceptTransferResponse$Outbound, z.ZodTypeDef, AcceptTransferResponse > = z.object({ transfer: z.nullable(z.lazy(() => Transfer$outboundSchema)).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AcceptTransferResponse$ { /** @deprecated use `AcceptTransferResponse$inboundSchema` instead. */ export const inboundSchema = AcceptTransferResponse$inboundSchema; /** @deprecated use `AcceptTransferResponse$outboundSchema` instead. */ export const outboundSchema = AcceptTransferResponse$outboundSchema; /** @deprecated use `AcceptTransferResponse$Outbound` instead. */ export type Outbound = AcceptTransferResponse$Outbound; } export function acceptTransferResponseToJSON( acceptTransferResponse: AcceptTransferResponse, ): string { return JSON.stringify( AcceptTransferResponse$outboundSchema.parse(acceptTransferResponse), ); } export function acceptTransferResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AcceptTransferResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AcceptTransferResponse' from JSON`, ); }