/* * 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 { BondYield, BondYield$inboundSchema, BondYield$Outbound, BondYield$outboundSchema, } from "./bondyield.js"; /** * The amount of interest that has been accrued in the issuing currency for a single instrument. Requirement of 15 or less integral number and 2 or less fractional precision. Required for FIXED_INCOME trades. Not allowed for trades of other instrument types. */ export type CancelExecutionResponseAccruedInterestAmount = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * Commission amount of the execution. Requirement of 11 or less integral number and 2 or less fractional precision. */ export type CancelExecutionResponseCommissionAmount = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * Gross amount is calculated by the Booking service by multiplying price and quantity and fixing it to 2 fractional precision. Requirement of 11 or less integral number and 2 or less fractional precision. Optionally specifiable. If present, will override the gross_amount calculated above. */ export type CancelExecutionResponseGrossAmount = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The price for the instrument that is prevailing in the market. Requirement of 8 or less integral number and 8 or less fractional precision. Required for FIXED_INCOME trades when the broker_capacity is PRINCIPAL. */ export type CancelExecutionResponsePrevailingMarketPrice = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * Price with requirement of 8 or less integral number and 8 or less fractional precision. */ export type CancelExecutionResponsePrice = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * Total monetary value of the price_adjustment */ export type CancelExecutionResponsePriceAdjustmentAmount = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The type of price adjustment being applied by the broker to the net price of the security. */ export enum CancelExecutionResponsePriceAdjustmentType { PriceAdjustmentTypeUnspecified = "PRICE_ADJUSTMENT_TYPE_UNSPECIFIED", Markup = "MARKUP", Markdown = "MARKDOWN", GrossCredit = "GROSS_CREDIT", } /** * The type of price adjustment being applied by the broker to the net price of the security. */ export type CancelExecutionResponsePriceAdjustmentTypeOpen = OpenEnum< typeof CancelExecutionResponsePriceAdjustmentType >; /** * Price adjustment that will be applied to the net price of the security. */ export type CancelExecutionResponsePriceAdjustment = { /** * Total monetary value of the price_adjustment */ priceAdjustmentAmount?: | CancelExecutionResponsePriceAdjustmentAmount | null | undefined; /** * The type of price adjustment being applied by the broker to the net price of the security. */ priceAdjustmentType?: | CancelExecutionResponsePriceAdjustmentTypeOpen | undefined; }; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ export type CancelExecutionResponseQuantity = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The state that the trade is in. */ export enum CancelExecutionResponseState { StateUnspecified = "STATE_UNSPECIFIED", Creating = "CREATING", Rebooking = "REBOOKING", Canceling = "CANCELING", Booked = "BOOKED", Rebooked = "REBOOKED", Canceled = "CANCELED", Failed = "FAILED", } /** * The state that the trade is in. */ export type CancelExecutionResponseStateOpen = OpenEnum< typeof CancelExecutionResponseState >; /** * The execution that was canceled. */ export type CancelExecutionResponseExecution = { /** * The amount of interest that has been accrued in the issuing currency for a single instrument. Requirement of 15 or less integral number and 2 or less fractional precision. Required for FIXED_INCOME trades. Not allowed for trades of other instrument types. */ accruedInterestAmount?: | CancelExecutionResponseAccruedInterestAmount | null | undefined; /** * The id of the activity in the Ledger that represents this trade. */ activityId?: string | undefined; /** * The yield associated with an individual fill of a fixed income trade. Required for FIXED_INCOME trades. Not allowed for trades of other instrument types. */ bondYield?: Array | undefined; /** * Commission amount of the execution. Requirement of 11 or less integral number and 2 or less fractional precision. */ commissionAmount?: CancelExecutionResponseCommissionAmount | null | undefined; /** * A ULID that uniquely identifies the execution. */ executionId?: string | undefined; /** * Timestamp of when the execution took place. If settlement_date is not provided, this field will be converted into Eastern Time and used to calculate settlement_date. */ executionTime?: Date | null | undefined; /** * Used to generate execution_id, should be unique on the day for each source_application caller. */ externalId?: string | undefined; /** * Gross amount is calculated by the Booking service by multiplying price and quantity and fixing it to 2 fractional precision. Requirement of 11 or less integral number and 2 or less fractional precision. Optionally specifiable. If present, will override the gross_amount calculated above. */ grossAmount?: CancelExecutionResponseGrossAmount | null | undefined; /** * Caller provided but can be used for booking-service to note original trade details when booking into the error account or using the error asset. */ memo?: string | undefined; /** * The resource name of the execution. */ name?: string | undefined; /** * The price for the instrument that is prevailing in the market. Requirement of 8 or less integral number and 8 or less fractional precision. Required for FIXED_INCOME trades when the broker_capacity is PRINCIPAL. */ prevailingMarketPrice?: | CancelExecutionResponsePrevailingMarketPrice | null | undefined; /** * Price with requirement of 8 or less integral number and 8 or less fractional precision. */ price?: CancelExecutionResponsePrice | null | undefined; /** * Price adjustment that will be applied to the net price of the security. */ priceAdjustment?: CancelExecutionResponsePriceAdjustment | null | undefined; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ quantity?: CancelExecutionResponseQuantity | null | undefined; /** * The state that the trade is in. */ state?: CancelExecutionResponseStateOpen | undefined; /** * Street-level execution id, unique by day per execution venue. */ streetExecutionId?: string | undefined; /** * The unique identifier of the trade this execution belongs to. */ tradeId?: string | undefined; }; /** * A response for the cancel execution method. */ export type CancelExecutionResponse = { /** * The execution that was canceled. */ execution?: CancelExecutionResponseExecution | null | undefined; }; /** @internal */ export const CancelExecutionResponseAccruedInterestAmount$inboundSchema: z.ZodType< CancelExecutionResponseAccruedInterestAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelExecutionResponseAccruedInterestAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelExecutionResponseAccruedInterestAmount$outboundSchema: z.ZodType< CancelExecutionResponseAccruedInterestAmount$Outbound, z.ZodTypeDef, CancelExecutionResponseAccruedInterestAmount > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponseAccruedInterestAmount$ { /** @deprecated use `CancelExecutionResponseAccruedInterestAmount$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponseAccruedInterestAmount$inboundSchema; /** @deprecated use `CancelExecutionResponseAccruedInterestAmount$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponseAccruedInterestAmount$outboundSchema; /** @deprecated use `CancelExecutionResponseAccruedInterestAmount$Outbound` instead. */ export type Outbound = CancelExecutionResponseAccruedInterestAmount$Outbound; } export function cancelExecutionResponseAccruedInterestAmountToJSON( cancelExecutionResponseAccruedInterestAmount: CancelExecutionResponseAccruedInterestAmount, ): string { return JSON.stringify( CancelExecutionResponseAccruedInterestAmount$outboundSchema.parse( cancelExecutionResponseAccruedInterestAmount, ), ); } export function cancelExecutionResponseAccruedInterestAmountFromJSON( jsonString: string, ): SafeParseResult< CancelExecutionResponseAccruedInterestAmount, SDKValidationError > { return safeParse( jsonString, (x) => CancelExecutionResponseAccruedInterestAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelExecutionResponseAccruedInterestAmount' from JSON`, ); } /** @internal */ export const CancelExecutionResponseCommissionAmount$inboundSchema: z.ZodType< CancelExecutionResponseCommissionAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelExecutionResponseCommissionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelExecutionResponseCommissionAmount$outboundSchema: z.ZodType< CancelExecutionResponseCommissionAmount$Outbound, z.ZodTypeDef, CancelExecutionResponseCommissionAmount > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponseCommissionAmount$ { /** @deprecated use `CancelExecutionResponseCommissionAmount$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponseCommissionAmount$inboundSchema; /** @deprecated use `CancelExecutionResponseCommissionAmount$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponseCommissionAmount$outboundSchema; /** @deprecated use `CancelExecutionResponseCommissionAmount$Outbound` instead. */ export type Outbound = CancelExecutionResponseCommissionAmount$Outbound; } export function cancelExecutionResponseCommissionAmountToJSON( cancelExecutionResponseCommissionAmount: CancelExecutionResponseCommissionAmount, ): string { return JSON.stringify( CancelExecutionResponseCommissionAmount$outboundSchema.parse( cancelExecutionResponseCommissionAmount, ), ); } export function cancelExecutionResponseCommissionAmountFromJSON( jsonString: string, ): SafeParseResult< CancelExecutionResponseCommissionAmount, SDKValidationError > { return safeParse( jsonString, (x) => CancelExecutionResponseCommissionAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelExecutionResponseCommissionAmount' from JSON`, ); } /** @internal */ export const CancelExecutionResponseGrossAmount$inboundSchema: z.ZodType< CancelExecutionResponseGrossAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelExecutionResponseGrossAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelExecutionResponseGrossAmount$outboundSchema: z.ZodType< CancelExecutionResponseGrossAmount$Outbound, z.ZodTypeDef, CancelExecutionResponseGrossAmount > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponseGrossAmount$ { /** @deprecated use `CancelExecutionResponseGrossAmount$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponseGrossAmount$inboundSchema; /** @deprecated use `CancelExecutionResponseGrossAmount$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponseGrossAmount$outboundSchema; /** @deprecated use `CancelExecutionResponseGrossAmount$Outbound` instead. */ export type Outbound = CancelExecutionResponseGrossAmount$Outbound; } export function cancelExecutionResponseGrossAmountToJSON( cancelExecutionResponseGrossAmount: CancelExecutionResponseGrossAmount, ): string { return JSON.stringify( CancelExecutionResponseGrossAmount$outboundSchema.parse( cancelExecutionResponseGrossAmount, ), ); } export function cancelExecutionResponseGrossAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelExecutionResponseGrossAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelExecutionResponseGrossAmount' from JSON`, ); } /** @internal */ export const CancelExecutionResponsePrevailingMarketPrice$inboundSchema: z.ZodType< CancelExecutionResponsePrevailingMarketPrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelExecutionResponsePrevailingMarketPrice$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelExecutionResponsePrevailingMarketPrice$outboundSchema: z.ZodType< CancelExecutionResponsePrevailingMarketPrice$Outbound, z.ZodTypeDef, CancelExecutionResponsePrevailingMarketPrice > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponsePrevailingMarketPrice$ { /** @deprecated use `CancelExecutionResponsePrevailingMarketPrice$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponsePrevailingMarketPrice$inboundSchema; /** @deprecated use `CancelExecutionResponsePrevailingMarketPrice$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponsePrevailingMarketPrice$outboundSchema; /** @deprecated use `CancelExecutionResponsePrevailingMarketPrice$Outbound` instead. */ export type Outbound = CancelExecutionResponsePrevailingMarketPrice$Outbound; } export function cancelExecutionResponsePrevailingMarketPriceToJSON( cancelExecutionResponsePrevailingMarketPrice: CancelExecutionResponsePrevailingMarketPrice, ): string { return JSON.stringify( CancelExecutionResponsePrevailingMarketPrice$outboundSchema.parse( cancelExecutionResponsePrevailingMarketPrice, ), ); } export function cancelExecutionResponsePrevailingMarketPriceFromJSON( jsonString: string, ): SafeParseResult< CancelExecutionResponsePrevailingMarketPrice, SDKValidationError > { return safeParse( jsonString, (x) => CancelExecutionResponsePrevailingMarketPrice$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelExecutionResponsePrevailingMarketPrice' from JSON`, ); } /** @internal */ export const CancelExecutionResponsePrice$inboundSchema: z.ZodType< CancelExecutionResponsePrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelExecutionResponsePrice$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelExecutionResponsePrice$outboundSchema: z.ZodType< CancelExecutionResponsePrice$Outbound, z.ZodTypeDef, CancelExecutionResponsePrice > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponsePrice$ { /** @deprecated use `CancelExecutionResponsePrice$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponsePrice$inboundSchema; /** @deprecated use `CancelExecutionResponsePrice$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponsePrice$outboundSchema; /** @deprecated use `CancelExecutionResponsePrice$Outbound` instead. */ export type Outbound = CancelExecutionResponsePrice$Outbound; } export function cancelExecutionResponsePriceToJSON( cancelExecutionResponsePrice: CancelExecutionResponsePrice, ): string { return JSON.stringify( CancelExecutionResponsePrice$outboundSchema.parse( cancelExecutionResponsePrice, ), ); } export function cancelExecutionResponsePriceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelExecutionResponsePrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelExecutionResponsePrice' from JSON`, ); } /** @internal */ export const CancelExecutionResponsePriceAdjustmentAmount$inboundSchema: z.ZodType< CancelExecutionResponsePriceAdjustmentAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelExecutionResponsePriceAdjustmentAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelExecutionResponsePriceAdjustmentAmount$outboundSchema: z.ZodType< CancelExecutionResponsePriceAdjustmentAmount$Outbound, z.ZodTypeDef, CancelExecutionResponsePriceAdjustmentAmount > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponsePriceAdjustmentAmount$ { /** @deprecated use `CancelExecutionResponsePriceAdjustmentAmount$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponsePriceAdjustmentAmount$inboundSchema; /** @deprecated use `CancelExecutionResponsePriceAdjustmentAmount$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponsePriceAdjustmentAmount$outboundSchema; /** @deprecated use `CancelExecutionResponsePriceAdjustmentAmount$Outbound` instead. */ export type Outbound = CancelExecutionResponsePriceAdjustmentAmount$Outbound; } export function cancelExecutionResponsePriceAdjustmentAmountToJSON( cancelExecutionResponsePriceAdjustmentAmount: CancelExecutionResponsePriceAdjustmentAmount, ): string { return JSON.stringify( CancelExecutionResponsePriceAdjustmentAmount$outboundSchema.parse( cancelExecutionResponsePriceAdjustmentAmount, ), ); } export function cancelExecutionResponsePriceAdjustmentAmountFromJSON( jsonString: string, ): SafeParseResult< CancelExecutionResponsePriceAdjustmentAmount, SDKValidationError > { return safeParse( jsonString, (x) => CancelExecutionResponsePriceAdjustmentAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'CancelExecutionResponsePriceAdjustmentAmount' from JSON`, ); } /** @internal */ export const CancelExecutionResponsePriceAdjustmentType$inboundSchema: z.ZodType< CancelExecutionResponsePriceAdjustmentTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelExecutionResponsePriceAdjustmentType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelExecutionResponsePriceAdjustmentType$outboundSchema: z.ZodType< CancelExecutionResponsePriceAdjustmentTypeOpen, z.ZodTypeDef, CancelExecutionResponsePriceAdjustmentTypeOpen > = z.union([ z.nativeEnum(CancelExecutionResponsePriceAdjustmentType), 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 CancelExecutionResponsePriceAdjustmentType$ { /** @deprecated use `CancelExecutionResponsePriceAdjustmentType$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponsePriceAdjustmentType$inboundSchema; /** @deprecated use `CancelExecutionResponsePriceAdjustmentType$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponsePriceAdjustmentType$outboundSchema; } /** @internal */ export const CancelExecutionResponsePriceAdjustment$inboundSchema: z.ZodType< CancelExecutionResponsePriceAdjustment, z.ZodTypeDef, unknown > = z.object({ price_adjustment_amount: z.nullable( z.lazy(() => CancelExecutionResponsePriceAdjustmentAmount$inboundSchema), ).optional(), price_adjustment_type: CancelExecutionResponsePriceAdjustmentType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "price_adjustment_amount": "priceAdjustmentAmount", "price_adjustment_type": "priceAdjustmentType", }); }); /** @internal */ export type CancelExecutionResponsePriceAdjustment$Outbound = { price_adjustment_amount?: | CancelExecutionResponsePriceAdjustmentAmount$Outbound | null | undefined; price_adjustment_type?: string | undefined; }; /** @internal */ export const CancelExecutionResponsePriceAdjustment$outboundSchema: z.ZodType< CancelExecutionResponsePriceAdjustment$Outbound, z.ZodTypeDef, CancelExecutionResponsePriceAdjustment > = z.object({ priceAdjustmentAmount: z.nullable( z.lazy(() => CancelExecutionResponsePriceAdjustmentAmount$outboundSchema), ).optional(), priceAdjustmentType: CancelExecutionResponsePriceAdjustmentType$outboundSchema .optional(), }).transform((v) => { return remap$(v, { priceAdjustmentAmount: "price_adjustment_amount", priceAdjustmentType: "price_adjustment_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponsePriceAdjustment$ { /** @deprecated use `CancelExecutionResponsePriceAdjustment$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponsePriceAdjustment$inboundSchema; /** @deprecated use `CancelExecutionResponsePriceAdjustment$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponsePriceAdjustment$outboundSchema; /** @deprecated use `CancelExecutionResponsePriceAdjustment$Outbound` instead. */ export type Outbound = CancelExecutionResponsePriceAdjustment$Outbound; } export function cancelExecutionResponsePriceAdjustmentToJSON( cancelExecutionResponsePriceAdjustment: CancelExecutionResponsePriceAdjustment, ): string { return JSON.stringify( CancelExecutionResponsePriceAdjustment$outboundSchema.parse( cancelExecutionResponsePriceAdjustment, ), ); } export function cancelExecutionResponsePriceAdjustmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelExecutionResponsePriceAdjustment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelExecutionResponsePriceAdjustment' from JSON`, ); } /** @internal */ export const CancelExecutionResponseQuantity$inboundSchema: z.ZodType< CancelExecutionResponseQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type CancelExecutionResponseQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const CancelExecutionResponseQuantity$outboundSchema: z.ZodType< CancelExecutionResponseQuantity$Outbound, z.ZodTypeDef, CancelExecutionResponseQuantity > = z.object({ value: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponseQuantity$ { /** @deprecated use `CancelExecutionResponseQuantity$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponseQuantity$inboundSchema; /** @deprecated use `CancelExecutionResponseQuantity$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponseQuantity$outboundSchema; /** @deprecated use `CancelExecutionResponseQuantity$Outbound` instead. */ export type Outbound = CancelExecutionResponseQuantity$Outbound; } export function cancelExecutionResponseQuantityToJSON( cancelExecutionResponseQuantity: CancelExecutionResponseQuantity, ): string { return JSON.stringify( CancelExecutionResponseQuantity$outboundSchema.parse( cancelExecutionResponseQuantity, ), ); } export function cancelExecutionResponseQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelExecutionResponseQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelExecutionResponseQuantity' from JSON`, ); } /** @internal */ export const CancelExecutionResponseState$inboundSchema: z.ZodType< CancelExecutionResponseStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(CancelExecutionResponseState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const CancelExecutionResponseState$outboundSchema: z.ZodType< CancelExecutionResponseStateOpen, z.ZodTypeDef, CancelExecutionResponseStateOpen > = z.union([ z.nativeEnum(CancelExecutionResponseState), 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 CancelExecutionResponseState$ { /** @deprecated use `CancelExecutionResponseState$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponseState$inboundSchema; /** @deprecated use `CancelExecutionResponseState$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponseState$outboundSchema; } /** @internal */ export const CancelExecutionResponseExecution$inboundSchema: z.ZodType< CancelExecutionResponseExecution, z.ZodTypeDef, unknown > = z.object({ accrued_interest_amount: z.nullable( z.lazy(() => CancelExecutionResponseAccruedInterestAmount$inboundSchema), ).optional(), activity_id: z.string().optional(), bond_yield: z.array(BondYield$inboundSchema).optional(), commission_amount: z.nullable( z.lazy(() => CancelExecutionResponseCommissionAmount$inboundSchema), ).optional(), execution_id: z.string().optional(), execution_time: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), external_id: z.string().optional(), gross_amount: z.nullable( z.lazy(() => CancelExecutionResponseGrossAmount$inboundSchema), ).optional(), memo: z.string().optional(), name: z.string().optional(), prevailing_market_price: z.nullable( z.lazy(() => CancelExecutionResponsePrevailingMarketPrice$inboundSchema), ).optional(), price: z.nullable(z.lazy(() => CancelExecutionResponsePrice$inboundSchema)) .optional(), price_adjustment: z.nullable( z.lazy(() => CancelExecutionResponsePriceAdjustment$inboundSchema), ).optional(), quantity: z.nullable( z.lazy(() => CancelExecutionResponseQuantity$inboundSchema), ).optional(), state: CancelExecutionResponseState$inboundSchema.optional(), street_execution_id: z.string().optional(), trade_id: z.string().optional(), }).transform((v) => { return remap$(v, { "accrued_interest_amount": "accruedInterestAmount", "activity_id": "activityId", "bond_yield": "bondYield", "commission_amount": "commissionAmount", "execution_id": "executionId", "execution_time": "executionTime", "external_id": "externalId", "gross_amount": "grossAmount", "prevailing_market_price": "prevailingMarketPrice", "price_adjustment": "priceAdjustment", "street_execution_id": "streetExecutionId", "trade_id": "tradeId", }); }); /** @internal */ export type CancelExecutionResponseExecution$Outbound = { accrued_interest_amount?: | CancelExecutionResponseAccruedInterestAmount$Outbound | null | undefined; activity_id?: string | undefined; bond_yield?: Array | undefined; commission_amount?: | CancelExecutionResponseCommissionAmount$Outbound | null | undefined; execution_id?: string | undefined; execution_time?: string | null | undefined; external_id?: string | undefined; gross_amount?: CancelExecutionResponseGrossAmount$Outbound | null | undefined; memo?: string | undefined; name?: string | undefined; prevailing_market_price?: | CancelExecutionResponsePrevailingMarketPrice$Outbound | null | undefined; price?: CancelExecutionResponsePrice$Outbound | null | undefined; price_adjustment?: | CancelExecutionResponsePriceAdjustment$Outbound | null | undefined; quantity?: CancelExecutionResponseQuantity$Outbound | null | undefined; state?: string | undefined; street_execution_id?: string | undefined; trade_id?: string | undefined; }; /** @internal */ export const CancelExecutionResponseExecution$outboundSchema: z.ZodType< CancelExecutionResponseExecution$Outbound, z.ZodTypeDef, CancelExecutionResponseExecution > = z.object({ accruedInterestAmount: z.nullable( z.lazy(() => CancelExecutionResponseAccruedInterestAmount$outboundSchema), ).optional(), activityId: z.string().optional(), bondYield: z.array(BondYield$outboundSchema).optional(), commissionAmount: z.nullable( z.lazy(() => CancelExecutionResponseCommissionAmount$outboundSchema), ).optional(), executionId: z.string().optional(), executionTime: z.nullable(z.date().transform(v => v.toISOString())) .optional(), externalId: z.string().optional(), grossAmount: z.nullable( z.lazy(() => CancelExecutionResponseGrossAmount$outboundSchema), ).optional(), memo: z.string().optional(), name: z.string().optional(), prevailingMarketPrice: z.nullable( z.lazy(() => CancelExecutionResponsePrevailingMarketPrice$outboundSchema), ).optional(), price: z.nullable(z.lazy(() => CancelExecutionResponsePrice$outboundSchema)) .optional(), priceAdjustment: z.nullable( z.lazy(() => CancelExecutionResponsePriceAdjustment$outboundSchema), ).optional(), quantity: z.nullable( z.lazy(() => CancelExecutionResponseQuantity$outboundSchema), ).optional(), state: CancelExecutionResponseState$outboundSchema.optional(), streetExecutionId: z.string().optional(), tradeId: z.string().optional(), }).transform((v) => { return remap$(v, { accruedInterestAmount: "accrued_interest_amount", activityId: "activity_id", bondYield: "bond_yield", commissionAmount: "commission_amount", executionId: "execution_id", executionTime: "execution_time", externalId: "external_id", grossAmount: "gross_amount", prevailingMarketPrice: "prevailing_market_price", priceAdjustment: "price_adjustment", streetExecutionId: "street_execution_id", tradeId: "trade_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CancelExecutionResponseExecution$ { /** @deprecated use `CancelExecutionResponseExecution$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponseExecution$inboundSchema; /** @deprecated use `CancelExecutionResponseExecution$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponseExecution$outboundSchema; /** @deprecated use `CancelExecutionResponseExecution$Outbound` instead. */ export type Outbound = CancelExecutionResponseExecution$Outbound; } export function cancelExecutionResponseExecutionToJSON( cancelExecutionResponseExecution: CancelExecutionResponseExecution, ): string { return JSON.stringify( CancelExecutionResponseExecution$outboundSchema.parse( cancelExecutionResponseExecution, ), ); } export function cancelExecutionResponseExecutionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelExecutionResponseExecution$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelExecutionResponseExecution' from JSON`, ); } /** @internal */ export const CancelExecutionResponse$inboundSchema: z.ZodType< CancelExecutionResponse, z.ZodTypeDef, unknown > = z.object({ execution: z.nullable( z.lazy(() => CancelExecutionResponseExecution$inboundSchema), ).optional(), }); /** @internal */ export type CancelExecutionResponse$Outbound = { execution?: CancelExecutionResponseExecution$Outbound | null | undefined; }; /** @internal */ export const CancelExecutionResponse$outboundSchema: z.ZodType< CancelExecutionResponse$Outbound, z.ZodTypeDef, CancelExecutionResponse > = z.object({ execution: z.nullable( z.lazy(() => CancelExecutionResponseExecution$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 CancelExecutionResponse$ { /** @deprecated use `CancelExecutionResponse$inboundSchema` instead. */ export const inboundSchema = CancelExecutionResponse$inboundSchema; /** @deprecated use `CancelExecutionResponse$outboundSchema` instead. */ export const outboundSchema = CancelExecutionResponse$outboundSchema; /** @deprecated use `CancelExecutionResponse$Outbound` instead. */ export type Outbound = CancelExecutionResponse$Outbound; } export function cancelExecutionResponseToJSON( cancelExecutionResponse: CancelExecutionResponse, ): string { return JSON.stringify( CancelExecutionResponse$outboundSchema.parse(cancelExecutionResponse), ); } export function cancelExecutionResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CancelExecutionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CancelExecutionResponse' from JSON`, ); }