/* * 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 RejectTransferResponseExternalAccount = { /** * 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 RejectTransferResponseDeliverer = { /** * The internal apex account id */ apexAccountId?: string | undefined; /** * The external account information */ externalAccount?: RejectTransferResponseExternalAccount | null | undefined; }; /** * The direction of the transfer */ export enum RejectTransferResponseDirection { DirectionUnspecified = "DIRECTION_UNSPECIFIED", Outgoing = "OUTGOING", Incoming = "INCOMING", } /** * The direction of the transfer */ export type RejectTransferResponseDirectionOpen = OpenEnum< typeof RejectTransferResponseDirection >; /** * The NSCC transfer status */ export enum RejectTransferResponseNsccStatus { 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 RejectTransferResponseNsccStatusOpen = OpenEnum< typeof RejectTransferResponseNsccStatus >; /** * The external account information */ export type RejectTransferResponseTransferExternalAccount = { /** * 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 RejectTransferResponseReceiver = { /** * The internal apex account id */ apexAccountId?: string | undefined; /** * The external account information */ externalAccount?: | RejectTransferResponseTransferExternalAccount | null | undefined; }; /** * The reject code */ export enum RejectTransferResponseRejectCode { 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 RejectTransferResponseRejectCodeOpen = OpenEnum< typeof RejectTransferResponseRejectCode >; /** * The transfer state */ export enum RejectTransferResponseState { 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 RejectTransferResponseStateOpen = OpenEnum< typeof RejectTransferResponseState >; /** * The type of transfer */ export enum RejectTransferResponseTransferType { 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 RejectTransferResponseTransferTypeOpen = OpenEnum< typeof RejectTransferResponseTransferType >; /** * The rejected transfer's resource */ export type RejectTransferResponseTransfer = { /** * 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?: RejectTransferResponseDeliverer | null | undefined; /** * The direction of the transfer */ direction?: RejectTransferResponseDirectionOpen | 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?: RejectTransferResponseNsccStatusOpen | undefined; /** * An associated NSCC transfer identifier, if applicable */ originalControlNumber?: string | undefined; /** * The receiving party information */ receiver?: RejectTransferResponseReceiver | null | undefined; /** * The reject code */ rejectCode?: RejectTransferResponseRejectCodeOpen | undefined; /** * The transfer state */ state?: RejectTransferResponseStateOpen | undefined; /** * A reason for the state if applicable */ stateReason?: string | undefined; /** * The type of transfer */ transferType?: RejectTransferResponseTransferTypeOpen | undefined; }; /** * Response from rejecting internal Ascend transfers. If this is the first side (delivering/receiving) of an internal transfer that is being rejected, the contra side would be implicitly rejected at the same time. */ export type RejectTransferResponse = { /** * The rejected transfer's resource */ transfer?: RejectTransferResponseTransfer | null | undefined; }; /** @internal */ export const RejectTransferResponseExternalAccount$inboundSchema: z.ZodType< RejectTransferResponseExternalAccount, 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 RejectTransferResponseExternalAccount$Outbound = { account_number?: string | undefined; account_title?: string | undefined; participant_number?: string | undefined; }; /** @internal */ export const RejectTransferResponseExternalAccount$outboundSchema: z.ZodType< RejectTransferResponseExternalAccount$Outbound, z.ZodTypeDef, RejectTransferResponseExternalAccount > = 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 RejectTransferResponseExternalAccount$ { /** @deprecated use `RejectTransferResponseExternalAccount$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseExternalAccount$inboundSchema; /** @deprecated use `RejectTransferResponseExternalAccount$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseExternalAccount$outboundSchema; /** @deprecated use `RejectTransferResponseExternalAccount$Outbound` instead. */ export type Outbound = RejectTransferResponseExternalAccount$Outbound; } export function rejectTransferResponseExternalAccountToJSON( rejectTransferResponseExternalAccount: RejectTransferResponseExternalAccount, ): string { return JSON.stringify( RejectTransferResponseExternalAccount$outboundSchema.parse( rejectTransferResponseExternalAccount, ), ); } export function rejectTransferResponseExternalAccountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RejectTransferResponseExternalAccount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectTransferResponseExternalAccount' from JSON`, ); } /** @internal */ export const RejectTransferResponseDeliverer$inboundSchema: z.ZodType< RejectTransferResponseDeliverer, z.ZodTypeDef, unknown > = z.object({ apex_account_id: z.string().optional(), external_account: z.nullable( z.lazy(() => RejectTransferResponseExternalAccount$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "apex_account_id": "apexAccountId", "external_account": "externalAccount", }); }); /** @internal */ export type RejectTransferResponseDeliverer$Outbound = { apex_account_id?: string | undefined; external_account?: | RejectTransferResponseExternalAccount$Outbound | null | undefined; }; /** @internal */ export const RejectTransferResponseDeliverer$outboundSchema: z.ZodType< RejectTransferResponseDeliverer$Outbound, z.ZodTypeDef, RejectTransferResponseDeliverer > = z.object({ apexAccountId: z.string().optional(), externalAccount: z.nullable( z.lazy(() => RejectTransferResponseExternalAccount$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 RejectTransferResponseDeliverer$ { /** @deprecated use `RejectTransferResponseDeliverer$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseDeliverer$inboundSchema; /** @deprecated use `RejectTransferResponseDeliverer$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseDeliverer$outboundSchema; /** @deprecated use `RejectTransferResponseDeliverer$Outbound` instead. */ export type Outbound = RejectTransferResponseDeliverer$Outbound; } export function rejectTransferResponseDelivererToJSON( rejectTransferResponseDeliverer: RejectTransferResponseDeliverer, ): string { return JSON.stringify( RejectTransferResponseDeliverer$outboundSchema.parse( rejectTransferResponseDeliverer, ), ); } export function rejectTransferResponseDelivererFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RejectTransferResponseDeliverer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectTransferResponseDeliverer' from JSON`, ); } /** @internal */ export const RejectTransferResponseDirection$inboundSchema: z.ZodType< RejectTransferResponseDirectionOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RejectTransferResponseDirection), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RejectTransferResponseDirection$outboundSchema: z.ZodType< RejectTransferResponseDirectionOpen, z.ZodTypeDef, RejectTransferResponseDirectionOpen > = z.union([ z.nativeEnum(RejectTransferResponseDirection), 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 RejectTransferResponseDirection$ { /** @deprecated use `RejectTransferResponseDirection$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseDirection$inboundSchema; /** @deprecated use `RejectTransferResponseDirection$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseDirection$outboundSchema; } /** @internal */ export const RejectTransferResponseNsccStatus$inboundSchema: z.ZodType< RejectTransferResponseNsccStatusOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RejectTransferResponseNsccStatus), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RejectTransferResponseNsccStatus$outboundSchema: z.ZodType< RejectTransferResponseNsccStatusOpen, z.ZodTypeDef, RejectTransferResponseNsccStatusOpen > = z.union([ z.nativeEnum(RejectTransferResponseNsccStatus), 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 RejectTransferResponseNsccStatus$ { /** @deprecated use `RejectTransferResponseNsccStatus$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseNsccStatus$inboundSchema; /** @deprecated use `RejectTransferResponseNsccStatus$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseNsccStatus$outboundSchema; } /** @internal */ export const RejectTransferResponseTransferExternalAccount$inboundSchema: z.ZodType< RejectTransferResponseTransferExternalAccount, 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 RejectTransferResponseTransferExternalAccount$Outbound = { account_number?: string | undefined; account_title?: string | undefined; participant_number?: string | undefined; }; /** @internal */ export const RejectTransferResponseTransferExternalAccount$outboundSchema: z.ZodType< RejectTransferResponseTransferExternalAccount$Outbound, z.ZodTypeDef, RejectTransferResponseTransferExternalAccount > = 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 RejectTransferResponseTransferExternalAccount$ { /** @deprecated use `RejectTransferResponseTransferExternalAccount$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseTransferExternalAccount$inboundSchema; /** @deprecated use `RejectTransferResponseTransferExternalAccount$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseTransferExternalAccount$outboundSchema; /** @deprecated use `RejectTransferResponseTransferExternalAccount$Outbound` instead. */ export type Outbound = RejectTransferResponseTransferExternalAccount$Outbound; } export function rejectTransferResponseTransferExternalAccountToJSON( rejectTransferResponseTransferExternalAccount: RejectTransferResponseTransferExternalAccount, ): string { return JSON.stringify( RejectTransferResponseTransferExternalAccount$outboundSchema.parse( rejectTransferResponseTransferExternalAccount, ), ); } export function rejectTransferResponseTransferExternalAccountFromJSON( jsonString: string, ): SafeParseResult< RejectTransferResponseTransferExternalAccount, SDKValidationError > { return safeParse( jsonString, (x) => RejectTransferResponseTransferExternalAccount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RejectTransferResponseTransferExternalAccount' from JSON`, ); } /** @internal */ export const RejectTransferResponseReceiver$inboundSchema: z.ZodType< RejectTransferResponseReceiver, z.ZodTypeDef, unknown > = z.object({ apex_account_id: z.string().optional(), external_account: z.nullable( z.lazy(() => RejectTransferResponseTransferExternalAccount$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "apex_account_id": "apexAccountId", "external_account": "externalAccount", }); }); /** @internal */ export type RejectTransferResponseReceiver$Outbound = { apex_account_id?: string | undefined; external_account?: | RejectTransferResponseTransferExternalAccount$Outbound | null | undefined; }; /** @internal */ export const RejectTransferResponseReceiver$outboundSchema: z.ZodType< RejectTransferResponseReceiver$Outbound, z.ZodTypeDef, RejectTransferResponseReceiver > = z.object({ apexAccountId: z.string().optional(), externalAccount: z.nullable( z.lazy(() => RejectTransferResponseTransferExternalAccount$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 RejectTransferResponseReceiver$ { /** @deprecated use `RejectTransferResponseReceiver$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseReceiver$inboundSchema; /** @deprecated use `RejectTransferResponseReceiver$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseReceiver$outboundSchema; /** @deprecated use `RejectTransferResponseReceiver$Outbound` instead. */ export type Outbound = RejectTransferResponseReceiver$Outbound; } export function rejectTransferResponseReceiverToJSON( rejectTransferResponseReceiver: RejectTransferResponseReceiver, ): string { return JSON.stringify( RejectTransferResponseReceiver$outboundSchema.parse( rejectTransferResponseReceiver, ), ); } export function rejectTransferResponseReceiverFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RejectTransferResponseReceiver$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectTransferResponseReceiver' from JSON`, ); } /** @internal */ export const RejectTransferResponseRejectCode$inboundSchema: z.ZodType< RejectTransferResponseRejectCodeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RejectTransferResponseRejectCode), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RejectTransferResponseRejectCode$outboundSchema: z.ZodType< RejectTransferResponseRejectCodeOpen, z.ZodTypeDef, RejectTransferResponseRejectCodeOpen > = z.union([ z.nativeEnum(RejectTransferResponseRejectCode), 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 RejectTransferResponseRejectCode$ { /** @deprecated use `RejectTransferResponseRejectCode$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseRejectCode$inboundSchema; /** @deprecated use `RejectTransferResponseRejectCode$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseRejectCode$outboundSchema; } /** @internal */ export const RejectTransferResponseState$inboundSchema: z.ZodType< RejectTransferResponseStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RejectTransferResponseState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RejectTransferResponseState$outboundSchema: z.ZodType< RejectTransferResponseStateOpen, z.ZodTypeDef, RejectTransferResponseStateOpen > = z.union([ z.nativeEnum(RejectTransferResponseState), 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 RejectTransferResponseState$ { /** @deprecated use `RejectTransferResponseState$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseState$inboundSchema; /** @deprecated use `RejectTransferResponseState$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseState$outboundSchema; } /** @internal */ export const RejectTransferResponseTransferType$inboundSchema: z.ZodType< RejectTransferResponseTransferTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RejectTransferResponseTransferType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RejectTransferResponseTransferType$outboundSchema: z.ZodType< RejectTransferResponseTransferTypeOpen, z.ZodTypeDef, RejectTransferResponseTransferTypeOpen > = z.union([ z.nativeEnum(RejectTransferResponseTransferType), 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 RejectTransferResponseTransferType$ { /** @deprecated use `RejectTransferResponseTransferType$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseTransferType$inboundSchema; /** @deprecated use `RejectTransferResponseTransferType$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseTransferType$outboundSchema; } /** @internal */ export const RejectTransferResponseTransfer$inboundSchema: z.ZodType< RejectTransferResponseTransfer, 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(() => RejectTransferResponseDeliverer$inboundSchema), ).optional(), direction: RejectTransferResponseDirection$inboundSchema.optional(), name: z.string().optional(), nscc_status: RejectTransferResponseNsccStatus$inboundSchema.optional(), original_control_number: z.string().optional(), receiver: z.nullable( z.lazy(() => RejectTransferResponseReceiver$inboundSchema), ).optional(), reject_code: RejectTransferResponseRejectCode$inboundSchema.optional(), state: RejectTransferResponseState$inboundSchema.optional(), state_reason: z.string().optional(), transfer_type: RejectTransferResponseTransferType$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 RejectTransferResponseTransfer$Outbound = { acat_control_number?: string | undefined; assets?: Array | undefined; comment?: string | undefined; create_time?: string | null | undefined; deliverer?: RejectTransferResponseDeliverer$Outbound | null | undefined; direction?: string | undefined; name?: string | undefined; nscc_status?: string | undefined; original_control_number?: string | undefined; receiver?: RejectTransferResponseReceiver$Outbound | null | undefined; reject_code?: string | undefined; state?: string | undefined; state_reason?: string | undefined; transfer_type?: string | undefined; }; /** @internal */ export const RejectTransferResponseTransfer$outboundSchema: z.ZodType< RejectTransferResponseTransfer$Outbound, z.ZodTypeDef, RejectTransferResponseTransfer > = 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(() => RejectTransferResponseDeliverer$outboundSchema), ).optional(), direction: RejectTransferResponseDirection$outboundSchema.optional(), name: z.string().optional(), nsccStatus: RejectTransferResponseNsccStatus$outboundSchema.optional(), originalControlNumber: z.string().optional(), receiver: z.nullable( z.lazy(() => RejectTransferResponseReceiver$outboundSchema), ).optional(), rejectCode: RejectTransferResponseRejectCode$outboundSchema.optional(), state: RejectTransferResponseState$outboundSchema.optional(), stateReason: z.string().optional(), transferType: RejectTransferResponseTransferType$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 RejectTransferResponseTransfer$ { /** @deprecated use `RejectTransferResponseTransfer$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponseTransfer$inboundSchema; /** @deprecated use `RejectTransferResponseTransfer$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponseTransfer$outboundSchema; /** @deprecated use `RejectTransferResponseTransfer$Outbound` instead. */ export type Outbound = RejectTransferResponseTransfer$Outbound; } export function rejectTransferResponseTransferToJSON( rejectTransferResponseTransfer: RejectTransferResponseTransfer, ): string { return JSON.stringify( RejectTransferResponseTransfer$outboundSchema.parse( rejectTransferResponseTransfer, ), ); } export function rejectTransferResponseTransferFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RejectTransferResponseTransfer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectTransferResponseTransfer' from JSON`, ); } /** @internal */ export const RejectTransferResponse$inboundSchema: z.ZodType< RejectTransferResponse, z.ZodTypeDef, unknown > = z.object({ transfer: z.nullable( z.lazy(() => RejectTransferResponseTransfer$inboundSchema), ).optional(), }); /** @internal */ export type RejectTransferResponse$Outbound = { transfer?: RejectTransferResponseTransfer$Outbound | null | undefined; }; /** @internal */ export const RejectTransferResponse$outboundSchema: z.ZodType< RejectTransferResponse$Outbound, z.ZodTypeDef, RejectTransferResponse > = z.object({ transfer: z.nullable( z.lazy(() => RejectTransferResponseTransfer$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 RejectTransferResponse$ { /** @deprecated use `RejectTransferResponse$inboundSchema` instead. */ export const inboundSchema = RejectTransferResponse$inboundSchema; /** @deprecated use `RejectTransferResponse$outboundSchema` instead. */ export const outboundSchema = RejectTransferResponse$outboundSchema; /** @deprecated use `RejectTransferResponse$Outbound` instead. */ export type Outbound = RejectTransferResponse$Outbound; } export function rejectTransferResponseToJSON( rejectTransferResponse: RejectTransferResponse, ): string { return JSON.stringify( RejectTransferResponse$outboundSchema.parse(rejectTransferResponse), ); } export function rejectTransferResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RejectTransferResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RejectTransferResponse' from JSON`, ); }