/* * 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 RebookExecutionResponseAccruedInterestAmount = { /** * 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 RebookExecutionResponseCommissionAmount = { /** * 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 RebookExecutionResponseGrossAmount = { /** * 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 RebookExecutionResponsePrevailingMarketPrice = { /** * 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 RebookExecutionResponsePrice = { /** * 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 RebookExecutionResponsePriceAdjustmentAmount = { /** * 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 RebookExecutionResponsePriceAdjustmentType { 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 RebookExecutionResponsePriceAdjustmentTypeOpen = OpenEnum< typeof RebookExecutionResponsePriceAdjustmentType >; /** * Price adjustment that will be applied to the net price of the security. */ export type RebookExecutionResponsePriceAdjustment = { /** * Total monetary value of the price_adjustment */ priceAdjustmentAmount?: | RebookExecutionResponsePriceAdjustmentAmount | null | undefined; /** * The type of price adjustment being applied by the broker to the net price of the security. */ priceAdjustmentType?: | RebookExecutionResponsePriceAdjustmentTypeOpen | undefined; }; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ export type RebookExecutionResponseQuantity = { /** * 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 RebookExecutionResponseState { 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 RebookExecutionResponseStateOpen = OpenEnum< typeof RebookExecutionResponseState >; /** * The new execution that was rebooked. */ export type RebookExecutionResponseExecution = { /** * 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?: | RebookExecutionResponseAccruedInterestAmount | 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?: RebookExecutionResponseCommissionAmount | 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?: RebookExecutionResponseGrossAmount | 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?: | RebookExecutionResponsePrevailingMarketPrice | null | undefined; /** * Price with requirement of 8 or less integral number and 8 or less fractional precision. */ price?: RebookExecutionResponsePrice | null | undefined; /** * Price adjustment that will be applied to the net price of the security. */ priceAdjustment?: RebookExecutionResponsePriceAdjustment | null | undefined; /** * Quantity with requirement of 12 or less integral number and 5 or less fractional precision. */ quantity?: RebookExecutionResponseQuantity | null | undefined; /** * The state that the trade is in. */ state?: RebookExecutionResponseStateOpen | 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 to the Rebook Execution method. */ export type RebookExecutionResponse = { /** * The new execution that was rebooked. */ execution?: RebookExecutionResponseExecution | null | undefined; }; /** @internal */ export const RebookExecutionResponseAccruedInterestAmount$inboundSchema: z.ZodType< RebookExecutionResponseAccruedInterestAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookExecutionResponseAccruedInterestAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookExecutionResponseAccruedInterestAmount$outboundSchema: z.ZodType< RebookExecutionResponseAccruedInterestAmount$Outbound, z.ZodTypeDef, RebookExecutionResponseAccruedInterestAmount > = 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 RebookExecutionResponseAccruedInterestAmount$ { /** @deprecated use `RebookExecutionResponseAccruedInterestAmount$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponseAccruedInterestAmount$inboundSchema; /** @deprecated use `RebookExecutionResponseAccruedInterestAmount$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponseAccruedInterestAmount$outboundSchema; /** @deprecated use `RebookExecutionResponseAccruedInterestAmount$Outbound` instead. */ export type Outbound = RebookExecutionResponseAccruedInterestAmount$Outbound; } export function rebookExecutionResponseAccruedInterestAmountToJSON( rebookExecutionResponseAccruedInterestAmount: RebookExecutionResponseAccruedInterestAmount, ): string { return JSON.stringify( RebookExecutionResponseAccruedInterestAmount$outboundSchema.parse( rebookExecutionResponseAccruedInterestAmount, ), ); } export function rebookExecutionResponseAccruedInterestAmountFromJSON( jsonString: string, ): SafeParseResult< RebookExecutionResponseAccruedInterestAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookExecutionResponseAccruedInterestAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookExecutionResponseAccruedInterestAmount' from JSON`, ); } /** @internal */ export const RebookExecutionResponseCommissionAmount$inboundSchema: z.ZodType< RebookExecutionResponseCommissionAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookExecutionResponseCommissionAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookExecutionResponseCommissionAmount$outboundSchema: z.ZodType< RebookExecutionResponseCommissionAmount$Outbound, z.ZodTypeDef, RebookExecutionResponseCommissionAmount > = 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 RebookExecutionResponseCommissionAmount$ { /** @deprecated use `RebookExecutionResponseCommissionAmount$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponseCommissionAmount$inboundSchema; /** @deprecated use `RebookExecutionResponseCommissionAmount$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponseCommissionAmount$outboundSchema; /** @deprecated use `RebookExecutionResponseCommissionAmount$Outbound` instead. */ export type Outbound = RebookExecutionResponseCommissionAmount$Outbound; } export function rebookExecutionResponseCommissionAmountToJSON( rebookExecutionResponseCommissionAmount: RebookExecutionResponseCommissionAmount, ): string { return JSON.stringify( RebookExecutionResponseCommissionAmount$outboundSchema.parse( rebookExecutionResponseCommissionAmount, ), ); } export function rebookExecutionResponseCommissionAmountFromJSON( jsonString: string, ): SafeParseResult< RebookExecutionResponseCommissionAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookExecutionResponseCommissionAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookExecutionResponseCommissionAmount' from JSON`, ); } /** @internal */ export const RebookExecutionResponseGrossAmount$inboundSchema: z.ZodType< RebookExecutionResponseGrossAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookExecutionResponseGrossAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookExecutionResponseGrossAmount$outboundSchema: z.ZodType< RebookExecutionResponseGrossAmount$Outbound, z.ZodTypeDef, RebookExecutionResponseGrossAmount > = 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 RebookExecutionResponseGrossAmount$ { /** @deprecated use `RebookExecutionResponseGrossAmount$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponseGrossAmount$inboundSchema; /** @deprecated use `RebookExecutionResponseGrossAmount$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponseGrossAmount$outboundSchema; /** @deprecated use `RebookExecutionResponseGrossAmount$Outbound` instead. */ export type Outbound = RebookExecutionResponseGrossAmount$Outbound; } export function rebookExecutionResponseGrossAmountToJSON( rebookExecutionResponseGrossAmount: RebookExecutionResponseGrossAmount, ): string { return JSON.stringify( RebookExecutionResponseGrossAmount$outboundSchema.parse( rebookExecutionResponseGrossAmount, ), ); } export function rebookExecutionResponseGrossAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookExecutionResponseGrossAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookExecutionResponseGrossAmount' from JSON`, ); } /** @internal */ export const RebookExecutionResponsePrevailingMarketPrice$inboundSchema: z.ZodType< RebookExecutionResponsePrevailingMarketPrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookExecutionResponsePrevailingMarketPrice$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookExecutionResponsePrevailingMarketPrice$outboundSchema: z.ZodType< RebookExecutionResponsePrevailingMarketPrice$Outbound, z.ZodTypeDef, RebookExecutionResponsePrevailingMarketPrice > = 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 RebookExecutionResponsePrevailingMarketPrice$ { /** @deprecated use `RebookExecutionResponsePrevailingMarketPrice$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponsePrevailingMarketPrice$inboundSchema; /** @deprecated use `RebookExecutionResponsePrevailingMarketPrice$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponsePrevailingMarketPrice$outboundSchema; /** @deprecated use `RebookExecutionResponsePrevailingMarketPrice$Outbound` instead. */ export type Outbound = RebookExecutionResponsePrevailingMarketPrice$Outbound; } export function rebookExecutionResponsePrevailingMarketPriceToJSON( rebookExecutionResponsePrevailingMarketPrice: RebookExecutionResponsePrevailingMarketPrice, ): string { return JSON.stringify( RebookExecutionResponsePrevailingMarketPrice$outboundSchema.parse( rebookExecutionResponsePrevailingMarketPrice, ), ); } export function rebookExecutionResponsePrevailingMarketPriceFromJSON( jsonString: string, ): SafeParseResult< RebookExecutionResponsePrevailingMarketPrice, SDKValidationError > { return safeParse( jsonString, (x) => RebookExecutionResponsePrevailingMarketPrice$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookExecutionResponsePrevailingMarketPrice' from JSON`, ); } /** @internal */ export const RebookExecutionResponsePrice$inboundSchema: z.ZodType< RebookExecutionResponsePrice, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookExecutionResponsePrice$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookExecutionResponsePrice$outboundSchema: z.ZodType< RebookExecutionResponsePrice$Outbound, z.ZodTypeDef, RebookExecutionResponsePrice > = 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 RebookExecutionResponsePrice$ { /** @deprecated use `RebookExecutionResponsePrice$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponsePrice$inboundSchema; /** @deprecated use `RebookExecutionResponsePrice$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponsePrice$outboundSchema; /** @deprecated use `RebookExecutionResponsePrice$Outbound` instead. */ export type Outbound = RebookExecutionResponsePrice$Outbound; } export function rebookExecutionResponsePriceToJSON( rebookExecutionResponsePrice: RebookExecutionResponsePrice, ): string { return JSON.stringify( RebookExecutionResponsePrice$outboundSchema.parse( rebookExecutionResponsePrice, ), ); } export function rebookExecutionResponsePriceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookExecutionResponsePrice$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookExecutionResponsePrice' from JSON`, ); } /** @internal */ export const RebookExecutionResponsePriceAdjustmentAmount$inboundSchema: z.ZodType< RebookExecutionResponsePriceAdjustmentAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookExecutionResponsePriceAdjustmentAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookExecutionResponsePriceAdjustmentAmount$outboundSchema: z.ZodType< RebookExecutionResponsePriceAdjustmentAmount$Outbound, z.ZodTypeDef, RebookExecutionResponsePriceAdjustmentAmount > = 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 RebookExecutionResponsePriceAdjustmentAmount$ { /** @deprecated use `RebookExecutionResponsePriceAdjustmentAmount$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponsePriceAdjustmentAmount$inboundSchema; /** @deprecated use `RebookExecutionResponsePriceAdjustmentAmount$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponsePriceAdjustmentAmount$outboundSchema; /** @deprecated use `RebookExecutionResponsePriceAdjustmentAmount$Outbound` instead. */ export type Outbound = RebookExecutionResponsePriceAdjustmentAmount$Outbound; } export function rebookExecutionResponsePriceAdjustmentAmountToJSON( rebookExecutionResponsePriceAdjustmentAmount: RebookExecutionResponsePriceAdjustmentAmount, ): string { return JSON.stringify( RebookExecutionResponsePriceAdjustmentAmount$outboundSchema.parse( rebookExecutionResponsePriceAdjustmentAmount, ), ); } export function rebookExecutionResponsePriceAdjustmentAmountFromJSON( jsonString: string, ): SafeParseResult< RebookExecutionResponsePriceAdjustmentAmount, SDKValidationError > { return safeParse( jsonString, (x) => RebookExecutionResponsePriceAdjustmentAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'RebookExecutionResponsePriceAdjustmentAmount' from JSON`, ); } /** @internal */ export const RebookExecutionResponsePriceAdjustmentType$inboundSchema: z.ZodType< RebookExecutionResponsePriceAdjustmentTypeOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookExecutionResponsePriceAdjustmentType), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookExecutionResponsePriceAdjustmentType$outboundSchema: z.ZodType< RebookExecutionResponsePriceAdjustmentTypeOpen, z.ZodTypeDef, RebookExecutionResponsePriceAdjustmentTypeOpen > = z.union([ z.nativeEnum(RebookExecutionResponsePriceAdjustmentType), 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 RebookExecutionResponsePriceAdjustmentType$ { /** @deprecated use `RebookExecutionResponsePriceAdjustmentType$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponsePriceAdjustmentType$inboundSchema; /** @deprecated use `RebookExecutionResponsePriceAdjustmentType$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponsePriceAdjustmentType$outboundSchema; } /** @internal */ export const RebookExecutionResponsePriceAdjustment$inboundSchema: z.ZodType< RebookExecutionResponsePriceAdjustment, z.ZodTypeDef, unknown > = z.object({ price_adjustment_amount: z.nullable( z.lazy(() => RebookExecutionResponsePriceAdjustmentAmount$inboundSchema), ).optional(), price_adjustment_type: RebookExecutionResponsePriceAdjustmentType$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "price_adjustment_amount": "priceAdjustmentAmount", "price_adjustment_type": "priceAdjustmentType", }); }); /** @internal */ export type RebookExecutionResponsePriceAdjustment$Outbound = { price_adjustment_amount?: | RebookExecutionResponsePriceAdjustmentAmount$Outbound | null | undefined; price_adjustment_type?: string | undefined; }; /** @internal */ export const RebookExecutionResponsePriceAdjustment$outboundSchema: z.ZodType< RebookExecutionResponsePriceAdjustment$Outbound, z.ZodTypeDef, RebookExecutionResponsePriceAdjustment > = z.object({ priceAdjustmentAmount: z.nullable( z.lazy(() => RebookExecutionResponsePriceAdjustmentAmount$outboundSchema), ).optional(), priceAdjustmentType: RebookExecutionResponsePriceAdjustmentType$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 RebookExecutionResponsePriceAdjustment$ { /** @deprecated use `RebookExecutionResponsePriceAdjustment$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponsePriceAdjustment$inboundSchema; /** @deprecated use `RebookExecutionResponsePriceAdjustment$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponsePriceAdjustment$outboundSchema; /** @deprecated use `RebookExecutionResponsePriceAdjustment$Outbound` instead. */ export type Outbound = RebookExecutionResponsePriceAdjustment$Outbound; } export function rebookExecutionResponsePriceAdjustmentToJSON( rebookExecutionResponsePriceAdjustment: RebookExecutionResponsePriceAdjustment, ): string { return JSON.stringify( RebookExecutionResponsePriceAdjustment$outboundSchema.parse( rebookExecutionResponsePriceAdjustment, ), ); } export function rebookExecutionResponsePriceAdjustmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookExecutionResponsePriceAdjustment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookExecutionResponsePriceAdjustment' from JSON`, ); } /** @internal */ export const RebookExecutionResponseQuantity$inboundSchema: z.ZodType< RebookExecutionResponseQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type RebookExecutionResponseQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const RebookExecutionResponseQuantity$outboundSchema: z.ZodType< RebookExecutionResponseQuantity$Outbound, z.ZodTypeDef, RebookExecutionResponseQuantity > = 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 RebookExecutionResponseQuantity$ { /** @deprecated use `RebookExecutionResponseQuantity$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponseQuantity$inboundSchema; /** @deprecated use `RebookExecutionResponseQuantity$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponseQuantity$outboundSchema; /** @deprecated use `RebookExecutionResponseQuantity$Outbound` instead. */ export type Outbound = RebookExecutionResponseQuantity$Outbound; } export function rebookExecutionResponseQuantityToJSON( rebookExecutionResponseQuantity: RebookExecutionResponseQuantity, ): string { return JSON.stringify( RebookExecutionResponseQuantity$outboundSchema.parse( rebookExecutionResponseQuantity, ), ); } export function rebookExecutionResponseQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookExecutionResponseQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookExecutionResponseQuantity' from JSON`, ); } /** @internal */ export const RebookExecutionResponseState$inboundSchema: z.ZodType< RebookExecutionResponseStateOpen, z.ZodTypeDef, unknown > = z .union([ z.nativeEnum(RebookExecutionResponseState), z.string().transform(catchUnrecognizedEnum), ]); /** @internal */ export const RebookExecutionResponseState$outboundSchema: z.ZodType< RebookExecutionResponseStateOpen, z.ZodTypeDef, RebookExecutionResponseStateOpen > = z.union([ z.nativeEnum(RebookExecutionResponseState), 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 RebookExecutionResponseState$ { /** @deprecated use `RebookExecutionResponseState$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponseState$inboundSchema; /** @deprecated use `RebookExecutionResponseState$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponseState$outboundSchema; } /** @internal */ export const RebookExecutionResponseExecution$inboundSchema: z.ZodType< RebookExecutionResponseExecution, z.ZodTypeDef, unknown > = z.object({ accrued_interest_amount: z.nullable( z.lazy(() => RebookExecutionResponseAccruedInterestAmount$inboundSchema), ).optional(), activity_id: z.string().optional(), bond_yield: z.array(BondYield$inboundSchema).optional(), commission_amount: z.nullable( z.lazy(() => RebookExecutionResponseCommissionAmount$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(() => RebookExecutionResponseGrossAmount$inboundSchema), ).optional(), memo: z.string().optional(), name: z.string().optional(), prevailing_market_price: z.nullable( z.lazy(() => RebookExecutionResponsePrevailingMarketPrice$inboundSchema), ).optional(), price: z.nullable(z.lazy(() => RebookExecutionResponsePrice$inboundSchema)) .optional(), price_adjustment: z.nullable( z.lazy(() => RebookExecutionResponsePriceAdjustment$inboundSchema), ).optional(), quantity: z.nullable( z.lazy(() => RebookExecutionResponseQuantity$inboundSchema), ).optional(), state: RebookExecutionResponseState$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 RebookExecutionResponseExecution$Outbound = { accrued_interest_amount?: | RebookExecutionResponseAccruedInterestAmount$Outbound | null | undefined; activity_id?: string | undefined; bond_yield?: Array | undefined; commission_amount?: | RebookExecutionResponseCommissionAmount$Outbound | null | undefined; execution_id?: string | undefined; execution_time?: string | null | undefined; external_id?: string | undefined; gross_amount?: RebookExecutionResponseGrossAmount$Outbound | null | undefined; memo?: string | undefined; name?: string | undefined; prevailing_market_price?: | RebookExecutionResponsePrevailingMarketPrice$Outbound | null | undefined; price?: RebookExecutionResponsePrice$Outbound | null | undefined; price_adjustment?: | RebookExecutionResponsePriceAdjustment$Outbound | null | undefined; quantity?: RebookExecutionResponseQuantity$Outbound | null | undefined; state?: string | undefined; street_execution_id?: string | undefined; trade_id?: string | undefined; }; /** @internal */ export const RebookExecutionResponseExecution$outboundSchema: z.ZodType< RebookExecutionResponseExecution$Outbound, z.ZodTypeDef, RebookExecutionResponseExecution > = z.object({ accruedInterestAmount: z.nullable( z.lazy(() => RebookExecutionResponseAccruedInterestAmount$outboundSchema), ).optional(), activityId: z.string().optional(), bondYield: z.array(BondYield$outboundSchema).optional(), commissionAmount: z.nullable( z.lazy(() => RebookExecutionResponseCommissionAmount$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(() => RebookExecutionResponseGrossAmount$outboundSchema), ).optional(), memo: z.string().optional(), name: z.string().optional(), prevailingMarketPrice: z.nullable( z.lazy(() => RebookExecutionResponsePrevailingMarketPrice$outboundSchema), ).optional(), price: z.nullable(z.lazy(() => RebookExecutionResponsePrice$outboundSchema)) .optional(), priceAdjustment: z.nullable( z.lazy(() => RebookExecutionResponsePriceAdjustment$outboundSchema), ).optional(), quantity: z.nullable( z.lazy(() => RebookExecutionResponseQuantity$outboundSchema), ).optional(), state: RebookExecutionResponseState$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 RebookExecutionResponseExecution$ { /** @deprecated use `RebookExecutionResponseExecution$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponseExecution$inboundSchema; /** @deprecated use `RebookExecutionResponseExecution$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponseExecution$outboundSchema; /** @deprecated use `RebookExecutionResponseExecution$Outbound` instead. */ export type Outbound = RebookExecutionResponseExecution$Outbound; } export function rebookExecutionResponseExecutionToJSON( rebookExecutionResponseExecution: RebookExecutionResponseExecution, ): string { return JSON.stringify( RebookExecutionResponseExecution$outboundSchema.parse( rebookExecutionResponseExecution, ), ); } export function rebookExecutionResponseExecutionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookExecutionResponseExecution$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookExecutionResponseExecution' from JSON`, ); } /** @internal */ export const RebookExecutionResponse$inboundSchema: z.ZodType< RebookExecutionResponse, z.ZodTypeDef, unknown > = z.object({ execution: z.nullable( z.lazy(() => RebookExecutionResponseExecution$inboundSchema), ).optional(), }); /** @internal */ export type RebookExecutionResponse$Outbound = { execution?: RebookExecutionResponseExecution$Outbound | null | undefined; }; /** @internal */ export const RebookExecutionResponse$outboundSchema: z.ZodType< RebookExecutionResponse$Outbound, z.ZodTypeDef, RebookExecutionResponse > = z.object({ execution: z.nullable( z.lazy(() => RebookExecutionResponseExecution$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 RebookExecutionResponse$ { /** @deprecated use `RebookExecutionResponse$inboundSchema` instead. */ export const inboundSchema = RebookExecutionResponse$inboundSchema; /** @deprecated use `RebookExecutionResponse$outboundSchema` instead. */ export const outboundSchema = RebookExecutionResponse$outboundSchema; /** @deprecated use `RebookExecutionResponse$Outbound` instead. */ export type Outbound = RebookExecutionResponse$Outbound; } export function rebookExecutionResponseToJSON( rebookExecutionResponse: RebookExecutionResponse, ): string { return JSON.stringify( RebookExecutionResponse$outboundSchema.parse(rebookExecutionResponse), ); } export function rebookExecutionResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => RebookExecutionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RebookExecutionResponse' from JSON`, ); }