/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The buying_power in USD returned from the request. */ export type AssetBuyingPowerBuyingPowerAmount = { /** * 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 day_trade_buying_power_issued_amount is the day trade buying power of the account in USD, returned from the request. If the is_day_trade_buying_power_allowed boolean is true this will be set from day_trade_buying_power_issued value returned from the margins calculator, or else if it is false it will be set from buying_power_issued value returned from the margins calculator. */ export type AssetBuyingPowerDayTradeBuyingPowerAmount = { /** * 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 sma_amount is the special memorandum account amount in USD, returned from the request. This will only be populated for margin accounts and is the margin equity minus the RegT requirements. */ export type AssetBuyingPowerSmaAmount = { /** * 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; }; /** * Account Asset Buying Power fields returned from the request. */ export type AccountAssetBuyingPower = { /** * The buying_power in USD returned from the request. */ buyingPowerAmount?: AssetBuyingPowerBuyingPowerAmount | null | undefined; /** * The day_trade_buying_power_issued_amount is the day trade buying power of the account in USD, returned from the request. If the is_day_trade_buying_power_allowed boolean is true this will be set from day_trade_buying_power_issued value returned from the margins calculator, or else if it is false it will be set from buying_power_issued value returned from the margins calculator. */ dayTradeBuyingPowerAmount?: | AssetBuyingPowerDayTradeBuyingPowerAmount | null | undefined; /** * The is_day_trade_buying_power_allowed boolean will be true if the account is a Margin account, PDT is true and SOD Account equity >= $25,000, otherwise it will be false. */ isDayTradeBuyingPowerAllowed?: boolean | undefined; /** * The sma_amount is the special memorandum account amount in USD, returned from the request. This will only be populated for margin accounts and is the margin equity minus the RegT requirements. */ smaAmount?: AssetBuyingPowerSmaAmount | null | undefined; }; /** * The account_equity in USD returned from the request. */ export type AssetBuyingPowerAccountEquityAmount = { /** * 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 position_market_value in USD returned from the request. */ export type AssetBuyingPowerPositionMarketValueAmount = { /** * 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; }; /** * Account Equity fields returned from the request. */ export type AccountEquity = { /** * The account_equity in USD returned from the request. */ accountEquityAmount?: AssetBuyingPowerAccountEquityAmount | null | undefined; /** * The position_market_value in USD returned from the request. */ positionMarketValueAmount?: | AssetBuyingPowerPositionMarketValueAmount | null | undefined; }; /** * The asset_buying_power_max_amount is the max buying power in USD for an account to purchase a given asset, returned from the request. */ export type AssetBuyingPowerMaxAmount = { /** * 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 max_purchase_quantity is the maximum quantity of a given asset an account can buy, returned from the request. */ export type MaxPurchaseQuantity = { /** * 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 percentage_requirements, which is the higher of initial and maintenance percentage requirements, returned from the request. */ export type PercentageRequirements = { /** * 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; }; /** * Day Trade Asset Buying Power figures returned from the request. */ export type DayTrade = { /** * The asset_buying_power_max_amount is the max buying power in USD for an account to purchase a given asset, returned from the request. */ assetBuyingPowerMaxAmount?: AssetBuyingPowerMaxAmount | null | undefined; /** * The max_purchase_quantity is the maximum quantity of a given asset an account can buy, returned from the request. */ maxPurchaseQuantity?: MaxPurchaseQuantity | null | undefined; /** * The percentage_requirements, which is the higher of initial and maintenance percentage requirements, returned from the request. */ percentageRequirements?: PercentageRequirements | null | undefined; }; /** * The asset_buying_power_max_amount is the max buying power in USD for an account to purchase a given asset, returned from the request. */ export type AssetBuyingPowerAssetBuyingPowerMaxAmount = { /** * 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 max_purchase_quantity is the maximum quantity of a given asset an account can buy, returned from the request. */ export type AssetBuyingPowerMaxPurchaseQuantity = { /** * 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 percentage_requirements, which is the higher of initial and maintenance percentage requirements, returned from the request. */ export type AssetBuyingPowerPercentageRequirements = { /** * 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; }; /** * Non Day Trade Asset Buying Power figures returned from the request. */ export type NonDayTrade = { /** * The asset_buying_power_max_amount is the max buying power in USD for an account to purchase a given asset, returned from the request. */ assetBuyingPowerMaxAmount?: | AssetBuyingPowerAssetBuyingPowerMaxAmount | null | undefined; /** * The max_purchase_quantity is the maximum quantity of a given asset an account can buy, returned from the request. */ maxPurchaseQuantity?: AssetBuyingPowerMaxPurchaseQuantity | null | undefined; /** * The percentage_requirements, which is the higher of initial and maintenance percentage requirements, returned from the request. */ percentageRequirements?: | AssetBuyingPowerPercentageRequirements | null | undefined; }; /** * The current price of the asset in USD returned from the request. */ export type PriceAmount = { /** * 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; }; /** * Asset Specific fields returned from the request. */ export type AssetSpecific = { /** * Day Trade Asset Buying Power figures returned from the request. */ dayTrade?: DayTrade | null | undefined; /** * Non Day Trade Asset Buying Power figures returned from the request. */ nonDayTrade?: NonDayTrade | null | undefined; /** * The current price of the asset in USD returned from the request. */ priceAmount?: PriceAmount | null | undefined; }; /** * The total_excess_amount is the total equity in the account minus the requirements in USD, returned from the request. */ export type AssetBuyingPowerTotalExcessAmount = { /** * 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 total_requirements_amount is the total requirement amount for positions held in the account in USD, returned from the request. */ export type AssetBuyingPowerTotalRequirementsAmount = { /** * 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; }; /** * Margin Requirements fields returned from the request. */ export type AssetBuyingPowerRequirements = { /** * The total_excess_amount is the total equity in the account minus the requirements in USD, returned from the request. */ totalExcessAmount?: AssetBuyingPowerTotalExcessAmount | null | undefined; /** * The total_requirements_amount is the total requirement amount for positions held in the account in USD, returned from the request. */ totalRequirementsAmount?: | AssetBuyingPowerTotalRequirementsAmount | null | undefined; }; /** * Response for GetAssetBuyingPower */ export type AssetBuyingPower = { /** * Account Asset Buying Power fields returned from the request. */ accountAssetBuyingPower?: AccountAssetBuyingPower | null | undefined; /** * Account Equity fields returned from the request. */ accountEquity?: AccountEquity | null | undefined; /** * The account ID returned from the request. */ accountId?: string | undefined; /** * The asset ID returned from the request. */ assetId?: string | undefined; /** * Asset Specific fields returned from the request. */ assetSpecific?: AssetSpecific | null | undefined; /** * The service generated name of the AssetBuyingPower Format: accounts/{account_id}/asset/{assetid}/buyingPower */ name?: string | undefined; /** * Margin Requirements fields returned from the request. */ requirements?: AssetBuyingPowerRequirements | null | undefined; }; /** @internal */ export const AssetBuyingPowerBuyingPowerAmount$inboundSchema: z.ZodType< AssetBuyingPowerBuyingPowerAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerBuyingPowerAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerBuyingPowerAmount$outboundSchema: z.ZodType< AssetBuyingPowerBuyingPowerAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerBuyingPowerAmount > = 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 AssetBuyingPowerBuyingPowerAmount$ { /** @deprecated use `AssetBuyingPowerBuyingPowerAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerBuyingPowerAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerBuyingPowerAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerBuyingPowerAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerBuyingPowerAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerBuyingPowerAmount$Outbound; } export function assetBuyingPowerBuyingPowerAmountToJSON( assetBuyingPowerBuyingPowerAmount: AssetBuyingPowerBuyingPowerAmount, ): string { return JSON.stringify( AssetBuyingPowerBuyingPowerAmount$outboundSchema.parse( assetBuyingPowerBuyingPowerAmount, ), ); } export function assetBuyingPowerBuyingPowerAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPowerBuyingPowerAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPowerBuyingPowerAmount' from JSON`, ); } /** @internal */ export const AssetBuyingPowerDayTradeBuyingPowerAmount$inboundSchema: z.ZodType< AssetBuyingPowerDayTradeBuyingPowerAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerDayTradeBuyingPowerAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerDayTradeBuyingPowerAmount$outboundSchema: z.ZodType< AssetBuyingPowerDayTradeBuyingPowerAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerDayTradeBuyingPowerAmount > = 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 AssetBuyingPowerDayTradeBuyingPowerAmount$ { /** @deprecated use `AssetBuyingPowerDayTradeBuyingPowerAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerDayTradeBuyingPowerAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerDayTradeBuyingPowerAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerDayTradeBuyingPowerAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerDayTradeBuyingPowerAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerDayTradeBuyingPowerAmount$Outbound; } export function assetBuyingPowerDayTradeBuyingPowerAmountToJSON( assetBuyingPowerDayTradeBuyingPowerAmount: AssetBuyingPowerDayTradeBuyingPowerAmount, ): string { return JSON.stringify( AssetBuyingPowerDayTradeBuyingPowerAmount$outboundSchema.parse( assetBuyingPowerDayTradeBuyingPowerAmount, ), ); } export function assetBuyingPowerDayTradeBuyingPowerAmountFromJSON( jsonString: string, ): SafeParseResult< AssetBuyingPowerDayTradeBuyingPowerAmount, SDKValidationError > { return safeParse( jsonString, (x) => AssetBuyingPowerDayTradeBuyingPowerAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AssetBuyingPowerDayTradeBuyingPowerAmount' from JSON`, ); } /** @internal */ export const AssetBuyingPowerSmaAmount$inboundSchema: z.ZodType< AssetBuyingPowerSmaAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerSmaAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerSmaAmount$outboundSchema: z.ZodType< AssetBuyingPowerSmaAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerSmaAmount > = 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 AssetBuyingPowerSmaAmount$ { /** @deprecated use `AssetBuyingPowerSmaAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerSmaAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerSmaAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerSmaAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerSmaAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerSmaAmount$Outbound; } export function assetBuyingPowerSmaAmountToJSON( assetBuyingPowerSmaAmount: AssetBuyingPowerSmaAmount, ): string { return JSON.stringify( AssetBuyingPowerSmaAmount$outboundSchema.parse(assetBuyingPowerSmaAmount), ); } export function assetBuyingPowerSmaAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPowerSmaAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPowerSmaAmount' from JSON`, ); } /** @internal */ export const AccountAssetBuyingPower$inboundSchema: z.ZodType< AccountAssetBuyingPower, z.ZodTypeDef, unknown > = z.object({ buying_power_amount: z.nullable( z.lazy(() => AssetBuyingPowerBuyingPowerAmount$inboundSchema), ).optional(), day_trade_buying_power_amount: z.nullable( z.lazy(() => AssetBuyingPowerDayTradeBuyingPowerAmount$inboundSchema), ).optional(), is_day_trade_buying_power_allowed: z.boolean().optional(), sma_amount: z.nullable(z.lazy(() => AssetBuyingPowerSmaAmount$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "buying_power_amount": "buyingPowerAmount", "day_trade_buying_power_amount": "dayTradeBuyingPowerAmount", "is_day_trade_buying_power_allowed": "isDayTradeBuyingPowerAllowed", "sma_amount": "smaAmount", }); }); /** @internal */ export type AccountAssetBuyingPower$Outbound = { buying_power_amount?: | AssetBuyingPowerBuyingPowerAmount$Outbound | null | undefined; day_trade_buying_power_amount?: | AssetBuyingPowerDayTradeBuyingPowerAmount$Outbound | null | undefined; is_day_trade_buying_power_allowed?: boolean | undefined; sma_amount?: AssetBuyingPowerSmaAmount$Outbound | null | undefined; }; /** @internal */ export const AccountAssetBuyingPower$outboundSchema: z.ZodType< AccountAssetBuyingPower$Outbound, z.ZodTypeDef, AccountAssetBuyingPower > = z.object({ buyingPowerAmount: z.nullable( z.lazy(() => AssetBuyingPowerBuyingPowerAmount$outboundSchema), ).optional(), dayTradeBuyingPowerAmount: z.nullable( z.lazy(() => AssetBuyingPowerDayTradeBuyingPowerAmount$outboundSchema), ).optional(), isDayTradeBuyingPowerAllowed: z.boolean().optional(), smaAmount: z.nullable(z.lazy(() => AssetBuyingPowerSmaAmount$outboundSchema)) .optional(), }).transform((v) => { return remap$(v, { buyingPowerAmount: "buying_power_amount", dayTradeBuyingPowerAmount: "day_trade_buying_power_amount", isDayTradeBuyingPowerAllowed: "is_day_trade_buying_power_allowed", smaAmount: "sma_amount", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountAssetBuyingPower$ { /** @deprecated use `AccountAssetBuyingPower$inboundSchema` instead. */ export const inboundSchema = AccountAssetBuyingPower$inboundSchema; /** @deprecated use `AccountAssetBuyingPower$outboundSchema` instead. */ export const outboundSchema = AccountAssetBuyingPower$outboundSchema; /** @deprecated use `AccountAssetBuyingPower$Outbound` instead. */ export type Outbound = AccountAssetBuyingPower$Outbound; } export function accountAssetBuyingPowerToJSON( accountAssetBuyingPower: AccountAssetBuyingPower, ): string { return JSON.stringify( AccountAssetBuyingPower$outboundSchema.parse(accountAssetBuyingPower), ); } export function accountAssetBuyingPowerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountAssetBuyingPower$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountAssetBuyingPower' from JSON`, ); } /** @internal */ export const AssetBuyingPowerAccountEquityAmount$inboundSchema: z.ZodType< AssetBuyingPowerAccountEquityAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerAccountEquityAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerAccountEquityAmount$outboundSchema: z.ZodType< AssetBuyingPowerAccountEquityAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerAccountEquityAmount > = 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 AssetBuyingPowerAccountEquityAmount$ { /** @deprecated use `AssetBuyingPowerAccountEquityAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerAccountEquityAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerAccountEquityAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerAccountEquityAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerAccountEquityAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerAccountEquityAmount$Outbound; } export function assetBuyingPowerAccountEquityAmountToJSON( assetBuyingPowerAccountEquityAmount: AssetBuyingPowerAccountEquityAmount, ): string { return JSON.stringify( AssetBuyingPowerAccountEquityAmount$outboundSchema.parse( assetBuyingPowerAccountEquityAmount, ), ); } export function assetBuyingPowerAccountEquityAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPowerAccountEquityAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPowerAccountEquityAmount' from JSON`, ); } /** @internal */ export const AssetBuyingPowerPositionMarketValueAmount$inboundSchema: z.ZodType< AssetBuyingPowerPositionMarketValueAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerPositionMarketValueAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerPositionMarketValueAmount$outboundSchema: z.ZodType< AssetBuyingPowerPositionMarketValueAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerPositionMarketValueAmount > = 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 AssetBuyingPowerPositionMarketValueAmount$ { /** @deprecated use `AssetBuyingPowerPositionMarketValueAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerPositionMarketValueAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerPositionMarketValueAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerPositionMarketValueAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerPositionMarketValueAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerPositionMarketValueAmount$Outbound; } export function assetBuyingPowerPositionMarketValueAmountToJSON( assetBuyingPowerPositionMarketValueAmount: AssetBuyingPowerPositionMarketValueAmount, ): string { return JSON.stringify( AssetBuyingPowerPositionMarketValueAmount$outboundSchema.parse( assetBuyingPowerPositionMarketValueAmount, ), ); } export function assetBuyingPowerPositionMarketValueAmountFromJSON( jsonString: string, ): SafeParseResult< AssetBuyingPowerPositionMarketValueAmount, SDKValidationError > { return safeParse( jsonString, (x) => AssetBuyingPowerPositionMarketValueAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AssetBuyingPowerPositionMarketValueAmount' from JSON`, ); } /** @internal */ export const AccountEquity$inboundSchema: z.ZodType< AccountEquity, z.ZodTypeDef, unknown > = z.object({ account_equity_amount: z.nullable( z.lazy(() => AssetBuyingPowerAccountEquityAmount$inboundSchema), ).optional(), position_market_value_amount: z.nullable( z.lazy(() => AssetBuyingPowerPositionMarketValueAmount$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "account_equity_amount": "accountEquityAmount", "position_market_value_amount": "positionMarketValueAmount", }); }); /** @internal */ export type AccountEquity$Outbound = { account_equity_amount?: | AssetBuyingPowerAccountEquityAmount$Outbound | null | undefined; position_market_value_amount?: | AssetBuyingPowerPositionMarketValueAmount$Outbound | null | undefined; }; /** @internal */ export const AccountEquity$outboundSchema: z.ZodType< AccountEquity$Outbound, z.ZodTypeDef, AccountEquity > = z.object({ accountEquityAmount: z.nullable( z.lazy(() => AssetBuyingPowerAccountEquityAmount$outboundSchema), ).optional(), positionMarketValueAmount: z.nullable( z.lazy(() => AssetBuyingPowerPositionMarketValueAmount$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { accountEquityAmount: "account_equity_amount", positionMarketValueAmount: "position_market_value_amount", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountEquity$ { /** @deprecated use `AccountEquity$inboundSchema` instead. */ export const inboundSchema = AccountEquity$inboundSchema; /** @deprecated use `AccountEquity$outboundSchema` instead. */ export const outboundSchema = AccountEquity$outboundSchema; /** @deprecated use `AccountEquity$Outbound` instead. */ export type Outbound = AccountEquity$Outbound; } export function accountEquityToJSON(accountEquity: AccountEquity): string { return JSON.stringify(AccountEquity$outboundSchema.parse(accountEquity)); } export function accountEquityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountEquity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountEquity' from JSON`, ); } /** @internal */ export const AssetBuyingPowerMaxAmount$inboundSchema: z.ZodType< AssetBuyingPowerMaxAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerMaxAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerMaxAmount$outboundSchema: z.ZodType< AssetBuyingPowerMaxAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerMaxAmount > = 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 AssetBuyingPowerMaxAmount$ { /** @deprecated use `AssetBuyingPowerMaxAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerMaxAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerMaxAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerMaxAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerMaxAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerMaxAmount$Outbound; } export function assetBuyingPowerMaxAmountToJSON( assetBuyingPowerMaxAmount: AssetBuyingPowerMaxAmount, ): string { return JSON.stringify( AssetBuyingPowerMaxAmount$outboundSchema.parse(assetBuyingPowerMaxAmount), ); } export function assetBuyingPowerMaxAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPowerMaxAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPowerMaxAmount' from JSON`, ); } /** @internal */ export const MaxPurchaseQuantity$inboundSchema: z.ZodType< MaxPurchaseQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type MaxPurchaseQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const MaxPurchaseQuantity$outboundSchema: z.ZodType< MaxPurchaseQuantity$Outbound, z.ZodTypeDef, MaxPurchaseQuantity > = 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 MaxPurchaseQuantity$ { /** @deprecated use `MaxPurchaseQuantity$inboundSchema` instead. */ export const inboundSchema = MaxPurchaseQuantity$inboundSchema; /** @deprecated use `MaxPurchaseQuantity$outboundSchema` instead. */ export const outboundSchema = MaxPurchaseQuantity$outboundSchema; /** @deprecated use `MaxPurchaseQuantity$Outbound` instead. */ export type Outbound = MaxPurchaseQuantity$Outbound; } export function maxPurchaseQuantityToJSON( maxPurchaseQuantity: MaxPurchaseQuantity, ): string { return JSON.stringify( MaxPurchaseQuantity$outboundSchema.parse(maxPurchaseQuantity), ); } export function maxPurchaseQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MaxPurchaseQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MaxPurchaseQuantity' from JSON`, ); } /** @internal */ export const PercentageRequirements$inboundSchema: z.ZodType< PercentageRequirements, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type PercentageRequirements$Outbound = { value?: string | undefined; }; /** @internal */ export const PercentageRequirements$outboundSchema: z.ZodType< PercentageRequirements$Outbound, z.ZodTypeDef, PercentageRequirements > = 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 PercentageRequirements$ { /** @deprecated use `PercentageRequirements$inboundSchema` instead. */ export const inboundSchema = PercentageRequirements$inboundSchema; /** @deprecated use `PercentageRequirements$outboundSchema` instead. */ export const outboundSchema = PercentageRequirements$outboundSchema; /** @deprecated use `PercentageRequirements$Outbound` instead. */ export type Outbound = PercentageRequirements$Outbound; } export function percentageRequirementsToJSON( percentageRequirements: PercentageRequirements, ): string { return JSON.stringify( PercentageRequirements$outboundSchema.parse(percentageRequirements), ); } export function percentageRequirementsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PercentageRequirements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PercentageRequirements' from JSON`, ); } /** @internal */ export const DayTrade$inboundSchema: z.ZodType< DayTrade, z.ZodTypeDef, unknown > = z.object({ asset_buying_power_max_amount: z.nullable( z.lazy(() => AssetBuyingPowerMaxAmount$inboundSchema), ).optional(), max_purchase_quantity: z.nullable( z.lazy(() => MaxPurchaseQuantity$inboundSchema), ).optional(), percentage_requirements: z.nullable( z.lazy(() => PercentageRequirements$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "asset_buying_power_max_amount": "assetBuyingPowerMaxAmount", "max_purchase_quantity": "maxPurchaseQuantity", "percentage_requirements": "percentageRequirements", }); }); /** @internal */ export type DayTrade$Outbound = { asset_buying_power_max_amount?: | AssetBuyingPowerMaxAmount$Outbound | null | undefined; max_purchase_quantity?: MaxPurchaseQuantity$Outbound | null | undefined; percentage_requirements?: PercentageRequirements$Outbound | null | undefined; }; /** @internal */ export const DayTrade$outboundSchema: z.ZodType< DayTrade$Outbound, z.ZodTypeDef, DayTrade > = z.object({ assetBuyingPowerMaxAmount: z.nullable( z.lazy(() => AssetBuyingPowerMaxAmount$outboundSchema), ).optional(), maxPurchaseQuantity: z.nullable( z.lazy(() => MaxPurchaseQuantity$outboundSchema), ).optional(), percentageRequirements: z.nullable( z.lazy(() => PercentageRequirements$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { assetBuyingPowerMaxAmount: "asset_buying_power_max_amount", maxPurchaseQuantity: "max_purchase_quantity", percentageRequirements: "percentage_requirements", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DayTrade$ { /** @deprecated use `DayTrade$inboundSchema` instead. */ export const inboundSchema = DayTrade$inboundSchema; /** @deprecated use `DayTrade$outboundSchema` instead. */ export const outboundSchema = DayTrade$outboundSchema; /** @deprecated use `DayTrade$Outbound` instead. */ export type Outbound = DayTrade$Outbound; } export function dayTradeToJSON(dayTrade: DayTrade): string { return JSON.stringify(DayTrade$outboundSchema.parse(dayTrade)); } export function dayTradeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DayTrade$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DayTrade' from JSON`, ); } /** @internal */ export const AssetBuyingPowerAssetBuyingPowerMaxAmount$inboundSchema: z.ZodType< AssetBuyingPowerAssetBuyingPowerMaxAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerAssetBuyingPowerMaxAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerAssetBuyingPowerMaxAmount$outboundSchema: z.ZodType< AssetBuyingPowerAssetBuyingPowerMaxAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerAssetBuyingPowerMaxAmount > = 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 AssetBuyingPowerAssetBuyingPowerMaxAmount$ { /** @deprecated use `AssetBuyingPowerAssetBuyingPowerMaxAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerAssetBuyingPowerMaxAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerAssetBuyingPowerMaxAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerAssetBuyingPowerMaxAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerAssetBuyingPowerMaxAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerAssetBuyingPowerMaxAmount$Outbound; } export function assetBuyingPowerAssetBuyingPowerMaxAmountToJSON( assetBuyingPowerAssetBuyingPowerMaxAmount: AssetBuyingPowerAssetBuyingPowerMaxAmount, ): string { return JSON.stringify( AssetBuyingPowerAssetBuyingPowerMaxAmount$outboundSchema.parse( assetBuyingPowerAssetBuyingPowerMaxAmount, ), ); } export function assetBuyingPowerAssetBuyingPowerMaxAmountFromJSON( jsonString: string, ): SafeParseResult< AssetBuyingPowerAssetBuyingPowerMaxAmount, SDKValidationError > { return safeParse( jsonString, (x) => AssetBuyingPowerAssetBuyingPowerMaxAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AssetBuyingPowerAssetBuyingPowerMaxAmount' from JSON`, ); } /** @internal */ export const AssetBuyingPowerMaxPurchaseQuantity$inboundSchema: z.ZodType< AssetBuyingPowerMaxPurchaseQuantity, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerMaxPurchaseQuantity$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerMaxPurchaseQuantity$outboundSchema: z.ZodType< AssetBuyingPowerMaxPurchaseQuantity$Outbound, z.ZodTypeDef, AssetBuyingPowerMaxPurchaseQuantity > = 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 AssetBuyingPowerMaxPurchaseQuantity$ { /** @deprecated use `AssetBuyingPowerMaxPurchaseQuantity$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerMaxPurchaseQuantity$inboundSchema; /** @deprecated use `AssetBuyingPowerMaxPurchaseQuantity$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerMaxPurchaseQuantity$outboundSchema; /** @deprecated use `AssetBuyingPowerMaxPurchaseQuantity$Outbound` instead. */ export type Outbound = AssetBuyingPowerMaxPurchaseQuantity$Outbound; } export function assetBuyingPowerMaxPurchaseQuantityToJSON( assetBuyingPowerMaxPurchaseQuantity: AssetBuyingPowerMaxPurchaseQuantity, ): string { return JSON.stringify( AssetBuyingPowerMaxPurchaseQuantity$outboundSchema.parse( assetBuyingPowerMaxPurchaseQuantity, ), ); } export function assetBuyingPowerMaxPurchaseQuantityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPowerMaxPurchaseQuantity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPowerMaxPurchaseQuantity' from JSON`, ); } /** @internal */ export const AssetBuyingPowerPercentageRequirements$inboundSchema: z.ZodType< AssetBuyingPowerPercentageRequirements, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerPercentageRequirements$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerPercentageRequirements$outboundSchema: z.ZodType< AssetBuyingPowerPercentageRequirements$Outbound, z.ZodTypeDef, AssetBuyingPowerPercentageRequirements > = 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 AssetBuyingPowerPercentageRequirements$ { /** @deprecated use `AssetBuyingPowerPercentageRequirements$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerPercentageRequirements$inboundSchema; /** @deprecated use `AssetBuyingPowerPercentageRequirements$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerPercentageRequirements$outboundSchema; /** @deprecated use `AssetBuyingPowerPercentageRequirements$Outbound` instead. */ export type Outbound = AssetBuyingPowerPercentageRequirements$Outbound; } export function assetBuyingPowerPercentageRequirementsToJSON( assetBuyingPowerPercentageRequirements: AssetBuyingPowerPercentageRequirements, ): string { return JSON.stringify( AssetBuyingPowerPercentageRequirements$outboundSchema.parse( assetBuyingPowerPercentageRequirements, ), ); } export function assetBuyingPowerPercentageRequirementsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPowerPercentageRequirements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPowerPercentageRequirements' from JSON`, ); } /** @internal */ export const NonDayTrade$inboundSchema: z.ZodType< NonDayTrade, z.ZodTypeDef, unknown > = z.object({ asset_buying_power_max_amount: z.nullable( z.lazy(() => AssetBuyingPowerAssetBuyingPowerMaxAmount$inboundSchema), ).optional(), max_purchase_quantity: z.nullable( z.lazy(() => AssetBuyingPowerMaxPurchaseQuantity$inboundSchema), ).optional(), percentage_requirements: z.nullable( z.lazy(() => AssetBuyingPowerPercentageRequirements$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "asset_buying_power_max_amount": "assetBuyingPowerMaxAmount", "max_purchase_quantity": "maxPurchaseQuantity", "percentage_requirements": "percentageRequirements", }); }); /** @internal */ export type NonDayTrade$Outbound = { asset_buying_power_max_amount?: | AssetBuyingPowerAssetBuyingPowerMaxAmount$Outbound | null | undefined; max_purchase_quantity?: | AssetBuyingPowerMaxPurchaseQuantity$Outbound | null | undefined; percentage_requirements?: | AssetBuyingPowerPercentageRequirements$Outbound | null | undefined; }; /** @internal */ export const NonDayTrade$outboundSchema: z.ZodType< NonDayTrade$Outbound, z.ZodTypeDef, NonDayTrade > = z.object({ assetBuyingPowerMaxAmount: z.nullable( z.lazy(() => AssetBuyingPowerAssetBuyingPowerMaxAmount$outboundSchema), ).optional(), maxPurchaseQuantity: z.nullable( z.lazy(() => AssetBuyingPowerMaxPurchaseQuantity$outboundSchema), ).optional(), percentageRequirements: z.nullable( z.lazy(() => AssetBuyingPowerPercentageRequirements$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { assetBuyingPowerMaxAmount: "asset_buying_power_max_amount", maxPurchaseQuantity: "max_purchase_quantity", percentageRequirements: "percentage_requirements", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace NonDayTrade$ { /** @deprecated use `NonDayTrade$inboundSchema` instead. */ export const inboundSchema = NonDayTrade$inboundSchema; /** @deprecated use `NonDayTrade$outboundSchema` instead. */ export const outboundSchema = NonDayTrade$outboundSchema; /** @deprecated use `NonDayTrade$Outbound` instead. */ export type Outbound = NonDayTrade$Outbound; } export function nonDayTradeToJSON(nonDayTrade: NonDayTrade): string { return JSON.stringify(NonDayTrade$outboundSchema.parse(nonDayTrade)); } export function nonDayTradeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NonDayTrade$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NonDayTrade' from JSON`, ); } /** @internal */ export const PriceAmount$inboundSchema: z.ZodType< PriceAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type PriceAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const PriceAmount$outboundSchema: z.ZodType< PriceAmount$Outbound, z.ZodTypeDef, PriceAmount > = 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 PriceAmount$ { /** @deprecated use `PriceAmount$inboundSchema` instead. */ export const inboundSchema = PriceAmount$inboundSchema; /** @deprecated use `PriceAmount$outboundSchema` instead. */ export const outboundSchema = PriceAmount$outboundSchema; /** @deprecated use `PriceAmount$Outbound` instead. */ export type Outbound = PriceAmount$Outbound; } export function priceAmountToJSON(priceAmount: PriceAmount): string { return JSON.stringify(PriceAmount$outboundSchema.parse(priceAmount)); } export function priceAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PriceAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PriceAmount' from JSON`, ); } /** @internal */ export const AssetSpecific$inboundSchema: z.ZodType< AssetSpecific, z.ZodTypeDef, unknown > = z.object({ day_trade: z.nullable(z.lazy(() => DayTrade$inboundSchema)).optional(), non_day_trade: z.nullable(z.lazy(() => NonDayTrade$inboundSchema)).optional(), price_amount: z.nullable(z.lazy(() => PriceAmount$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "day_trade": "dayTrade", "non_day_trade": "nonDayTrade", "price_amount": "priceAmount", }); }); /** @internal */ export type AssetSpecific$Outbound = { day_trade?: DayTrade$Outbound | null | undefined; non_day_trade?: NonDayTrade$Outbound | null | undefined; price_amount?: PriceAmount$Outbound | null | undefined; }; /** @internal */ export const AssetSpecific$outboundSchema: z.ZodType< AssetSpecific$Outbound, z.ZodTypeDef, AssetSpecific > = z.object({ dayTrade: z.nullable(z.lazy(() => DayTrade$outboundSchema)).optional(), nonDayTrade: z.nullable(z.lazy(() => NonDayTrade$outboundSchema)).optional(), priceAmount: z.nullable(z.lazy(() => PriceAmount$outboundSchema)).optional(), }).transform((v) => { return remap$(v, { dayTrade: "day_trade", nonDayTrade: "non_day_trade", priceAmount: "price_amount", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AssetSpecific$ { /** @deprecated use `AssetSpecific$inboundSchema` instead. */ export const inboundSchema = AssetSpecific$inboundSchema; /** @deprecated use `AssetSpecific$outboundSchema` instead. */ export const outboundSchema = AssetSpecific$outboundSchema; /** @deprecated use `AssetSpecific$Outbound` instead. */ export type Outbound = AssetSpecific$Outbound; } export function assetSpecificToJSON(assetSpecific: AssetSpecific): string { return JSON.stringify(AssetSpecific$outboundSchema.parse(assetSpecific)); } export function assetSpecificFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetSpecific$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetSpecific' from JSON`, ); } /** @internal */ export const AssetBuyingPowerTotalExcessAmount$inboundSchema: z.ZodType< AssetBuyingPowerTotalExcessAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerTotalExcessAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerTotalExcessAmount$outboundSchema: z.ZodType< AssetBuyingPowerTotalExcessAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerTotalExcessAmount > = 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 AssetBuyingPowerTotalExcessAmount$ { /** @deprecated use `AssetBuyingPowerTotalExcessAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerTotalExcessAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerTotalExcessAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerTotalExcessAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerTotalExcessAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerTotalExcessAmount$Outbound; } export function assetBuyingPowerTotalExcessAmountToJSON( assetBuyingPowerTotalExcessAmount: AssetBuyingPowerTotalExcessAmount, ): string { return JSON.stringify( AssetBuyingPowerTotalExcessAmount$outboundSchema.parse( assetBuyingPowerTotalExcessAmount, ), ); } export function assetBuyingPowerTotalExcessAmountFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPowerTotalExcessAmount$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPowerTotalExcessAmount' from JSON`, ); } /** @internal */ export const AssetBuyingPowerTotalRequirementsAmount$inboundSchema: z.ZodType< AssetBuyingPowerTotalRequirementsAmount, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), }); /** @internal */ export type AssetBuyingPowerTotalRequirementsAmount$Outbound = { value?: string | undefined; }; /** @internal */ export const AssetBuyingPowerTotalRequirementsAmount$outboundSchema: z.ZodType< AssetBuyingPowerTotalRequirementsAmount$Outbound, z.ZodTypeDef, AssetBuyingPowerTotalRequirementsAmount > = 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 AssetBuyingPowerTotalRequirementsAmount$ { /** @deprecated use `AssetBuyingPowerTotalRequirementsAmount$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerTotalRequirementsAmount$inboundSchema; /** @deprecated use `AssetBuyingPowerTotalRequirementsAmount$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerTotalRequirementsAmount$outboundSchema; /** @deprecated use `AssetBuyingPowerTotalRequirementsAmount$Outbound` instead. */ export type Outbound = AssetBuyingPowerTotalRequirementsAmount$Outbound; } export function assetBuyingPowerTotalRequirementsAmountToJSON( assetBuyingPowerTotalRequirementsAmount: AssetBuyingPowerTotalRequirementsAmount, ): string { return JSON.stringify( AssetBuyingPowerTotalRequirementsAmount$outboundSchema.parse( assetBuyingPowerTotalRequirementsAmount, ), ); } export function assetBuyingPowerTotalRequirementsAmountFromJSON( jsonString: string, ): SafeParseResult< AssetBuyingPowerTotalRequirementsAmount, SDKValidationError > { return safeParse( jsonString, (x) => AssetBuyingPowerTotalRequirementsAmount$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AssetBuyingPowerTotalRequirementsAmount' from JSON`, ); } /** @internal */ export const AssetBuyingPowerRequirements$inboundSchema: z.ZodType< AssetBuyingPowerRequirements, z.ZodTypeDef, unknown > = z.object({ total_excess_amount: z.nullable( z.lazy(() => AssetBuyingPowerTotalExcessAmount$inboundSchema), ).optional(), total_requirements_amount: z.nullable( z.lazy(() => AssetBuyingPowerTotalRequirementsAmount$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "total_excess_amount": "totalExcessAmount", "total_requirements_amount": "totalRequirementsAmount", }); }); /** @internal */ export type AssetBuyingPowerRequirements$Outbound = { total_excess_amount?: | AssetBuyingPowerTotalExcessAmount$Outbound | null | undefined; total_requirements_amount?: | AssetBuyingPowerTotalRequirementsAmount$Outbound | null | undefined; }; /** @internal */ export const AssetBuyingPowerRequirements$outboundSchema: z.ZodType< AssetBuyingPowerRequirements$Outbound, z.ZodTypeDef, AssetBuyingPowerRequirements > = z.object({ totalExcessAmount: z.nullable( z.lazy(() => AssetBuyingPowerTotalExcessAmount$outboundSchema), ).optional(), totalRequirementsAmount: z.nullable( z.lazy(() => AssetBuyingPowerTotalRequirementsAmount$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { totalExcessAmount: "total_excess_amount", totalRequirementsAmount: "total_requirements_amount", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AssetBuyingPowerRequirements$ { /** @deprecated use `AssetBuyingPowerRequirements$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPowerRequirements$inboundSchema; /** @deprecated use `AssetBuyingPowerRequirements$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPowerRequirements$outboundSchema; /** @deprecated use `AssetBuyingPowerRequirements$Outbound` instead. */ export type Outbound = AssetBuyingPowerRequirements$Outbound; } export function assetBuyingPowerRequirementsToJSON( assetBuyingPowerRequirements: AssetBuyingPowerRequirements, ): string { return JSON.stringify( AssetBuyingPowerRequirements$outboundSchema.parse( assetBuyingPowerRequirements, ), ); } export function assetBuyingPowerRequirementsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPowerRequirements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPowerRequirements' from JSON`, ); } /** @internal */ export const AssetBuyingPower$inboundSchema: z.ZodType< AssetBuyingPower, z.ZodTypeDef, unknown > = z.object({ account_asset_buying_power: z.nullable( z.lazy(() => AccountAssetBuyingPower$inboundSchema), ).optional(), account_equity: z.nullable(z.lazy(() => AccountEquity$inboundSchema)) .optional(), account_id: z.string().optional(), asset_id: z.string().optional(), asset_specific: z.nullable(z.lazy(() => AssetSpecific$inboundSchema)) .optional(), name: z.string().optional(), requirements: z.nullable( z.lazy(() => AssetBuyingPowerRequirements$inboundSchema), ).optional(), }).transform((v) => { return remap$(v, { "account_asset_buying_power": "accountAssetBuyingPower", "account_equity": "accountEquity", "account_id": "accountId", "asset_id": "assetId", "asset_specific": "assetSpecific", }); }); /** @internal */ export type AssetBuyingPower$Outbound = { account_asset_buying_power?: | AccountAssetBuyingPower$Outbound | null | undefined; account_equity?: AccountEquity$Outbound | null | undefined; account_id?: string | undefined; asset_id?: string | undefined; asset_specific?: AssetSpecific$Outbound | null | undefined; name?: string | undefined; requirements?: AssetBuyingPowerRequirements$Outbound | null | undefined; }; /** @internal */ export const AssetBuyingPower$outboundSchema: z.ZodType< AssetBuyingPower$Outbound, z.ZodTypeDef, AssetBuyingPower > = z.object({ accountAssetBuyingPower: z.nullable( z.lazy(() => AccountAssetBuyingPower$outboundSchema), ).optional(), accountEquity: z.nullable(z.lazy(() => AccountEquity$outboundSchema)) .optional(), accountId: z.string().optional(), assetId: z.string().optional(), assetSpecific: z.nullable(z.lazy(() => AssetSpecific$outboundSchema)) .optional(), name: z.string().optional(), requirements: z.nullable( z.lazy(() => AssetBuyingPowerRequirements$outboundSchema), ).optional(), }).transform((v) => { return remap$(v, { accountAssetBuyingPower: "account_asset_buying_power", accountEquity: "account_equity", accountId: "account_id", assetId: "asset_id", assetSpecific: "asset_specific", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AssetBuyingPower$ { /** @deprecated use `AssetBuyingPower$inboundSchema` instead. */ export const inboundSchema = AssetBuyingPower$inboundSchema; /** @deprecated use `AssetBuyingPower$outboundSchema` instead. */ export const outboundSchema = AssetBuyingPower$outboundSchema; /** @deprecated use `AssetBuyingPower$Outbound` instead. */ export type Outbound = AssetBuyingPower$Outbound; } export function assetBuyingPowerToJSON( assetBuyingPower: AssetBuyingPower, ): string { return JSON.stringify( AssetBuyingPower$outboundSchema.parse(assetBuyingPower), ); } export function assetBuyingPowerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetBuyingPower$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetBuyingPower' from JSON`, ); }