Skip to main content

bezant_api/generated/
types.rs

1//!
2//! AUTO-GENERATED CODE - DO NOT EDIT!
3//!
4//! IB REST API
5//! Source: crates/bezant-spec/ibkr-openapi-3.1.json
6//! Version: 2.29.0
7//! Generated by `oas3-gen v0.25.3`
8//!
9//! The IB REST API reference documentation
10
11use serde::{Deserialize, Serialize};
12use validator::Validate;
13pub const AUTHORIZATION: http::HeaderName = http::HeaderName::from_static("authorization");
14#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15pub struct AccessToken200Response {
16    /// Indicates whether the authorizing username is paper or not.
17    pub is_true: Option<bool>,
18    /// Permanent OAuth access token for the consumer with respect to the authorizing username. 20 character hex value.
19    pub oauth_token: Option<String>,
20    /// OAuth token secret value. Base64-encoded string.
21    pub oauth_token_secret: Option<String>,
22}
23#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
24#[serde(untagged)]
25pub enum Account200Response {
26    #[default]
27    FileDetails(FileDetailsResponse),
28    ResponseFile(ResponseFileResponse),
29}
30impl Account200Response {
31    pub fn file_details() -> Self {
32        Self::FileDetails(FileDetailsResponse::default())
33    }
34    pub fn file() -> Self {
35        Self::ResponseFile(ResponseFileResponse::default())
36    }
37}
38/// Array of objects representing accounts in the structure.
39pub type Account200Response2 = Vec<AccountAttributes>;
40#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
41#[serde(default)]
42pub struct AccountAttributes {
43    /// Indicates whether account has a prepaid crypto segment (Crypto Plus) with PAXOS.
44    #[serde(rename = "PrepaidCrypto-P")]
45    pub prepaid_crypto_p: Option<bool>,
46    /// Indicates whether account has a prepaid crypto segment (Crypto Plus) with ZEROHASH.
47    #[serde(rename = "PrepaidCrypto-Z")]
48    pub prepaid_crypto_z: Option<bool>,
49    /// User-defined alias assigned to the account for easy identification.
50    #[serde(rename = "accountAlias")]
51    pub account_alias: Option<String>,
52    /// Indicates the identifying number for the account.
53    #[serde(rename = "accountId")]
54    pub account_id: Option<String>,
55    /// Unix epoch timestamp of account opening.
56    #[serde(rename = "accountStatus")]
57    pub account_status: Option<i32>,
58    /// A name assigned to the account, typically the account holder name or business entity.
59    #[serde(rename = "accountTitle")]
60    pub account_title: Option<String>,
61    /// The account's virtual account number, or otherwise its IB accountId if no VAN is set.
62    #[serde(rename = "accountVan")]
63    pub account_van: Option<String>,
64    /// Identifies the type of client with which the account is associated, such as an individual or LLC.
65    #[serde(rename = "acctCustType")]
66    pub acct_cust_type: Option<String>,
67    /// Indicates whether account can receive live orders (do not mix with paper trading).
68    #[serde(rename = "brokerageAccess")]
69    pub brokerage_access: Option<bool>,
70    /// A descriptor of the nature of the account, reflecting the responsible group within IB.
71    #[serde(rename = "businessType")]
72    pub business_type: Option<AccountAttributesBusinessType>,
73    /// Designated account category. Only used in non-standard account structures.
74    pub category: Option<String>,
75    /// Status of the account with respect to clearing at IB. O is open, P pending, N new, A abandoned, C closed, R rejected.
76    #[serde(rename = "clearingStatus")]
77    pub clearing_status: Option<AccountAttributesClearingStatus>,
78    /// Indicates a Covestor account.
79    pub covestor: Option<bool>,
80    /// Base currency of the account.
81    #[default(Some("USD".to_string()))]
82    pub currency: Option<String>,
83    /// Internal human-readable description of the account.
84    pub desc: Option<String>,
85    /// Displayed name of the account in UI. Will reflect either the accountId or accountAlias, if set.
86    #[serde(rename = "displayName")]
87    pub display_name: Option<String>,
88    /// Indicates that the account is managed by a financial advisor.
89    #[serde(rename = "faClient")]
90    pub fa_client: Option<bool>,
91    /// IB business entity under which the account resides.
92    #[serde(rename = "ibEntity")]
93    pub ib_entity: Option<AccountAttributesIbEntity>,
94    /// The account's IB accountId.
95    pub id: Option<String>,
96    /// Indicates that trading by the client is disabled in the account.
97    #[serde(rename = "noClientTrading")]
98    pub no_client_trading: Option<bool>,
99    /// Describes account relations in partitioned or multiplexed (segemented) account structures.
100    pub parent: Option<AccountAttributesParent>,
101    /// Indicates that virtual forex positions are tracked in the account.
102    #[serde(rename = "trackVirtualFXPortfolio")]
103    pub track_virtual_fxportfolio: Option<bool>,
104    /// Internal identifier used by IB to reflect the trading permissions of the account.
105    #[serde(rename = "tradingType")]
106    #[default(Some("STKNOPT".to_string()))]
107    pub trading_type: Option<String>,
108    /// Indicates whether the account exists in production, paper, or demo environments.
109    #[serde(rename = "type")]
110    #[default(Some("DEMO".to_string()))]
111    pub r#type: Option<String>,
112}
113/// A descriptor of the nature of the account, reflecting the responsible group within IB.
114#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
115pub enum AccountAttributesBusinessType {
116    #[serde(rename = "IB_SALES")]
117    #[default]
118    IbSales,
119    #[serde(rename = "IB_PROSERVE")]
120    IbProserve,
121}
122impl core::fmt::Display for AccountAttributesBusinessType {
123    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
124        match self {
125            Self::IbSales => write!(f, "IB_SALES"),
126            Self::IbProserve => write!(f, "IB_PROSERVE"),
127        }
128    }
129}
130/// Status of the account with respect to clearing at IB. O is open, P pending, N new, A abandoned, C closed, R rejected.
131#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
132pub enum AccountAttributesClearingStatus {
133    #[default]
134    O,
135    P,
136    N,
137    A,
138    R,
139    C,
140}
141impl core::fmt::Display for AccountAttributesClearingStatus {
142    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
143        match self {
144            Self::O => write!(f, "O"),
145            Self::P => write!(f, "P"),
146            Self::N => write!(f, "N"),
147            Self::A => write!(f, "A"),
148            Self::R => write!(f, "R"),
149            Self::C => write!(f, "C"),
150        }
151    }
152}
153/// IB business entity under which the account resides.
154#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
155pub enum AccountAttributesIbEntity {
156    #[serde(rename = "IBLLC-US")]
157    #[default]
158    IbllcUs,
159    #[serde(rename = "IB-CAN")]
160    IbCan,
161    #[serde(rename = "IB-UK")]
162    IbUk,
163    #[serde(rename = "IB-IE")]
164    IbIe,
165}
166impl core::fmt::Display for AccountAttributesIbEntity {
167    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
168        match self {
169            Self::IbllcUs => write!(f, "IBLLC-US"),
170            Self::IbCan => write!(f, "IB-CAN"),
171            Self::IbUk => write!(f, "IB-UK"),
172            Self::IbIe => write!(f, "IB-IE"),
173        }
174    }
175}
176/// Describes account relations in partitioned or multiplexed (segemented) account structures.
177#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
178pub struct AccountAttributesParent {
179    /// Account ID of the parent account in a multiplex account structure.
180    #[serde(rename = "accountId")]
181    pub account_id: Option<String>,
182    /// Indicates that the given account is a multiplex child account.
183    #[serde(rename = "isMChild")]
184    pub is_mchild: Option<bool>,
185    /// Indicates that the given account is itself a multiplex parent account.
186    #[serde(rename = "isMParent")]
187    pub is_mparent: Option<bool>,
188    /// Indicates that the account is a multiplex account.
189    #[serde(rename = "isMultiplex")]
190    pub is_multiplex: Option<bool>,
191    /// Money manager client.
192    pub mmc: Option<Vec<serde_json::Value>>,
193}
194#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
195pub struct AccountData {
196    #[serde(rename = "accountAlias")]
197    pub account_alias: Option<String>,
198    #[serde(rename = "accountId")]
199    pub account_id: Option<String>,
200    #[serde(rename = "accountTitle")]
201    pub account_title: Option<String>,
202    #[serde(rename = "applicantType")]
203    pub applicant_type: Option<String>,
204    #[serde(rename = "baseCurrency")]
205    pub base_currency: Option<String>,
206    #[serde(rename = "businessDescription")]
207    pub business_description: Option<String>,
208    pub capabilities: Option<std::collections::HashMap<String, Vec<String>>>,
209    pub class_action_program: Option<String>,
210    #[serde(rename = "clearingStatus")]
211    pub clearing_status: Option<String>,
212    #[serde(rename = "clearingStatusDescription")]
213    pub clearing_status_description: Option<String>,
214    #[serde(rename = "countryOfCorporation")]
215    pub country_of_corporation: Option<String>,
216    #[serde(rename = "dateApproved")]
217    pub date_approved: Option<String>,
218    #[serde(rename = "dateBegun")]
219    pub date_begun: Option<String>,
220    #[serde(rename = "dateClosed")]
221    pub date_closed: Option<String>,
222    #[serde(rename = "dateDelinked")]
223    pub date_delinked: Option<String>,
224    #[serde(rename = "dateFunded")]
225    pub date_funded: Option<String>,
226    #[serde(rename = "dateLinked")]
227    pub date_linked: Option<String>,
228    #[serde(rename = "dateOpened")]
229    pub date_opened: Option<String>,
230    #[serde(rename = "dividendReinvestment")]
231    pub dividend_reinvestment: Option<std::collections::HashMap<String, bool>>,
232    #[serde(rename = "emailAddress")]
233    pub email_address: Option<String>,
234    pub equity: Option<f64>,
235    #[serde(rename = "externalId")]
236    pub external_id: Option<String>,
237    #[serde(rename = "feeTemplate")]
238    pub fee_template: Option<std::collections::HashMap<String, String>>,
239    pub household: Option<String>,
240    #[serde(rename = "investmentObjectives")]
241    pub investment_objectives: Option<Vec<String>>,
242    #[serde(rename = "limitedOptionTrading")]
243    pub limited_option_trading: Option<String>,
244    pub mailing: Option<std::collections::HashMap<String, String>>,
245    #[serde(rename = "mainAccount")]
246    pub main_account: Option<String>,
247    pub margin: Option<String>,
248    #[serde(rename = "masterAccountId")]
249    pub master_account_id: Option<String>,
250    #[serde(rename = "mifidCategory")]
251    pub mifid_category: Option<String>,
252    #[serde(rename = "mifirStatus")]
253    pub mifir_status: Option<String>,
254    #[serde(rename = "officialTitle")]
255    pub official_title: Option<String>,
256    #[serde(rename = "optionLevel")]
257    pub option_level: Option<i32>,
258    #[serde(rename = "orgType")]
259    pub org_type: Option<String>,
260    #[serde(rename = "primaryUser")]
261    pub primary_user: Option<String>,
262    #[serde(rename = "processType")]
263    pub process_type: Option<String>,
264    #[serde(rename = "propertyProfile")]
265    pub property_profile: Option<String>,
266    #[serde(rename = "registeredAddress")]
267    pub registered_address: Option<std::collections::HashMap<String, String>>,
268    #[serde(rename = "riskScore")]
269    pub risk_score: Option<i32>,
270    pub signatures: Option<Vec<String>>,
271    #[serde(rename = "sourceAccountId")]
272    pub source_account_id: Option<String>,
273    #[serde(rename = "stateCode")]
274    pub state_code: Option<String>,
275    #[serde(rename = "stockYieldProgram")]
276    pub stock_yield_program: Option<std::collections::HashMap<String, String>>,
277    #[serde(rename = "subType")]
278    pub sub_type: Option<String>,
279    #[serde(rename = "taxIds")]
280    pub tax_ids: Option<Vec<std::collections::HashMap<String, String>>>,
281    #[serde(rename = "taxTreatyDetails")]
282    pub tax_treaty_details: Option<Vec<std::collections::HashMap<String, String>>>,
283    #[serde(rename = "tradeIntentionType")]
284    pub trade_intention_type: Option<String>,
285    #[serde(rename = "trustType")]
286    pub trust_type: Option<String>,
287    #[serde(rename = "usTaxPurposeType")]
288    pub us_tax_purpose_type: Option<String>,
289}
290#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
291pub struct AccountDetailsResponse {
292    pub account: Option<AccountData>,
293    #[serde(rename = "associatedEntities")]
294    pub associated_entities: Option<Vec<AssociatedEntity>>,
295    #[serde(rename = "associatedPersons")]
296    pub associated_persons: Option<Vec<AssociatedPerson>>,
297    pub decedents: Option<Vec<std::collections::HashMap<String, String>>>,
298    #[serde(rename = "entityIRABeneficiaries")]
299    pub entity_irabeneficiaries: Option<Vec<EntityIRABene>>,
300    pub error: Option<Box<ErrorResponse>>,
301    #[serde(rename = "errorDescription")]
302    pub error_description: Option<String>,
303    #[serde(rename = "financialInformation")]
304    pub financial_information: Option<std::collections::HashMap<String, serde_json::Value>>,
305    #[serde(rename = "hasError")]
306    pub has_error: Option<bool>,
307    #[serde(rename = "individualIRABeneficiaries")]
308    pub individual_irabeneficiaries: Option<Vec<IndividualIRABene>>,
309    #[serde(rename = "marketData")]
310    pub market_data: Option<Vec<std::collections::HashMap<String, String>>>,
311    pub restrictions: Option<Vec<RestrictionInfo>>,
312    #[serde(rename = "sourcesOfWealth")]
313    pub sources_of_wealth: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
314    #[serde(rename = "tradeBundles")]
315    pub trade_bundles: Option<Vec<String>>,
316    #[serde(rename = "withHoldingStatement")]
317    pub with_holding_statement: Option<std::collections::HashMap<String, String>>,
318}
319pub type AccountRequestBody = String;
320#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
321pub struct AccountStatusBulkResponse {
322    pub accounts: Option<Vec<AccountStatusResponse>>,
323    pub limit: Option<i32>,
324    pub offset: Option<i32>,
325    pub total: Option<i32>,
326}
327#[serde_with::skip_serializing_none]
328#[derive(
329    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
330)]
331pub struct AccountStatusRequest {
332    #[serde(rename = "endDate")]
333    pub end_date: chrono::NaiveDate,
334    #[validate(range(min = 1i32, max = 1_000i32))]
335    pub limit: Option<i32>,
336    #[validate(range(min = 0i32))]
337    pub offset: Option<i32>,
338    #[serde(rename = "startDate")]
339    pub start_date: chrono::NaiveDate,
340    pub status: Option<RequestStatus>,
341}
342#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
343pub struct AccountStatusResponse {
344    #[serde(rename = "accountId")]
345    pub account_id: Option<String>,
346    #[serde(rename = "adminAccountId")]
347    pub admin_account_id: Option<String>,
348    #[serde(rename = "dateClosed")]
349    pub date_closed: Option<chrono::DateTime<chrono::Utc>>,
350    #[serde(rename = "dateOpened")]
351    pub date_opened: Option<chrono::DateTime<chrono::Utc>>,
352    #[serde(rename = "dateStarted")]
353    pub date_started: Option<chrono::DateTime<chrono::Utc>>,
354    pub description: Option<String>,
355    #[serde(rename = "masterAccountId")]
356    pub master_account_id: Option<String>,
357    pub message: Option<String>,
358    pub state: Option<String>,
359    pub status: Option<String>,
360}
361/// Successful return contianing an array of at-a-glance account details.
362#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
363pub struct AccountSummaryResponse {
364    /// Simple Moving Average of the account.
365    #[serde(rename = "SMA")]
366    pub sma: Option<f64>,
367    /// Describes the unique account type. For standard individual accounts, an empty string is returned.
368    #[serde(rename = "accountType")]
369    pub account_type: Option<String>,
370    /// Accrued interest is the interest accruing on a security since the previous coupon date. If a security is sold between two payment dates, the buyer usually compensates the seller for the interest accrued, either within the price or as a separate payment.
371    #[serde(rename = "accruedInterest")]
372    pub accrued_interest: Option<f64>,
373    /// The amount of equity you have available for trading. For both the Securities and Commodities segments, this is calculated as: Equity with Loan Value – Initial Margin.
374    #[serde(rename = "availableFunds")]
375    pub available_funds: Option<f64>,
376    /// Returns the total account balance.
377    pub balance: Option<f64>,
378    /// Total buying power available for the account.
379    #[serde(rename = "buyingPower")]
380    pub buying_power: Option<f64>,
381    /// An array containing balance information for all currencies held by the account.
382    #[serde(rename = "cashBalances")]
383    pub cash_balances: Option<Vec<AccountSummaryResponseCashBalance>>,
384    /// The basis for determining whether you have the necessary assets to either initiate or maintain security assets.
385    #[serde(rename = "equityWithLoanValue")]
386    pub equity_with_loan_value: Option<f64>,
387    /// The amount of cash in excess of the usual requirement in your account.
388    #[serde(rename = "excessLiquidity")]
389    pub excess_liquidity: Option<f64>,
390    /// The available initial margin for the account.
391    #[serde(rename = "initialMargin")]
392    pub initial_margin: Option<f64>,
393    /// The available maintenance margin for the account.
394    #[serde(rename = "maintenanceMargin")]
395    pub maintenance_margin: Option<f64>,
396    /// The basis for determining the price of the assets in your account.
397    #[serde(rename = "netLiquidationValue")]
398    pub net_liquidation_value: Option<f64>,
399    /// The Federal Reserve Board regulation governing the amount of credit that broker dealers may extend to clients who borrow money to buy securities on margin.
400    #[serde(rename = "regTLoan")]
401    pub reg_tloan: Option<f64>,
402    /// The initial margin requirements calculated under US Regulation T rules for both the securities and commodities segment of your account.
403    #[serde(rename = "regTMargin")]
404    pub reg_tmargin: Option<f64>,
405    /// Absolute value of the Long Stock Value + Short Stock Value + Long Option Value + Short Option Value + Fund Value.
406    #[serde(rename = "securitiesGVP")]
407    pub securities_gvp: Option<f64>,
408    /// If the account is currently non-tradeable, a status message will be dispalyed.
409    pub status: Option<String>,
410    /// Cash recognized at the time of trade + futures P&L. This value reflects real-time currency positions, including:
411    ///  *  Trades executed directly through the FX market.
412    ///  *  Trades executed as a result of automatic IB conversions, which occur when you trade a product in a non-base currency.
413    ///  *  Trades deliberately executed to close non-base currency positions using the FXCONV destination.
414    #[serde(rename = "totalCashValue")]
415    pub total_cash_value: Option<f64>,
416}
417#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
418pub struct AccountSummaryResponseCashBalance {
419    /// The total available currency held in the account.
420    pub balance: Option<f64>,
421    /// The currency the values represent. Base currency represented as "Total (in {BaseCurrency})"
422    pub currency: Option<String>,
423    /// The available settled cash that can be withdrawn from the account.
424    #[serde(rename = "settledCash")]
425    pub settled_cash: Option<f64>,
426}
427#[serde_with::skip_serializing_none]
428#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
429pub struct AcctIdRequestBody {
430    /// Identifier for the unique account to retrieve information from.
431    /// - Example: `Some("U1234567".to_string())`
432    #[serde(rename = "acctId")]
433    pub acct_id: Option<String>,
434}
435#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
436pub struct AcctIdRequestBody2 {
437    /// The account ID that should be set for future requests.
438    /// - Example: `"U1234567".to_string()`
439    #[serde(rename = "acctId")]
440    #[validate(length(min = 1u64))]
441    pub acct_id: String,
442}
443#[serde_with::skip_serializing_none]
444#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
445pub struct AcctIdRequestBody3 {
446    /// An array of strings containing each account identifier to retrieve performance details for.
447    #[serde(rename = "acctIds")]
448    pub acct_ids: Option<Vec<String>>,
449}
450#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
451pub struct AchInstruction {
452    /// - Example: `"U223454".to_string()`
453    #[serde(rename = "accountId")]
454    #[validate(length(min = 1u64, max = 32u64))]
455    pub account_id: String,
456    /// - Example: `"DEBIT_CREDIT"`
457    #[serde(rename = "achType")]
458    pub ach_type: AchInstructionAchType,
459    /// - Example: `"USACH"`
460    #[serde(rename = "bankInstructionCode")]
461    pub bank_instruction_code: AchInstructionBankInstructionCode,
462    /// - Example: `"TestInstr".to_string()`
463    #[serde(rename = "bankInstructionName")]
464    #[validate(length(min = 1u64, max = 100u64))]
465    pub bank_instruction_name: String,
466    #[serde(rename = "clientAccountInfo")]
467    #[validate(nested)]
468    pub client_account_info: AchInstructionClientAccountInfo,
469    /// - Example: `1012983.0`
470    #[serde(rename = "clientInstructionId")]
471    pub client_instruction_id: f64,
472    /// - Example: `"USD".to_string()`
473    #[validate(length(min = 1u64, max = 3u64))]
474    pub currency: String,
475}
476#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
477pub enum AchInstructionAchType {
478    #[serde(rename = "DEBIT")]
479    #[default]
480    Debit,
481    #[serde(rename = "CREDIT")]
482    Credit,
483    #[serde(rename = "DEBIT_CREDIT")]
484    DebitCredit,
485}
486impl core::fmt::Display for AchInstructionAchType {
487    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
488        match self {
489            Self::Debit => write!(f, "DEBIT"),
490            Self::Credit => write!(f, "CREDIT"),
491            Self::DebitCredit => write!(f, "DEBIT_CREDIT"),
492        }
493    }
494}
495#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
496pub enum AchInstructionBankInstructionCode {
497    #[serde(rename = "CAACH")]
498    #[default]
499    Caach,
500    #[serde(rename = "USACH")]
501    Usach,
502}
503impl core::fmt::Display for AchInstructionBankInstructionCode {
504    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
505        match self {
506            Self::Caach => write!(f, "CAACH"),
507            Self::Usach => write!(f, "USACH"),
508        }
509    }
510}
511#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
512pub struct AchInstructionClientAccountInfo {
513    /// - Example: `"101267576983".to_string()`
514    #[serde(rename = "bankAccountNumber")]
515    #[validate(length(min = 1u64, max = 32u64))]
516    pub bank_account_number: String,
517    /// - Example: `1`
518    #[serde(rename = "bankAccountTypeCode")]
519    pub bank_account_type_code: AchInstructionClientAccountInfoBankAccountTypeCode,
520    /// - Example: `"JPM Chase".to_string()`
521    #[serde(rename = "bankName")]
522    #[validate(length(min = 1u64, max = 100u64))]
523    pub bank_name: String,
524    /// - Example: `"202012983".to_string()`
525    #[serde(rename = "bankRoutingNumber")]
526    #[validate(length(min = 1u64, max = 24u64))]
527    pub bank_routing_number: String,
528}
529#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
530pub enum AchInstructionClientAccountInfoBankAccountTypeCode {
531    #[serde(rename = "0")]
532    #[default]
533    Value0,
534    #[serde(rename = "1")]
535    Value1,
536    #[serde(rename = "2")]
537    Value2,
538}
539impl core::fmt::Display for AchInstructionClientAccountInfoBankAccountTypeCode {
540    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
541        match self {
542            Self::Value0 => write!(f, "0"),
543            Self::Value1 => write!(f, "1"),
544            Self::Value2 => write!(f, "2"),
545        }
546    }
547}
548/// Respond to a server prompt received via ntf websocket message.
549#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
550pub struct AckServerPromptRequest {
551    pub body: NotificationRequestBody,
552}
553impl AckServerPromptRequest {
554    /// Parse the HTTP response into the response enum.
555    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<AckServerPromptResponse> {
556        let status = req.status();
557        if status == http::StatusCode::OK {
558            let data = oas3_gen_support::Diagnostics::<String>::json_with_diagnostics(req).await?;
559            return Ok(AckServerPromptResponse::Ok(data));
560        }
561        let _ = req.bytes().await?;
562        return Ok(AckServerPromptResponse::Unknown);
563    }
564}
565/// Response types for ackServerPrompt
566#[derive(Debug, Clone)]
567pub enum AckServerPromptResponse {
568    ///200: Status of submitted prompt
569    Ok(String),
570    ///default: Unknown response
571    Unknown,
572}
573/// Activate or Deactivate existing alerts created for this account. This does not delete alerts, but disables notifications until reactivated.
574#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
575pub struct ActivateAlertRequest {
576    #[validate(nested)]
577    pub path: ActivateAlertRequestPath,
578    pub body: AlertActivationRequest,
579}
580impl ActivateAlertRequest {
581    /// Parse the HTTP response into the response enum.
582    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ActivateAlertResponse> {
583        let status = req.status();
584        if status == http::StatusCode::OK {
585            let data =
586                oas3_gen_support::Diagnostics::<AlertActivationResponse>::json_with_diagnostics(
587                    req,
588                )
589                .await?;
590            return Ok(ActivateAlertResponse::Ok(data));
591        }
592        if status == http::StatusCode::UNAUTHORIZED {
593            let _ = req.bytes().await?;
594            return Ok(ActivateAlertResponse::Unauthorized);
595        }
596        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
597            let _ = req.bytes().await?;
598            return Ok(ActivateAlertResponse::InternalServerError);
599        }
600        let _ = req.bytes().await?;
601        return Ok(ActivateAlertResponse::Unknown);
602    }
603}
604#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
605pub struct ActivateAlertRequestPath {
606    /// - Example: `"U1234567".to_string()`
607    #[validate(length(min = 1u64))]
608    pub account_id: String,
609}
610/// Response types for activateAlert
611#[derive(Debug, Clone)]
612pub enum ActivateAlertResponse {
613    ///200: An object containing details about the activated/deactivated alert.
614    Ok(AlertActivationResponse),
615    ///401: Invalid or expired access token
616    Unauthorized,
617    ///500: Internal Server Error; unable to process incoming request due to invalid data in it
618    InternalServerError,
619    ///default: Unknown response
620    Unknown,
621}
622/// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
623#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
624pub struct AdvancedOrderReject {
625    /// Indicates whether this prompt is dismissable.
626    pub dismissable: Option<Vec<serde_json::Value>>,
627    /// IB internal identifier for the nature or category of the returned message.
628    #[serde(rename = "messageId")]
629    pub message_id: Option<String>,
630    /// Choices available to the client in response to the rejection message.
631    pub options: Option<Vec<String>>,
632    /// The order ID assigned by IB to the rejected order ticket.
633    #[serde(rename = "orderId")]
634    pub order_id: Option<i32>,
635    /// Indicates that the message is a prompt offering a set of decisions, one or more of which may permit the rejected order to be resubmitted.
636    pub prompt: Option<bool>,
637    /// IB's internal identifier assigned to the returned message.
638    #[serde(rename = "reqId")]
639    pub req_id: Option<String>,
640    /// Human-readable text of the messages emitted by IB in response to order submission.
641    pub text: Option<String>,
642    /// The specific type of message returned.
643    #[serde(rename = "type")]
644    pub r#type: Option<String>,
645}
646/// An array containing all alerts as separate objects.
647#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
648pub struct Alert {
649    /// The account the alert was attributed to.
650    pub account: Option<String>,
651    /// Determines if the alert is active [1] or not [0]
652    pub alert_active: Option<AlertActivationRequestAlertActive>,
653    /// The requested name for the alert.
654    pub alert_name: Option<String>,
655    /// Confirms if the alert is enabled to occur more than once.
656    pub alert_repeatable: Option<AlertActivationRequestAlertActive>,
657    /// Confirms if the order is triggered or not.
658    pub alert_triggered: Option<bool>,
659    /// The order id (alert id)
660    pub order_id: Option<i32>,
661    /// UTC-formatted time of the alert's creation.
662    pub order_time: Option<String>,
663}
664#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
665pub struct AlertActivationRequest {
666    /// Set whether or not the alert should be active (1) or inactive (0).
667    #[serde(rename = "alertActive")]
668    pub alert_active: AlertActivationRequestAlertActive,
669    /// The alert Identifier
670    #[serde(rename = "alertId")]
671    pub alert_id: i32,
672}
673/// Determines if the alert is active [1] or not [0]
674#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
675pub enum AlertActivationRequestAlertActive {
676    #[serde(rename = "1")]
677    #[default]
678    Value1,
679    #[serde(rename = "0")]
680    Value0,
681}
682impl core::fmt::Display for AlertActivationRequestAlertActive {
683    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
684        match self {
685            Self::Value1 => write!(f, "1"),
686            Self::Value0 => write!(f, "0"),
687        }
688    }
689}
690#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
691pub struct AlertActivationResponse {
692    /// If "success" returns false, will list failed order Ids
693    pub failure_list: Option<String>,
694    /// The tracking number of the alert. Occasssionally referenced as the alertId or alert_id.
695    pub order_id: Option<i32>,
696    pub request_id: Option<i32>,
697    /// Displays result status of alert request
698    pub success: Option<bool>,
699    /// Response message to clarify success status reason.
700    pub text: Option<String>,
701}
702#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
703pub struct AlertCondition {
704    /// Condition logic_bind value set.
705    pub condition_logic_bind: Option<bool>,
706    /// Condition operator set for alert.
707    pub condition_operator: Option<String>,
708    /// Condition timeZone value set.
709    pub condition_time_zone: Option<String>,
710    /// TriggerMethod value set.
711    pub condition_trigger_method: Option<i32>,
712    /// The type of condition set.
713    pub condition_type: Option<i32>,
714    /// Condition value set.
715    pub condition_value: Option<String>,
716    /// Returns conid and exchange in the format "conid@exchange"
717    pub conidex: Option<String>,
718    /// Includes relevant descriptions (if applicable).
719    pub contract_description_1: Option<String>,
720}
721#[serde_with::skip_serializing_none]
722#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
723pub struct AlertCreationRequest {
724    /// Alert message which will be sent
725    #[serde(rename = "alertMessage")]
726    #[validate(length(min = 1u64))]
727    pub alert_message: String,
728    /// Alert name.
729    #[serde(rename = "alertName")]
730    #[validate(length(min = 1u64))]
731    pub alert_name: String,
732    /// Boolean number (0, 1) signifies if an alert can be triggered more than once. A value of '1' is required for MTA alerts
733    #[serde(rename = "alertRepeatable")]
734    pub alert_repeatable: AlertActivationRequestAlertActive,
735    /// Container for all conditions applied for an alert to trigger.
736    #[validate(nested)]
737    pub conditions: Vec<AlertCreationRequestCondition>,
738    /// Email address you want to send email alerts to
739    pub email: Option<String>,
740    /// Used with a tif of "GTD" only. Signifies time when the alert should terminate if no alert is triggered.
741    #[serde(rename = "expireTime")]
742    pub expire_time: Option<String>,
743    /// allow (0) or disallow (1) alerts to trigger alerts through the mobile app
744    #[serde(rename = "iTWSOrdersOnly")]
745    pub i_twsorders_only: Option<i32>,
746    /// optional; used in case of modification and represent Alert Id
747    #[serde(rename = "orderId")]
748    pub order_id: Option<i64>,
749    /// Allow (1) or disallow (0) the alert to be triggered outside of regular trading hours
750    #[serde(rename = "outsideRth")]
751    pub outside_rth: AlertActivationRequestAlertActive,
752    /// allow (1) or disallow (0) alerts to trigger email messages
753    #[serde(rename = "sendMessage")]
754    pub send_message: Option<AlertActivationRequestAlertActive>,
755    /// allow (1) or disallow (0) alerts to trigger TWS Pop-up messages
756    #[serde(rename = "showPopup")]
757    pub show_popup: Option<i32>,
758    /// Time in Force duration of alert.
759    pub tif: AlertCreationRequestTif,
760}
761#[serde_with::skip_serializing_none]
762#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
763#[serde(default)]
764pub struct AlertCreationRequestCondition {
765    /// Concatenation of conid and exchange. Formatted as "conid@exchange"
766    /// - Example: `"265598@SMART".to_string()`
767    #[validate(length(min = 1u64))]
768    pub conidex: String,
769    /// Describes how multiple conditions should behave together. Available logic types:
770    ///   * `a` - AND
771    ///   * `o` - OR
772    ///   * `n` - END
773    #[serde(rename = "logicBind")]
774    #[default(Some(Default::default()))]
775    pub logic_bind: Option<AlertCreationRequestConditionLogicBind>,
776    /// Indicates whether the trigger should be above or below the given value. (one of: >=, <=, >, <, ==)
777    #[validate(length(min = 1u64))]
778    pub operator: String,
779    /// Only needed for some MTA alert condition.
780    #[serde(rename = "timeZone")]
781    pub time_zone: Option<String>,
782    /// Pass the string representation of zero, "0"
783    #[serde(rename = "triggerMethod")]
784    #[validate(length(min = 1u64))]
785    pub trigger_method: String,
786    /// Designate what condition type to use. Note the "MTA" types listed are only supported if iTWSOrdersOnly=1 Available condition types:
787    ///   * `1` - Price
788    ///   * `3` - Time
789    ///   * `4` - Margin
790    ///   * `5` - Trade
791    ///   * `6` - Volume
792    ///   * `7` - MTA Market
793    ///   * `8` - MTA Postion
794    ///   * `9` - MTA Account Daily PnL
795    #[serde(rename = "type")]
796    pub r#type: AlertCreationRequestConditionType,
797    /// Trigger value based on Type.
798    #[default(Some("*".to_string()))]
799    pub value: Option<String>,
800}
801/// Describes how multiple conditions should behave together. Available logic types:
802///   * `a` - AND
803///   * `o` - OR
804///   * `n` - END
805#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
806pub enum AlertCreationRequestConditionLogicBind {
807    #[serde(rename = "a")]
808    #[default]
809    A,
810    #[serde(rename = "o")]
811    O,
812    #[serde(rename = "n")]
813    N,
814}
815impl core::fmt::Display for AlertCreationRequestConditionLogicBind {
816    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
817        match self {
818            Self::A => write!(f, "a"),
819            Self::O => write!(f, "o"),
820            Self::N => write!(f, "n"),
821        }
822    }
823}
824/// Designate what condition type to use. Note the "MTA" types listed are only supported if iTWSOrdersOnly=1 Available condition types:
825///   * `1` - Price
826///   * `3` - Time
827///   * `4` - Margin
828///   * `5` - Trade
829///   * `6` - Volume
830///   * `7` - MTA Market
831///   * `8` - MTA Postion
832///   * `9` - MTA Account Daily PnL
833#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
834pub enum AlertCreationRequestConditionType {
835    #[serde(rename = "1")]
836    #[default]
837    Value1,
838    #[serde(rename = "3")]
839    Value3,
840    #[serde(rename = "4")]
841    Value4,
842    #[serde(rename = "5")]
843    Value5,
844    #[serde(rename = "6")]
845    Value6,
846    #[serde(rename = "7")]
847    Value7,
848    #[serde(rename = "8")]
849    Value8,
850    #[serde(rename = "9")]
851    Value9,
852}
853impl core::fmt::Display for AlertCreationRequestConditionType {
854    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
855        match self {
856            Self::Value1 => write!(f, "1"),
857            Self::Value3 => write!(f, "3"),
858            Self::Value4 => write!(f, "4"),
859            Self::Value5 => write!(f, "5"),
860            Self::Value6 => write!(f, "6"),
861            Self::Value7 => write!(f, "7"),
862            Self::Value8 => write!(f, "8"),
863            Self::Value9 => write!(f, "9"),
864        }
865    }
866}
867/// Time in Force duration of alert.
868#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
869pub enum AlertCreationRequestTif {
870    #[serde(rename = "GTC")]
871    #[default]
872    Gtc,
873    #[serde(rename = "GTD")]
874    Gtd,
875}
876impl core::fmt::Display for AlertCreationRequestTif {
877    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
878        match self {
879            Self::Gtc => write!(f, "GTC"),
880            Self::Gtd => write!(f, "GTD"),
881        }
882    }
883}
884#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
885pub struct AlertCreationResponse {
886    /// The tracking number of the alert. Alert identifier internally referenced as order id.
887    pub order_id: Option<i32>,
888    /// Not applicable
889    pub order_status: Option<String>,
890    /// Not applicable
891    pub request_id: Option<i32>,
892    /// Displays result status of alert request
893    pub success: Option<bool>,
894    /// Response message to clarify submission status.
895    pub text: Option<String>,
896    /// Returns 'null'
897    pub warning_message: Option<String>,
898}
899#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
900pub struct AlertDeletionResponse {
901    /// If "success" returns false, will list failed order Ids
902    pub failure_list: Option<String>,
903    /// The tracking number of the alert. Occasssionally referenced as the alertId or alert_id.
904    pub order_id: Option<i32>,
905    /// Not applicable
906    pub request_id: Option<i32>,
907    /// Displays result status of alert request
908    pub success: Option<bool>,
909    /// Response message to clarify success status reason.
910    pub text: Option<String>,
911}
912/// details of the specified alert
913#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
914pub struct AlertDetails {
915    /// Requestor's account ID
916    pub account: Option<String>,
917    /// Human readable name of the alert.
918    #[serde(rename = "alertName")]
919    pub alert_name: Option<String>,
920    /// Returns if the alert is active [1] or disabled [0].
921    pub alert_active: Option<AlertActivationRequestAlertActive>,
922    /// Returns default type set for alerts. Configured in Client Portal.
923    pub alert_default_type: Option<i32>,
924    /// Returns the designated email address for sendMessage functionality.
925    pub alert_email: Option<String>,
926    /// Returns the body content of what your alert will report once triggered
927    pub alert_message: Option<String>,
928    /// Returns currency set for MTA alerts. Only valid for alert type 8 & 9.
929    pub alert_mta_currency: Option<String>,
930    /// Returns current MTA default values.
931    pub alert_mta_defaults: Option<String>,
932    /// Returns whether or not the alert will play audio
933    pub alert_play_audio: Option<i32>,
934    /// Returns if the alert can be sent more than once.
935    pub alert_repeatable: Option<i32>,
936    /// Returns whether or not the alert will send an email.
937    pub alert_send_message: Option<i32>,
938    /// Returns whether or not the alert will trigger TWS Pop-up messages
939    pub alert_show_popup: Option<i32>,
940    /// Returns whether or not the alert was triggered yet.
941    pub alert_triggered: Option<i32>,
942    /// Background color. Not applicable to API.
943    pub bg_color: Option<String>,
944    /// Returns whether or not the alert will trigger outside of regular trading hours.
945    pub condition_outside_rth: Option<i32>,
946    /// Returns the total number of conditions in the alert.
947    pub condition_size: Option<i32>,
948    /// Returns all conditions
949    pub conditions: Option<Vec<AlertCondition>>,
950    /// Returns the UTC formatted date used in GTD orders.
951    pub expire_time: Option<String>,
952    /// Foreground color. Not applicable to API.
953    pub fg_color: Option<String>,
954    /// Returns whether or not the alert will trigger mobile notifications.
955    pub itws_orders_only: Option<i32>,
956    /// Alert's tracking ID. Can be used for modifying or deleting alerts.
957    pub order_id: Option<i32>,
958    /// Returns if the order can be edited.
959    pub order_not_editable: Option<bool>,
960    /// represent order statusAlways returns "Presubmitted".
961    pub order_status: Option<AlertDetailsOrderStatus>,
962    /// Time in Force effective for the Alert
963    pub tif: Option<String>,
964    /// Returned for time-specific conditions.
965    pub time_zone: Option<String>,
966    /// Tracking ID for MTA alerts only. Returns 'null' for standard alerts.
967    pub tool_id: Option<i32>,
968}
969/// represent order statusAlways returns "Presubmitted".
970#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
971pub enum AlertDetailsOrderStatus {
972    #[default]
973    Presubmitted,
974    Submitted,
975}
976impl core::fmt::Display for AlertDetailsOrderStatus {
977    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
978        match self {
979            Self::Presubmitted => write!(f, "Presubmitted"),
980            Self::Submitted => write!(f, "Submitted"),
981        }
982    }
983}
984pub type Alerts = Vec<Alert>;
985#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
986pub struct AlgoParam {
987    /// Default parameter value. Type defined in valueClassName field
988    #[serde(rename = "defaultValue")]
989    pub default_value: Option<AlgoParamDefaultValue>,
990    pub description: Option<String>,
991    /// Positional ranking for the algo. Used for Client Portal.
992    #[serde(rename = "guiRank")]
993    pub gui_rank: Option<i32>,
994    /// Parameter identifier for the algo.
995    pub id: Option<String>,
996    /// Allowed values for the parameter.
997    #[serde(rename = "legalStrings")]
998    pub legal_strings: Option<Vec<String>>,
999    #[serde(rename = "maxValue")]
1000    pub max_value: Option<i32>,
1001    #[serde(rename = "minValue")]
1002    pub min_value: Option<f64>,
1003    /// Parameter name.
1004    pub name: Option<String>,
1005    /// States whether the parameter is required for the given algo order to place.
1006    pub required: Option<bool>,
1007    /// Returns the variable type of the parameter.
1008    #[serde(rename = "valueClassName")]
1009    pub value_class_name: Option<AlgoParamValueClassName>,
1010}
1011/// Default parameter value. Type defined in valueClassName field
1012#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1013#[serde(untagged)]
1014pub enum AlgoParamDefaultValue {
1015    #[default]
1016    String(String),
1017    Integer(i32),
1018    Boolean(bool),
1019    Number(f64),
1020}
1021/// Returns the variable type of the parameter.
1022#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
1023pub enum AlgoParamValueClassName {
1024    #[default]
1025    String,
1026    Boolean,
1027    Time,
1028    Double,
1029    Integer,
1030}
1031impl core::fmt::Display for AlgoParamValueClassName {
1032    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1033        match self {
1034            Self::String => write!(f, "String"),
1035            Self::Boolean => write!(f, "Boolean"),
1036            Self::Time => write!(f, "Time"),
1037            Self::Double => write!(f, "Double"),
1038            Self::Integer => write!(f, "Integer"),
1039        }
1040    }
1041}
1042/// available algos
1043#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1044pub struct AlgosResponse {
1045    /// Contains all relevant algos for the contract.
1046    pub algos: Option<Vec<AlgosResponseAlgo>>,
1047}
1048#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1049pub struct AlgosResponseAlgo {
1050    /// Algo identifier used for requests.
1051    pub id: String,
1052    /// Common name of the algo
1053    pub name: String,
1054    pub parameters: Option<Vec<AlgoParam>>,
1055}
1056#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1057#[serde(default)]
1058pub struct AllocationGroup {
1059    /// Contains a series of objects depicting which accounts are involved and, for user-defined allocation methods, the distribution value for each sub-account.
1060    pub accounts: Option<Vec<AllocationGroupAccount>>,
1061    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
1062    ///   * `A` - Available Equity
1063    ///   * `E` - Equal
1064    ///   * `N` - Net Liquidation Value
1065    ///
1066    /// User-specified allocation methods:
1067    ///   * `C` - Cash Quantity
1068    ///   * `P` - Percentage
1069    ///   * `R` - Ratios
1070    ///   * `S` - Shares
1071    #[default(Some(Default::default()))]
1072    pub default_method: Option<AllocationMethod>,
1073    /// Name used to refer to your allocation group. This will be used while placing orders.
1074    pub name: Option<String>,
1075}
1076#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1077pub struct AllocationGroupAccount {
1078    /// The total distribution value for each sub-account for user-defined allocation methods.
1079    pub amount: Option<f64>,
1080    /// The accountId of a given sub-account.
1081    pub name: Option<String>,
1082}
1083#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1084pub struct AllocationGroups {
1085    /// array, which contains all allocation groups under the advisor account
1086    pub data: Option<Vec<AllocationGroupsDatum>>,
1087}
1088#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1089#[serde(default)]
1090pub struct AllocationGroupsDatum {
1091    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
1092    ///   * `A` - Available Equity
1093    ///   * `E` - Equal
1094    ///   * `N` - Net Liquidation Value
1095    ///
1096    /// User-specified allocation methods:
1097    ///   * `C` - Cash Quantity
1098    ///   * `P` - Percentage
1099    ///   * `R` - Ratios
1100    ///   * `S` - Shares
1101    #[default(Some(Default::default()))]
1102    pub allocation_method: Option<AllocationMethod>,
1103    /// The name set for the given allocation group.
1104    pub name: Option<String>,
1105    /// Represents the total number of sub-accounts within the group.
1106    pub size: Option<i32>,
1107}
1108/// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
1109///   * `A` - Available Equity
1110///   * `E` - Equal
1111///   * `N` - Net Liquidation Value
1112///
1113/// User-specified allocation methods:
1114///   * `C` - Cash Quantity
1115///   * `P` - Percentage
1116///   * `R` - Ratios
1117///   * `S` - Shares
1118#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
1119pub enum AllocationMethod {
1120    #[default]
1121    A,
1122    E,
1123    N,
1124    C,
1125    P,
1126    R,
1127    S,
1128}
1129impl core::fmt::Display for AllocationMethod {
1130    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1131        match self {
1132            Self::A => write!(f, "A"),
1133            Self::E => write!(f, "E"),
1134            Self::N => write!(f, "N"),
1135            Self::C => write!(f, "C"),
1136            Self::P => write!(f, "P"),
1137            Self::R => write!(f, "R"),
1138            Self::S => write!(f, "S"),
1139        }
1140    }
1141}
1142#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1143pub struct AmRequestStatusResponse {
1144    #[serde(rename = "acctId")]
1145    pub acct_id: Option<String>,
1146    pub message: Option<String>,
1147    #[serde(rename = "requestId")]
1148    pub request_id: Option<String>,
1149    #[serde(rename = "requestType")]
1150    pub request_type: Option<String>,
1151    pub status: Option<String>,
1152}
1153#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1154pub struct AnswerResponse {
1155    pub answer: Option<String>,
1156    #[serde(rename = "answerId")]
1157    pub answer_id: Option<i64>,
1158    #[serde(rename = "dependentAnswerId")]
1159    pub dependent_answer_id: Option<i64>,
1160    #[serde(rename = "dependentQuestionId")]
1161    pub dependent_question_id: Option<i64>,
1162    #[serde(rename = "multiAnswerDetail")]
1163    pub multi_answer_detail: Option<Vec<String>>,
1164}
1165/// Applies verified CSV changes. Requires both Bearer token (header) and signed JWT (body). CSV must be verified via /csv/v2/verify first. JWT validity: 1 minute.<br><br>**Scope**: `restrictions.write`<br>**Security Policy**: `Signed JWT`
1166#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
1167pub struct ApplyCsvRequest {
1168    #[validate(nested)]
1169    pub header: ApplyCsvRequestHeader,
1170    /// Signed JWT token (format: header.payload.signature). Generate using: oauth2_cli sign -C userName={user} -C requestId={id} -C payload={csv} -C iss={user} -k {key}
1171    pub body: RestrictionRequestBody,
1172}
1173impl ApplyCsvRequest {
1174    /// Parse the HTTP response into the response enum.
1175    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ApplyCsvResponse> {
1176        let status = req.status();
1177        if status == http::StatusCode::OK {
1178            let data =
1179                oas3_gen_support::Diagnostics::<CSVResponse>::json_with_diagnostics(req).await?;
1180            return Ok(ApplyCsvResponse::Ok(data));
1181        }
1182        if status == http::StatusCode::BAD_REQUEST {
1183            let _ = req.bytes().await?;
1184            return Ok(ApplyCsvResponse::BadRequest);
1185        }
1186        if status == http::StatusCode::UNAUTHORIZED {
1187            let _ = req.bytes().await?;
1188            return Ok(ApplyCsvResponse::Unauthorized);
1189        }
1190        if status == http::StatusCode::FORBIDDEN {
1191            let _ = req.bytes().await?;
1192            return Ok(ApplyCsvResponse::Forbidden);
1193        }
1194        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
1195            let _ = req.bytes().await?;
1196            return Ok(ApplyCsvResponse::InternalServerError);
1197        }
1198        let _ = req.bytes().await?;
1199        return Ok(ApplyCsvResponse::Unknown);
1200    }
1201}
1202#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
1203pub struct ApplyCsvRequestHeader {
1204    /// OAuth 2.0 Bearer token. Format: Bearer {access_token}. Token contains accountId claim. Validity: ~50 minutes.
1205    /// - Example: `"Bearer eyJ0eXAiOiJhdCtKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjFkOTEx...".to_string()`
1206    #[validate(length(min = 1u64))]
1207    pub authorization: String,
1208}
1209impl core::convert::TryFrom<&ApplyCsvRequestHeader> for http::HeaderMap {
1210    type Error = http::header::InvalidHeaderValue;
1211    fn try_from(headers: &ApplyCsvRequestHeader) -> core::result::Result<Self, Self::Error> {
1212        let mut map = http::HeaderMap::with_capacity(1usize);
1213        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
1214        map.insert(AUTHORIZATION, header_value);
1215        Ok(map)
1216    }
1217}
1218impl core::convert::TryFrom<ApplyCsvRequestHeader> for http::HeaderMap {
1219    type Error = http::header::InvalidHeaderValue;
1220    fn try_from(headers: ApplyCsvRequestHeader) -> core::result::Result<Self, Self::Error> {
1221        http::HeaderMap::try_from(&headers)
1222    }
1223}
1224/// Response types for applyCSV
1225#[derive(Debug, Clone)]
1226pub enum ApplyCsvResponse {
1227    ///200: CSV application result
1228    Ok(CSVResponse),
1229    ///400: Invalid input format or missing required fields
1230    BadRequest,
1231    ///401: Invalid or expired access token
1232    Unauthorized,
1233    ///403: Insufficient permissions or JWT validation failed
1234    Forbidden,
1235    ///500: Internal server error
1236    InternalServerError,
1237    ///default: Unknown response
1238    Unknown,
1239}
1240pub type ArrayNode = serde_json::Value;
1241#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1242pub struct AssociatedEntity {
1243    #[serde(rename = "AssociatedPersons")]
1244    pub associated_persons: Option<Vec<AssociatedPerson>>,
1245    pub associations: Option<Vec<String>>,
1246    pub email: Option<String>,
1247    #[serde(rename = "entityId")]
1248    pub entity_id: Option<i32>,
1249    #[serde(rename = "externalCode")]
1250    pub external_code: Option<String>,
1251    #[serde(rename = "identityDocuments")]
1252    pub identity_documents: Option<Vec<std::collections::HashMap<String, String>>>,
1253    pub mailing: Option<std::collections::HashMap<String, String>>,
1254    pub name: Option<String>,
1255    #[serde(rename = "organizationCountry")]
1256    pub organization_country: Option<String>,
1257    pub phones: Option<std::collections::HashMap<String, String>>,
1258    pub residence: Option<std::collections::HashMap<String, String>>,
1259    #[serde(rename = "taxTreatyDetails")]
1260    pub tax_treaty_details: Option<Vec<std::collections::HashMap<String, String>>>,
1261}
1262#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1263pub struct AssociatedPerson {
1264    pub associations: Option<Vec<String>>,
1265    pub commercial: Option<String>,
1266    #[serde(rename = "countryOfBirth")]
1267    pub country_of_birth: Option<String>,
1268    #[serde(rename = "countryOfCitizenship")]
1269    pub country_of_citizenship: Option<String>,
1270    #[serde(rename = "countryOfLegalResidence")]
1271    pub country_of_legal_residence: Option<String>,
1272    #[serde(rename = "dateOfBirth")]
1273    pub date_of_birth: Option<String>,
1274    pub email: Option<String>,
1275    #[serde(rename = "employmentDetails")]
1276    pub employment_details: Option<std::collections::HashMap<String, serde_json::Value>>,
1277    #[serde(rename = "employmentType")]
1278    pub employment_type: Option<String>,
1279    #[serde(rename = "entityId")]
1280    pub entity_id: Option<i32>,
1281    #[serde(rename = "externalCode")]
1282    pub external_code: Option<String>,
1283    #[serde(rename = "firstName")]
1284    pub first_name: Option<String>,
1285    pub gender: Option<String>,
1286    #[serde(rename = "identityDocuments")]
1287    pub identity_documents: Option<Vec<std::collections::HashMap<String, String>>>,
1288    #[serde(rename = "lastLogin")]
1289    pub last_login: Option<String>,
1290    #[serde(rename = "lastName")]
1291    pub last_name: Option<String>,
1292    pub mailing: Option<std::collections::HashMap<String, String>>,
1293    #[serde(rename = "maritalStatus")]
1294    pub marital_status: Option<String>,
1295    #[serde(rename = "mdSubscriberStatus")]
1296    pub md_subscriber_status: Option<String>,
1297    #[serde(rename = "middleInitial")]
1298    pub middle_initial: Option<String>,
1299    #[serde(rename = "middleName")]
1300    pub middle_name: Option<String>,
1301    #[serde(rename = "motersMaidenName")]
1302    pub moters_maiden_name: Option<String>,
1303    #[serde(rename = "numberOfDependents")]
1304    pub number_of_dependents: Option<i32>,
1305    #[serde(rename = "passwordDate")]
1306    pub password_date: Option<String>,
1307    pub phones: Option<std::collections::HashMap<String, String>>,
1308    pub residence: Option<std::collections::HashMap<String, String>>,
1309    pub salutation: Option<String>,
1310    #[serde(rename = "securityDevice")]
1311    pub security_device: Option<String>,
1312    #[serde(rename = "stateOfLegalResidence")]
1313    pub state_of_legal_residence: Option<String>,
1314    #[serde(rename = "subscribedServices")]
1315    pub subscribed_services: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
1316    pub suffix: Option<String>,
1317    #[serde(rename = "taxTreatyDetails")]
1318    pub tax_treaty_details: Option<Vec<std::collections::HashMap<String, String>>>,
1319    #[serde(rename = "userStatus")]
1320    pub user_status: Option<String>,
1321    #[serde(rename = "userStatusTrading")]
1322    pub user_status_trading: Option<String>,
1323    pub username: Option<String>,
1324}
1325#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1326pub struct AsynchronousInstructionResponse {
1327    #[serde(rename = "instructionResult")]
1328    pub instruction_result: Option<InstructionResult>,
1329    /// - Example: `-1988905739.0`
1330    #[serde(rename = "instructionSetId")]
1331    pub instruction_set_id: f64,
1332    /// - Example: `202.0`
1333    pub status: f64,
1334}
1335#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1336pub struct AsynchronousInstructionSetResponse {
1337    #[serde(rename = "instructionResults")]
1338    pub instruction_results: Option<Vec<AsynchronousInstructionSetResponseInstructionResult>>,
1339    /// - Example: `-1988905739.0`
1340    #[serde(rename = "instructionSetId")]
1341    pub instruction_set_id: f64,
1342    /// - Example: `202i32`
1343    pub status: i32,
1344}
1345#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1346pub struct AsynchronousInstructionSetResponseInstructionResult {
1347    #[serde(rename = "instructionResult")]
1348    pub instruction_result: InstructionResult,
1349    /// - Example: `9094.0`
1350    #[serde(rename = "instructionSetId")]
1351    pub instruction_set_id: f64,
1352    /// - Example: `202i32`
1353    pub status: i32,
1354}
1355#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1356pub struct Au10TixDetailResponse {
1357    #[serde(rename = "entityId")]
1358    pub entity_id: Option<i32>,
1359    pub error: Option<Box<ErrorResponse>>,
1360    #[serde(rename = "errorDescription")]
1361    pub error_description: Option<String>,
1362    #[serde(rename = "expiryDate")]
1363    pub expiry_date: Option<chrono::DateTime<chrono::Utc>>,
1364    #[serde(rename = "externalId")]
1365    pub external_id: Option<String>,
1366    #[serde(rename = "hasError")]
1367    pub has_error: Option<bool>,
1368    #[serde(rename = "startDate")]
1369    pub start_date: Option<chrono::DateTime<chrono::Utc>>,
1370    pub state: Option<String>,
1371    pub url: Option<String>,
1372}
1373/// Contains a combined overview of Commidity, Security and Crypto fund values.
1374#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1375pub struct AvailableFundsResponse {
1376    /// Contains commodities specific fund values.
1377    #[serde(rename = "Crypto at Paxos")]
1378    pub crypto_at_paxos: Option<Funds>,
1379    /// Contains commodities specific fund values.
1380    pub commodities: Option<Funds>,
1381    /// Contains an overview of Security specific fund values.
1382    pub securities: Option<AvailableFundsResponseSecurities>,
1383    /// total values
1384    pub total: Option<AvailableFundsResponseTotal>,
1385}
1386/// Contains an overview of Security specific fund values.
1387#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1388pub struct AvailableFundsResponseSecurities {
1389    /// This value reflects your available funds at the next margin change.
1390    #[serde(rename = "Lk Ahd Avlbl Fnds")]
1391    pub lk_ahd_avlbl_fnds: Option<String>,
1392    /// * `Securities` - Equity with loan value. Look ahead maintenance margin.
1393    ///  * `Commodities` - Net Liquidation value. Look ahead maintenance margin.
1394    #[serde(rename = "Lk Ahd Excss Lqdty")]
1395    pub lk_ahd_excss_lqdty: Option<String>,
1396    /// Displays predicted post-expiration account value.
1397    #[serde(rename = "Prdctd Pst-xpry Excss")]
1398    pub prdctd_pst_xpry_excss: Option<String>,
1399    #[serde(rename = "SMA")]
1400    pub sma: Option<String>,
1401    /// Describes currently avialable funds in your account for trading.
1402    pub current_available: Option<String>,
1403    /// Describes total value of the account.
1404    pub current_excess: Option<String>,
1405    /// Describes the total combined leverage.
1406    pub leverage: Option<String>,
1407    /// Describes available funds for overnight trading.
1408    pub overnight_available: Option<String>,
1409    /// Overnight refers to the window of time after the local market trading day is closed.
1410    ///   * `Securities` - Equivalent to regular trading hours.
1411    ///    * `Commodities` - Commodities Net Liquidation value. Overnight Maintenance margin.
1412    pub overnight_excess: Option<String>,
1413}
1414/// total values
1415#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1416pub struct AvailableFundsResponseTotal {
1417    /// This value reflects your available funds at the next margin change.
1418    #[serde(rename = "Lk Ahd Avlbl Fnds")]
1419    pub lk_ahd_avlbl_fnds: Option<String>,
1420    /// * `Securities` - Equity with loan value. Look ahead maintenance margin.
1421    ///  * `Commodities` - Net Liquidation value. Look ahead maintenance margin.
1422    #[serde(rename = "Lk Ahd Excss Lqdty")]
1423    pub lk_ahd_excss_lqdty: Option<String>,
1424    /// Describes when the next 'Look Ahead' calculation will take place.
1425    #[serde(rename = "Lk Ahd Nxt Chng")]
1426    pub lk_ahd_nxt_chng: Option<String>,
1427    /// Displays predicted post-expiration account value.
1428    #[serde(rename = "Prdctd Pst-xpry Excss")]
1429    pub prdctd_pst_xpry_excss: Option<String>,
1430    /// Describes the total buying power of the account including existing balance with margin.
1431    pub buying_power: Option<String>,
1432    /// Describes currently avialable funds in your account for trading.
1433    pub current_available: Option<String>,
1434    /// Describes total value of the account.
1435    pub current_excess: Option<String>,
1436    /// Describes the number of trades remaining before flagging the Pattern Day Trader status. "Unlimited" is used for existing Pattern Day Traders.
1437    pub day_trades_left: Option<String>,
1438    /// Describes the total combined leverage.
1439    pub leverage: Option<String>,
1440    /// Describes available funds for overnight trading.
1441    pub overnight_available: Option<String>,
1442    /// Overnight refers to the window of time after the local market trading day is closed.
1443    ///   * `Securities` - Equivalent to regular trading hours.
1444    ///    * `Commodities` - Commodities Net Liquidation value. Overnight Maintenance margin.
1445    pub overnight_excess: Option<String>,
1446}
1447#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1448pub struct AvailableStatementDatesData {
1449    /// - Example: `Some("String".to_string())`
1450    #[serde(rename = "dataType")]
1451    pub data_type: Option<String>,
1452    pub value: Option<AvailableStatementDatesDataValue>,
1453}
1454#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1455pub struct AvailableStatementDatesDataValue {
1456    /// annual available reports
1457    pub annual: Option<Vec<String>>,
1458    pub daily: Option<AvailableStatementDatesDataValueDaily>,
1459    /// monthly available reports
1460    pub monthly: Option<Vec<String>>,
1461}
1462#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1463pub struct AvailableStatementDatesDataValueDaily {
1464    /// daily report end date
1465    #[serde(rename = "endDate")]
1466    pub end_date: Option<String>,
1467    /// daily report start date
1468    #[serde(rename = "startDate")]
1469    pub start_date: Option<String>,
1470}
1471#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1472pub struct AvailableTaxFormsData {
1473    /// - Example: `Some("String".to_string())`
1474    #[serde(rename = "dataType")]
1475    pub data_type: Option<String>,
1476    pub value: Option<AvailableTaxFormsDataValue>,
1477}
1478#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1479pub struct AvailableTaxFormsDataValue {
1480    /// available tax forms
1481    pub forms: Option<Vec<TaxFormType>>,
1482}
1483#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1484pub struct BNResponse {
1485    /// Returns the number of unread notifications.
1486    #[serde(rename = "BN")]
1487    pub bn: Option<i32>,
1488}
1489#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
1490pub enum BankInstructionMethod {
1491    #[serde(rename = "ACH")]
1492    #[default]
1493    Ach,
1494    #[serde(rename = "WIRE")]
1495    Wire,
1496    #[serde(rename = "USACH")]
1497    Usach,
1498    #[serde(rename = "CAACH")]
1499    Caach,
1500    #[serde(rename = "SEPA")]
1501    Sepa,
1502    #[serde(rename = "eDDA")]
1503    EDDA,
1504    #[serde(rename = "eGIRO")]
1505    EGIRO,
1506    #[serde(rename = "OPEN_BANKING")]
1507    OpenBanking,
1508}
1509impl core::fmt::Display for BankInstructionMethod {
1510    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1511        match self {
1512            Self::Ach => write!(f, "ACH"),
1513            Self::Wire => write!(f, "WIRE"),
1514            Self::Usach => write!(f, "USACH"),
1515            Self::Caach => write!(f, "CAACH"),
1516            Self::Sepa => write!(f, "SEPA"),
1517            Self::EDDA => write!(f, "eDDA"),
1518            Self::EGIRO => write!(f, "eGIRO"),
1519            Self::OpenBanking => write!(f, "OPEN_BANKING"),
1520        }
1521    }
1522}
1523#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
1524pub struct BankInstructionsBulkRequestBody {
1525    #[serde(rename = "instructionType")]
1526    pub instruction_type: InstructionRequestBodyInstructionType,
1527    pub instructions: Vec<serde_json::Value>,
1528}
1529#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1530pub struct BondFiltersResponse {
1531    /// Contains all filters pertaining to the given issuerId
1532    #[serde(rename = "bondFilters")]
1533    pub bond_filters: Option<Vec<BondFiltersResponseFilter>>,
1534}
1535#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1536pub struct BondFiltersResponseFilter {
1537    /// Used for user interfaces. Internal use only.
1538    #[serde(rename = "columnId")]
1539    pub column_id: Option<i32>,
1540    /// An identifier used to document returned options/values. This can be thought of as a key value.
1541    #[serde(rename = "displayText")]
1542    pub display_text: Option<BondFiltersResponseFilterDisplayText>,
1543    /// Contains all objects with values corresponding to the parent displayText key.
1544    pub options: Option<Vec<BondFiltersResponseFilterOption>>,
1545}
1546/// An identifier used to document returned options/values. This can be thought of as a key value.
1547#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
1548pub enum BondFiltersResponseFilterDisplayText {
1549    #[serde(rename = "Maturity Date")]
1550    #[default]
1551    MaturityDate,
1552    #[serde(rename = "Issue Date")]
1553    IssueDate,
1554    Coupon,
1555    Currency,
1556}
1557impl core::fmt::Display for BondFiltersResponseFilterDisplayText {
1558    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1559        match self {
1560            Self::MaturityDate => write!(f, "Maturity Date"),
1561            Self::IssueDate => write!(f, "Issue Date"),
1562            Self::Coupon => write!(f, "Coupon"),
1563            Self::Currency => write!(f, "Currency"),
1564        }
1565    }
1566}
1567#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1568pub struct BondFiltersResponseFilterOption {
1569    /// In some instances, a text value will be returned, which indicates the standardized value format such as plaintext dates, rather than solely numerical values.
1570    pub text: Option<String>,
1571    /// Returns value directly correlating to the displayText key. This may include exchange, maturity date, issue date, coupon, or currency.
1572    pub value: String,
1573}
1574#[serde_with::skip_serializing_none]
1575#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
1576pub struct BrokerageSessionInitRequest {
1577    /// Determines if other brokerage sessions should be disconnected to prioritize this connection.
1578    pub compete: Option<bool>,
1579    /// publish brokerage session token at the same time when brokerage session initialized. If set false, then session token should be published before calling init. Setting true is preferred way.
1580    pub publish: Option<bool>,
1581}
1582#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1583pub struct BrokerageSessionStatus {
1584    /// Device MAC information.
1585    #[serde(rename = "MAC")]
1586    pub mac: Option<String>,
1587    /// Returns whether your brokerage session is authenticated or not.
1588    pub authenticated: Option<bool>,
1589    /// Returns whether you have a competing brokerage session in another connection.
1590    pub competing: Option<bool>,
1591    /// Returns whether you are connected to the gateway or not.
1592    pub connected: Option<bool>,
1593    /// Returns whether your brokerage session is fully established and ready to handle requests. Set to true when the login message is received from underlying brokerage infrastructure, indicating authentication is complete and account information is loaded.
1594    pub established: Option<bool>,
1595    /// Returns the reason for failing to retrieve authentication status.
1596    pub fail: Option<String>,
1597    /// Client Portal use only.
1598    pub hardware_info: Option<String>,
1599    /// A message about your authenticate status if any.
1600    pub message: Option<String>,
1601    #[serde(rename = "serverInfo")]
1602    pub server_info: Option<BrokerageSessionStatusServerInfo>,
1603}
1604#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1605pub struct BrokerageSessionStatusServerInfo {
1606    /// IBKR server information. Internal use only.
1607    #[serde(rename = "serverName")]
1608    pub server_name: Option<String>,
1609    /// IBKR version information. Internal use only.
1610    #[serde(rename = "serverVersion")]
1611    pub server_version: Option<String>,
1612}
1613#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1614pub struct BulkMultiStatusResponse {
1615    #[serde(rename = "instructionResults")]
1616    pub instruction_results: Option<Vec<serde_json::Value>>,
1617    /// - Example: `-1988905739.0`
1618    #[serde(rename = "instructionSetId")]
1619    pub instruction_set_id: f64,
1620    /// - Example: `207i32`
1621    pub status: i32,
1622}
1623#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1624pub struct CSVResponse {
1625    /// Result message: 'OK' or error description
1626    /// - Example: `"OK".to_string()`
1627    pub message: String,
1628    /// Request ID echo
1629    /// - Example: `127i32`
1630    #[serde(rename = "requestId")]
1631    pub request_id: i32,
1632    /// Operation success status
1633    pub success: bool,
1634}
1635#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
1636#[serde(default)]
1637pub struct CancelBulkRequestBody {
1638    #[serde(rename = "instructionType")]
1639    #[default("CANCEL_INSTRUCTION".to_string())]
1640    pub instruction_type: String,
1641    pub instructions: Vec<serde_json::Value>,
1642}
1643#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
1644pub struct CancelInstruction {
1645    /// - Example: `1012983.0`
1646    #[serde(rename = "clientInstructionId")]
1647    pub client_instruction_id: f64,
1648    /// - Example: `43085477.0`
1649    #[serde(rename = "instructionId")]
1650    pub instruction_id: f64,
1651    /// - Example: `"Testing".to_string()`
1652    #[validate(length(min = 1u64, max = 256u64))]
1653    pub reason: String,
1654}
1655/// Cancel an existing, unfilled order.
1656#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
1657pub struct CancelOpenOrderRequest {
1658    #[validate(nested)]
1659    pub path: CancelOpenOrderRequestPath,
1660    pub query: CancelOpenOrderRequestQuery,
1661}
1662impl CancelOpenOrderRequest {
1663    /// Parse the HTTP response into the response enum.
1664    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<CancelOpenOrderResponse> {
1665        let status = req.status();
1666        if status == http::StatusCode::OK {
1667            let data =
1668                oas3_gen_support::Diagnostics::<Order200Response2>::json_with_diagnostics(req)
1669                    .await?;
1670            return Ok(CancelOpenOrderResponse::Ok(data));
1671        }
1672        if status == http::StatusCode::BAD_REQUEST {
1673            let _ = req.bytes().await?;
1674            return Ok(CancelOpenOrderResponse::BadRequest);
1675        }
1676        if status == http::StatusCode::UNAUTHORIZED {
1677            let _ = req.bytes().await?;
1678            return Ok(CancelOpenOrderResponse::Unauthorized);
1679        }
1680        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
1681            let _ = req.bytes().await?;
1682            return Ok(CancelOpenOrderResponse::InternalServerError);
1683        }
1684        if status == http::StatusCode::SERVICE_UNAVAILABLE {
1685            let _ = req.bytes().await?;
1686            return Ok(CancelOpenOrderResponse::ServiceUnavailable);
1687        }
1688        let _ = req.bytes().await?;
1689        return Ok(CancelOpenOrderResponse::Unknown);
1690    }
1691}
1692#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
1693pub struct CancelOpenOrderRequestPath {
1694    /// The account to which the order will clear.
1695    /// - Example: `"DU123456".to_string()`
1696    #[validate(length(min = 1u64))]
1697    pub account_id: String,
1698    /// The IB-assigned order ID of the desired order ticket.
1699    /// - Example: `"1799796559".to_string()`
1700    #[validate(length(min = 1u64))]
1701    pub order_id: String,
1702}
1703#[serde_with::skip_serializing_none]
1704#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
1705pub struct CancelOpenOrderRequestQuery {
1706    /// ExtOperator is used to identify external operator.
1707    #[serde(rename = "extOperator")]
1708    pub ext_operator: Option<String>,
1709    /// For all orders for US Futures products, clients must submit this flag to indicate whether the order was originated manually (by a natural person) or automatically (by an automated trading system transmitting orders without human intervention). Submit a True value to indicate a manually originated order, and submit a False value to indicate an automated order. Orders for USFUT products that do not include this field will be rejected.
1710    #[serde(rename = "manualIndicator")]
1711    pub manual_indicator: Option<bool>,
1712    /// Time of manual cancel.
1713    /// - Example: `Some(1_799_796_559i32)`
1714    #[serde(rename = "manualCancelTime")]
1715    pub manual_cancel_time: Option<i32>,
1716}
1717/// Response types for cancelOpenOrder
1718#[derive(Debug, Clone)]
1719pub enum CancelOpenOrderResponse {
1720    ///200: Status of submission
1721    Ok(Order200Response2),
1722    ///400: Invalid input format or missing required fields
1723    BadRequest,
1724    ///401: Invalid or expired access token
1725    Unauthorized,
1726    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
1727     */
1728    InternalServerError,
1729    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
1730     */
1731    ServiceUnavailable,
1732    ///default: Unknown response
1733    Unknown,
1734}
1735#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
1736#[serde(default)]
1737pub struct CancelRequestBody {
1738    #[validate(nested)]
1739    pub instruction: CancelInstruction,
1740    #[serde(rename = "instructionType")]
1741    #[default("CANCEL_INSTRUCTION".to_string())]
1742    pub instruction_type: String,
1743}
1744#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1745pub struct CategoryTreeResponse {
1746    /// A JSON object containing all category IDs and their relevant information.
1747    pub categories: Option<CategoryTreeResponseCategories>,
1748}
1749/// A JSON object containing all category IDs and their relevant information.
1750#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1751pub struct CategoryTreeResponseCategories {
1752    /// Category identifier.
1753    #[serde(rename = "categoryId")]
1754    pub category_id: Option<CategoryTreeResponseCategoriesCategoryId>,
1755}
1756/// Category identifier.
1757#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1758pub struct CategoryTreeResponseCategoriesCategoryId {
1759    /// List of affiliated markets (if applicable).
1760    pub markets: Option<Vec<serde_json::Value>>,
1761    /// Category name.
1762    pub name: Option<String>,
1763    /// Identifier of parent category (if applicable).
1764    pub parent_id: Option<String>,
1765}
1766/// Instruct IServer to close all of its open backend data streams for all instruments.
1767#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
1768pub struct CloseAllMdStreamsRequest {}
1769impl CloseAllMdStreamsRequest {
1770    /// Parse the HTTP response into the response enum.
1771    pub async fn parse_response(
1772        req: reqwest::Response,
1773    ) -> anyhow::Result<CloseAllMdStreamsResponse> {
1774        let status = req.status();
1775        if status == http::StatusCode::OK {
1776            let data =
1777                oas3_gen_support::Diagnostics::<UnsubscribedResponse>::json_with_diagnostics(req)
1778                    .await?;
1779            return Ok(CloseAllMdStreamsResponse::Ok(data));
1780        }
1781        if status == http::StatusCode::UNAUTHORIZED {
1782            let _ = req.bytes().await?;
1783            return Ok(CloseAllMdStreamsResponse::Unauthorized);
1784        }
1785        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
1786            let _ = req.bytes().await?;
1787            return Ok(CloseAllMdStreamsResponse::InternalServerError);
1788        }
1789        if status == http::StatusCode::SERVICE_UNAVAILABLE {
1790            let _ = req.bytes().await?;
1791            return Ok(CloseAllMdStreamsResponse::ServiceUnavailable);
1792        }
1793        let _ = req.bytes().await?;
1794        return Ok(CloseAllMdStreamsResponse::Unknown);
1795    }
1796}
1797/// Response types for closeAllMdStreams
1798#[derive(Debug, Clone)]
1799pub enum CloseAllMdStreamsResponse {
1800    ///200: Indicates a successful request to unsubscribe all streams.
1801    Ok(UnsubscribedResponse),
1802    ///401: Invalid or expired access token
1803    Unauthorized,
1804    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
1805     */
1806    InternalServerError,
1807    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
1808     */
1809    ServiceUnavailable,
1810    ///default: Unknown response
1811    Unknown,
1812}
1813/// Instruct IServer to close its backend stream for the instrument when real-time snapshots are no longer needed.
1814#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
1815pub struct CloseMdStreamRequest {
1816    pub body: ConidRequestBody,
1817}
1818impl CloseMdStreamRequest {
1819    /// Parse the HTTP response into the response enum.
1820    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<CloseMdStreamResponse> {
1821        let status = req.status();
1822        if status == http::StatusCode::OK {
1823            let data =
1824                oas3_gen_support::Diagnostics::<SuccessResponse3>::json_with_diagnostics(req)
1825                    .await?;
1826            return Ok(CloseMdStreamResponse::Ok(data));
1827        }
1828        if status == http::StatusCode::BAD_REQUEST {
1829            let _ = req.bytes().await?;
1830            return Ok(CloseMdStreamResponse::BadRequest);
1831        }
1832        if status == http::StatusCode::UNAUTHORIZED {
1833            let _ = req.bytes().await?;
1834            return Ok(CloseMdStreamResponse::Unauthorized);
1835        }
1836        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
1837            let _ = req.bytes().await?;
1838            return Ok(CloseMdStreamResponse::InternalServerError);
1839        }
1840        if status == http::StatusCode::SERVICE_UNAVAILABLE {
1841            let _ = req.bytes().await?;
1842            return Ok(CloseMdStreamResponse::ServiceUnavailable);
1843        }
1844        let _ = req.bytes().await?;
1845        return Ok(CloseMdStreamResponse::Unknown);
1846    }
1847}
1848/// Response types for closeMdStream
1849#[derive(Debug, Clone)]
1850pub enum CloseMdStreamResponse {
1851    ///200: Acknowledges a successful request
1852    Ok(SuccessResponse3),
1853    ///400: Invalid input format or missing required fields
1854    BadRequest,
1855    ///401: Invalid or expired access token
1856    Unauthorized,
1857    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
1858     */
1859    InternalServerError,
1860    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
1861     */
1862    ServiceUnavailable,
1863    ///default: Unknown response
1864    Unknown,
1865}
1866/// Array of objects each containing a single combo position.
1867pub type ComboPositionResponse = Vec<ComboPositionResponseComboPositionResponse>;
1868#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1869pub struct ComboPositionResponseComboPositionResponse {
1870    /// The ratio and conids included in the position.
1871    pub description: Option<String>,
1872    /// List of the legs that make up a position.
1873    pub legs: Option<Vec<ComboPositionResponseComboPositionResponseLeg>>,
1874    /// Internal identifier of a combination position.
1875    pub name: Option<String>,
1876    /// List of the positions that make up a combination.
1877    pub positions: Option<Vec<IndividualComboPosition>>,
1878}
1879#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
1880pub struct ComboPositionResponseComboPositionResponseLeg {
1881    /// Contract identifier of the given leg.
1882    pub conid: Option<String>,
1883    /// Ratio of the leg compared to the quantity.
1884    pub ratio: Option<i32>,
1885}
1886#[serde_with::skip_serializing_none]
1887#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
1888pub struct ComplexAssetTransferInstruction {
1889    /// - Example: `"U46377".to_string()`
1890    #[serde(rename = "accountId")]
1891    #[validate(length(min = 1u64, max = 32u64))]
1892    pub account_id: String,
1893    /// - Example: `Some("7NXXXX0".to_string())`
1894    #[serde(rename = "accountIdAtCurrentBroker")]
1895    #[validate(length(min = 1u64, max = 64u64))]
1896    pub account_id_at_current_broker: Option<String>,
1897    /// - Example: `1012983.0`
1898    #[serde(rename = "clientInstructionId")]
1899    pub client_instruction_id: f64,
1900    #[serde(rename = "contraBrokerInfo")]
1901    #[validate(nested)]
1902    pub contra_broker_info: ContraBrokerInfo,
1903    /// - Example: `"IN"`
1904    pub direction: InstructionDirection,
1905    #[serde(rename = "nonDisclosedDetail")]
1906    #[validate(nested)]
1907    pub non_disclosed_detail: Option<NonDisclosedDetail>,
1908    /// - Example: `1000.0`
1909    pub quantity: f64,
1910    #[serde(rename = "tradingInstrument")]
1911    pub trading_instrument: TradingInstrument,
1912}
1913/// Confirm an order reply message and continue with submission of order ticket.
1914#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
1915pub struct ConfirmOrderReplyRequest {
1916    #[validate(nested)]
1917    pub path: ConfirmOrderReplyRequestPath,
1918    pub body: ConfirmedRequestBody,
1919}
1920impl ConfirmOrderReplyRequest {
1921    /// Parse the HTTP response into the response enum.
1922    pub async fn parse_response(
1923        req: reqwest::Response,
1924    ) -> anyhow::Result<ConfirmOrderReplyResponse> {
1925        let status = req.status();
1926        if status == http::StatusCode::OK {
1927            let data =
1928                oas3_gen_support::Diagnostics::<Reply200Response>::json_with_diagnostics(req)
1929                    .await?;
1930            return Ok(ConfirmOrderReplyResponse::Ok(data));
1931        }
1932        if status == http::StatusCode::UNAUTHORIZED {
1933            let _ = req.bytes().await?;
1934            return Ok(ConfirmOrderReplyResponse::Unauthorized);
1935        }
1936        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
1937            let _ = req.bytes().await?;
1938            return Ok(ConfirmOrderReplyResponse::InternalServerError);
1939        }
1940        if status == http::StatusCode::SERVICE_UNAVAILABLE {
1941            let _ = req.bytes().await?;
1942            return Ok(ConfirmOrderReplyResponse::ServiceUnavailable);
1943        }
1944        let _ = req.bytes().await?;
1945        return Ok(ConfirmOrderReplyResponse::Unknown);
1946    }
1947}
1948#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
1949pub struct ConfirmOrderReplyRequestPath {
1950    /// The UUID of the reply message to be confirmed, obtained from an order submission response. This is delivered from the POST /iserver/account/{accountId}/orders endpoint when triggering certain warning messages.
1951    /// - Example: `"99097238-9824-4830-84ef-46979aa22593".to_string()`
1952    #[validate(length(min = 1u64))]
1953    pub reply_id: String,
1954}
1955/// Response types for confirmOrderReply
1956#[derive(Debug, Clone)]
1957pub enum ConfirmOrderReplyResponse {
1958    ///200: Status of reply
1959    Ok(Reply200Response),
1960    ///401: Invalid or expired access token
1961    Unauthorized,
1962    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
1963     */
1964    InternalServerError,
1965    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
1966     */
1967    ServiceUnavailable,
1968    ///default: Unknown response
1969    Unknown,
1970}
1971#[serde_with::skip_serializing_none]
1972#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
1973pub struct ConfirmedRequestBody {
1974    /// Value of true answers the question in the affirmative and proceeds with order submission.
1975    pub confirmed: Option<bool>,
1976}
1977#[serde_with::skip_serializing_none]
1978#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
1979pub struct ConidRequestBody {
1980    /// The IB contract ID of the instrument whose market data feed is to be unsubscribed.
1981    /// - Example: `Some(265_598i32)`
1982    pub conid: Option<i32>,
1983}
1984#[serde_with::skip_serializing_none]
1985#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
1986pub struct ContraBrokerInfo {
1987    /// - Example: `Some("Equatex U.S. Inc. For the Benefit of the Plan Participants of UBS AG".to_string())`
1988    #[serde(rename = "accountTitle")]
1989    #[validate(length(min = 1u64, max = 128u64))]
1990    pub account_title: Option<String>,
1991    /// - Example: `"ORG".to_string()`
1992    #[serde(rename = "accountType")]
1993    #[validate(length(min = 1u64, max = 32u64))]
1994    pub account_type: String,
1995    /// - Example: `"as3456567678578N".to_string()`
1996    #[serde(rename = "brokerAccountId")]
1997    #[validate(length(min = 1u64, max = 64u64))]
1998    pub broker_account_id: String,
1999    /// - Example: `"JP MORGAN".to_string()`
2000    #[serde(rename = "brokerName")]
2001    #[validate(length(min = 1u64, max = 128u64))]
2002    pub broker_name: String,
2003    /// - Example: `"[email protected]".to_string()`
2004    #[serde(rename = "contactEmail")]
2005    #[validate(length(min = 1u64, max = 64u64))]
2006    pub contact_email: String,
2007    /// - Example: `Some("as".to_string())`
2008    #[serde(rename = "contactName")]
2009    #[validate(length(min = 1u64, max = 64u64))]
2010    pub contact_name: Option<String>,
2011    /// - Example: `"2039126155".to_string()`
2012    #[serde(rename = "contactPhone")]
2013    #[validate(length(min = 1u64, max = 16u64))]
2014    pub contact_phone: String,
2015    /// - Example: `"United States".to_string()`
2016    #[validate(length(min = 1u64, max = 64u64))]
2017    pub country: String,
2018    /// - Example: `"1234".to_string()`
2019    #[serde(rename = "depositoryId")]
2020    #[validate(length(min = 1u64, max = 64u64))]
2021    pub depository_id: String,
2022}
2023#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2024pub struct ContractInfo {
2025    /// Allowed to sell shares you own.
2026    pub allow_sell_long: Option<bool>,
2027    /// Indicates the industry category of the instrument.
2028    pub category: Option<String>,
2029    /// Classification of Financial Instrument codes
2030    pub cfi_code: Option<String>,
2031    pub classifier: Option<String>,
2032    /// Indicates the name of the company or index.
2033    pub company_name: Option<String>,
2034    /// Indicates the contract identifier of the given contract.
2035    pub con_id: Option<i32>,
2036    pub contract_clarification_type: Option<String>,
2037    /// Indicates the year and month the contract expires.
2038    pub contract_month: Option<String>,
2039    /// Base currency contract is traded in.
2040    pub currency: Option<String>,
2041    /// Returns the CUSIP for the given instrument. Only used in BOND trading.
2042    pub cusip: Option<String>,
2043    /// Indicates the primary exchange for which the contract can be traded.
2044    pub exchange: Option<String>,
2045    /// Returns the expiration month of the contract.
2046    pub expiry_full: Option<String>,
2047    /// Specific group of companies or businesses.
2048    pub industry: Option<String>,
2049    /// Asset class of the instrument.
2050    pub instrument_type: Option<String>,
2051    /// Indicates if the contract supports zero commission trading.
2052    pub is_zero_commission_security: Option<bool>,
2053    /// Contract's symbol from primary exchange. For options it is the OCC symbol.
2054    pub local_symbol: Option<String>,
2055    /// Indicates the final maturity date of the given contract.
2056    pub maturity_date: Option<String>,
2057    /// Indicates the multiplier of the contract.
2058    pub multiplier: Option<String>,
2059    /// Indicates if the contract can be traded outside regular trading hours or not.
2060    pub r_t_h: Option<bool>,
2061    /// Indicates if the contract can be smart routed or not.
2062    pub smart_available: Option<bool>,
2063    /// Underlying symbol
2064    pub symbol: Option<String>,
2065    /// Indicates the display name of the contract, as shown with Client Portal.
2066    pub text: Option<String>,
2067    /// Designated trading class of the contract.
2068    pub trading_class: Option<String>,
2069    /// Underlying contract identifier for the requested contract.
2070    pub underlying_con_id: Option<i32>,
2071    /// Indicates the issuer of the underlying.
2072    pub underlying_issuer: Option<String>,
2073    /// Comma separated list of support exchanges or trading venues.
2074    pub valid_exchanges: Option<String>,
2075}
2076/// detailed contract information
2077#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2078pub struct ContractRules {
2079    /// Indicates if the contract can trade algos or not.
2080    #[serde(rename = "algoEligible")]
2081    pub algo_eligible: Option<bool>,
2082    /// indicates all or non option is eligible for given contract.
2083    #[serde(rename = "allOrNoneEligible")]
2084    pub all_or_none_eligible: Option<bool>,
2085    /// Indicates permitted accountIDs that may trade the contract.
2086    #[serde(rename = "canTradeAcctIds")]
2087    pub can_trade_acct_ids: Option<Vec<String>>,
2088    /// Indicates base currency for the instrument.
2089    #[serde(rename = "cashCcy")]
2090    pub cash_ccy: Option<String>,
2091    /// Indicates cash quantity increment rules.
2092    #[serde(rename = "cashQtyIncr")]
2093    pub cash_qty_incr: Option<i32>,
2094    /// Default cash value quantity.
2095    #[serde(rename = "cashSize")]
2096    pub cash_size: Option<f64>,
2097    /// Indicates whether or not a cost report has been requested (Client Portal only).
2098    #[serde(rename = "costReport")]
2099    pub cost_report: Option<bool>,
2100    /// Indicates accepted order types for use with cash quantity.
2101    #[serde(rename = "cqtTypes")]
2102    pub cqt_types: Option<Vec<ContractRulesCqtType>>,
2103    /// Default total quantity value for orders.
2104    #[serde(rename = "defaultSize")]
2105    pub default_size: Option<i32>,
2106    /// Standard display increment rule for the instrument.
2107    #[serde(rename = "displaySize")]
2108    pub display_size: Option<i32>,
2109    /// If rules information can not be received for any reason, it will be expressed here.
2110    pub error: Option<String>,
2111    /// Indicates if the order preview is forced upon the user before submission.
2112    #[serde(rename = "forceOrderPreview")]
2113    pub force_order_preview: Option<bool>,
2114    /// Indicates decimal places for fractional order size.
2115    #[serde(rename = "fraqInt")]
2116    pub fraq_int: Option<i32>,
2117    /// Indicates permitted order types for use with fractional trading.
2118    #[serde(rename = "fraqTypes")]
2119    pub fraq_types: Option<Vec<ContractRulesCqtType>>,
2120    #[serde(rename = "hasSecondary")]
2121    pub has_secondary: Option<bool>,
2122    /// Indicates permitted algo types for use with the given contract.
2123    #[serde(rename = "ibAlgoTypes")]
2124    pub ib_algo_types: Option<Vec<ContractRulesIbAlgoType>>,
2125    /// Minimum increment values for prices
2126    pub increment: Option<f64>,
2127    /// Number of decimal places to indicate the increment value.
2128    #[serde(rename = "incrementDigits")]
2129    pub increment_digits: Option<i32>,
2130    /// Indicates increment rule values including lowerEdge and increment value.
2131    #[serde(rename = "incrementRules")]
2132    pub increment_rules: Option<Vec<ContractRulesIncrementRule>>,
2133    /// Indicates the type of increment style.
2134    #[serde(rename = "incrementType")]
2135    pub increment_type: Option<i32>,
2136    /// Default limit price for the given contract.
2137    #[serde(rename = "limitPrice")]
2138    pub limit_price: Option<f64>,
2139    /// Lists the available order types supported when modifying the order.
2140    #[serde(rename = "modTypes")]
2141    pub mod_types: Option<Vec<serde_json::Value>>,
2142    /// Indicates if the value of the contract can be negative (true) or if it is always positive (false).
2143    #[serde(rename = "negativeCapable")]
2144    pub negative_capable: Option<bool>,
2145    /// Indicates default order type for the given security type.
2146    #[serde(rename = "orderDefaults")]
2147    pub order_defaults: Option<ContractRulesOrderDefaults>,
2148    /// Order origin designation for US securities options and Options Clearing Corporation
2149    #[serde(rename = "orderOrigination")]
2150    pub order_origination: Option<String>,
2151    /// Indicates permitted order types for use with standard quantity trading.
2152    #[serde(rename = "orderTypes")]
2153    pub order_types: Option<Vec<ContractRulesOrderType>>,
2154    /// Indicates permitted order types for use outside of regular trading hours.
2155    #[serde(rename = "orderTypesOutside")]
2156    pub order_types_outside: Option<Vec<ContractRulesOrderTypesOutside>>,
2157    /// Indicates if the order preview is required (for client portal only)
2158    pub preview: Option<bool>,
2159    /// Signifies the magnifier of a given contract. This is separate from the price multiplier, and will typically return 'null'
2160    #[serde(rename = "priceMagnifier")]
2161    pub price_magnifier: Option<i32>,
2162    /// Indicates quantity increase for the contract.
2163    #[serde(rename = "sizeIncrement")]
2164    pub size_increment: Option<i32>,
2165    /// Default stop price for the given contract.
2166    #[serde(rename = "stopPrice")]
2167    pub stop_price: Option<f64>,
2168    /// Object containing details about your TIF value defaults. These defaults can be viewed and modified in TWS's within the Global Configuration.
2169    #[serde(rename = "tifDefaults")]
2170    pub tif_defaults: Option<ContractRulesTifDefaults>,
2171    /// Indicates allowed tif types supported for the contract.
2172    #[serde(rename = "tifTypes")]
2173    pub tif_types: Option<Vec<String>>,
2174}
2175#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
2176pub enum ContractRulesCqtType {
2177    #[serde(rename = "limit")]
2178    #[default]
2179    Limit,
2180    #[serde(rename = "market")]
2181    Market,
2182    #[serde(rename = "stop")]
2183    Stop,
2184    #[serde(rename = "stop_limit")]
2185    StopLimit,
2186    #[serde(rename = "mit")]
2187    Mit,
2188    #[serde(rename = "lit")]
2189    Lit,
2190    #[serde(rename = "trailing_stop")]
2191    TrailingStop,
2192    #[serde(rename = "trailing_stop_limit")]
2193    TrailingStopLimit,
2194}
2195impl core::fmt::Display for ContractRulesCqtType {
2196    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2197        match self {
2198            Self::Limit => write!(f, "limit"),
2199            Self::Market => write!(f, "market"),
2200            Self::Stop => write!(f, "stop"),
2201            Self::StopLimit => write!(f, "stop_limit"),
2202            Self::Mit => write!(f, "mit"),
2203            Self::Lit => write!(f, "lit"),
2204            Self::TrailingStop => write!(f, "trailing_stop"),
2205            Self::TrailingStopLimit => write!(f, "trailing_stop_limit"),
2206        }
2207    }
2208}
2209#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
2210pub enum ContractRulesIbAlgoType {
2211    #[serde(rename = "limit")]
2212    #[default]
2213    Limit,
2214    #[serde(rename = "stop_limit")]
2215    StopLimit,
2216    #[serde(rename = "lit")]
2217    Lit,
2218    #[serde(rename = "trailing_stop_limit")]
2219    TrailingStopLimit,
2220    #[serde(rename = "relative")]
2221    Relative,
2222    #[serde(rename = "marketonclose")]
2223    Marketonclose,
2224    #[serde(rename = "limitonclose")]
2225    Limitonclose,
2226}
2227impl core::fmt::Display for ContractRulesIbAlgoType {
2228    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2229        match self {
2230            Self::Limit => write!(f, "limit"),
2231            Self::StopLimit => write!(f, "stop_limit"),
2232            Self::Lit => write!(f, "lit"),
2233            Self::TrailingStopLimit => write!(f, "trailing_stop_limit"),
2234            Self::Relative => write!(f, "relative"),
2235            Self::Marketonclose => write!(f, "marketonclose"),
2236            Self::Limitonclose => write!(f, "limitonclose"),
2237        }
2238    }
2239}
2240#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2241pub struct ContractRulesIncrementRule {
2242    /// The price of the instrument must be submitted as a mulitple of the increment value.
2243    pub increment: Option<f64>,
2244    /// If the current mark price of the instrument is at or above the lower edge, the given increment value is used for order prices.
2245    #[serde(rename = "lowerEdge")]
2246    pub lower_edge: Option<f64>,
2247}
2248/// Indicates default order type for the given security type.
2249#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2250pub struct ContractRulesOrderDefaults {
2251    #[serde(rename = "LMT")]
2252    pub lmt: Option<ContractRulesOrderDefaultsLmt>,
2253}
2254#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2255pub struct ContractRulesOrderDefaultsLmt {
2256    /// Indicates a Limit Price default value.
2257    #[serde(rename = "LP")]
2258    pub lp: Option<String>,
2259}
2260#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
2261pub enum ContractRulesOrderType {
2262    #[serde(rename = "limit")]
2263    #[default]
2264    Limit,
2265    #[serde(rename = "midprice")]
2266    Midprice,
2267    #[serde(rename = "market")]
2268    Market,
2269    #[serde(rename = "stop")]
2270    Stop,
2271    #[serde(rename = "stop_limit")]
2272    StopLimit,
2273    #[serde(rename = "mit")]
2274    Mit,
2275    #[serde(rename = "lit")]
2276    Lit,
2277    #[serde(rename = "trailing_stop")]
2278    TrailingStop,
2279    #[serde(rename = "trailing_stop_limit")]
2280    TrailingStopLimit,
2281    #[serde(rename = "relative")]
2282    Relative,
2283    #[serde(rename = "marketonclose")]
2284    Marketonclose,
2285    #[serde(rename = "limitonclose")]
2286    Limitonclose,
2287}
2288impl core::fmt::Display for ContractRulesOrderType {
2289    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2290        match self {
2291            Self::Limit => write!(f, "limit"),
2292            Self::Midprice => write!(f, "midprice"),
2293            Self::Market => write!(f, "market"),
2294            Self::Stop => write!(f, "stop"),
2295            Self::StopLimit => write!(f, "stop_limit"),
2296            Self::Mit => write!(f, "mit"),
2297            Self::Lit => write!(f, "lit"),
2298            Self::TrailingStop => write!(f, "trailing_stop"),
2299            Self::TrailingStopLimit => write!(f, "trailing_stop_limit"),
2300            Self::Relative => write!(f, "relative"),
2301            Self::Marketonclose => write!(f, "marketonclose"),
2302            Self::Limitonclose => write!(f, "limitonclose"),
2303        }
2304    }
2305}
2306#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
2307pub enum ContractRulesOrderTypesOutside {
2308    #[serde(rename = "limit")]
2309    #[default]
2310    Limit,
2311    #[serde(rename = "stop_limit")]
2312    StopLimit,
2313    #[serde(rename = "lit")]
2314    Lit,
2315    #[serde(rename = "trailing_stop_limit")]
2316    TrailingStopLimit,
2317    #[serde(rename = "relative")]
2318    Relative,
2319}
2320impl core::fmt::Display for ContractRulesOrderTypesOutside {
2321    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2322        match self {
2323            Self::Limit => write!(f, "limit"),
2324            Self::StopLimit => write!(f, "stop_limit"),
2325            Self::Lit => write!(f, "lit"),
2326            Self::TrailingStopLimit => write!(f, "trailing_stop_limit"),
2327            Self::Relative => write!(f, "relative"),
2328        }
2329    }
2330}
2331/// Object containing details about your TIF value defaults. These defaults can be viewed and modified in TWS's within the Global Configuration.
2332#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2333pub struct ContractRulesTifDefaults {
2334    /// default account (multi account only)
2335    #[serde(rename = "DEFAULT_ACCT")]
2336    pub default_acct: Option<String>,
2337    #[serde(rename = "PMALGO")]
2338    pub pmalgo: Option<bool>,
2339    /// The default size value for orders.
2340    #[serde(rename = "SIZE")]
2341    pub size: Option<String>,
2342    /// The default TIF type for orders.
2343    #[serde(rename = "TIF")]
2344    pub tif: Option<String>,
2345}
2346/// Endpoint used to create a new alert, or modify an existing alert.
2347#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
2348pub struct CreateAlertRequest {
2349    #[validate(nested)]
2350    pub path: CreateAlertRequestPath,
2351    #[validate(nested)]
2352    pub body: AlertCreationRequest,
2353}
2354impl CreateAlertRequest {
2355    /// Parse the HTTP response into the response enum.
2356    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<CreateAlertResponse> {
2357        let status = req.status();
2358        if status == http::StatusCode::OK {
2359            let data =
2360                oas3_gen_support::Diagnostics::<AlertCreationResponse>::json_with_diagnostics(req)
2361                    .await?;
2362            return Ok(CreateAlertResponse::Ok(data));
2363        }
2364        if status == http::StatusCode::BAD_REQUEST {
2365            let _ = req.bytes().await?;
2366            return Ok(CreateAlertResponse::BadRequest);
2367        }
2368        if status == http::StatusCode::UNAUTHORIZED {
2369            let _ = req.bytes().await?;
2370            return Ok(CreateAlertResponse::Unauthorized);
2371        }
2372        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
2373            let _ = req.bytes().await?;
2374            return Ok(CreateAlertResponse::InternalServerError);
2375        }
2376        if status == http::StatusCode::SERVICE_UNAVAILABLE {
2377            let _ = req.bytes().await?;
2378            return Ok(CreateAlertResponse::ServiceUnavailable);
2379        }
2380        let _ = req.bytes().await?;
2381        return Ok(CreateAlertResponse::Unknown);
2382    }
2383}
2384#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
2385pub struct CreateAlertRequestPath {
2386    /// - Example: `"U1234567".to_string()`
2387    #[validate(length(min = 1u64))]
2388    pub account_id: String,
2389}
2390/// Response types for createAlert
2391#[derive(Debug, Clone)]
2392pub enum CreateAlertResponse {
2393    ///200: An object containing valid accounts and the account properties regarding trading access. This endpoint is also used to confirm account validation.
2394    Ok(AlertCreationResponse),
2395    ///400: bad request; body is empty
2396    BadRequest,
2397    ///401: Invalid or expired access token
2398    Unauthorized,
2399    /**500: Internal Server Error. Unable to process request if incoming values are not valid. For example operator is "abc" Or if modification request contains unmodified fields
2400     */
2401    InternalServerError,
2402    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
2403     */
2404    ServiceUnavailable,
2405    ///default: Unknown response
2406    Unknown,
2407}
2408/// Add a new allocation group. This group can be used to trade in place of the {accountId} for the /iserver/account/{accountId}/orders endpoint.
2409#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
2410pub struct CreateAllocationGroupRequest {
2411    #[validate(nested)]
2412    pub body: GroupRequestBody2,
2413}
2414impl CreateAllocationGroupRequest {
2415    /// Parse the HTTP response into the response enum.
2416    pub async fn parse_response(
2417        req: reqwest::Response,
2418    ) -> anyhow::Result<CreateAllocationGroupResponse> {
2419        let status = req.status();
2420        if status == http::StatusCode::OK {
2421            let data = oas3_gen_support::Diagnostics::<SuccessResponse>::json_with_diagnostics(req)
2422                .await?;
2423            return Ok(CreateAllocationGroupResponse::Ok(data));
2424        }
2425        if status == http::StatusCode::UNAUTHORIZED {
2426            let _ = req.bytes().await?;
2427            return Ok(CreateAllocationGroupResponse::Unauthorized);
2428        }
2429        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
2430            let _ = req.bytes().await?;
2431            return Ok(CreateAllocationGroupResponse::InternalServerError);
2432        }
2433        if status == http::StatusCode::SERVICE_UNAVAILABLE {
2434            let _ = req.bytes().await?;
2435            return Ok(CreateAllocationGroupResponse::ServiceUnavailable);
2436        }
2437        let _ = req.bytes().await?;
2438        return Ok(CreateAllocationGroupResponse::Unknown);
2439    }
2440}
2441/// Response types for createAllocationGroup
2442#[derive(Debug, Clone)]
2443pub enum CreateAllocationGroupResponse {
2444    ///200: Returns a confirmation that the modification was successful.
2445    Ok(SuccessResponse),
2446    ///401: Invalid or expired access token
2447    Unauthorized,
2448    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
2449     */
2450    InternalServerError,
2451    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
2452     */
2453    ServiceUnavailable,
2454    ///default: Unknown response
2455    Unknown,
2456}
2457#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2458pub struct CreateBrowserSessionResponse {
2459    pub active: Option<bool>,
2460    /// - Example: `Some("https://www.interactivebrokers.com/sso/...".to_string())`
2461    pub url: Option<String>,
2462}
2463#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2464pub struct CreateSessionResponse {
2465    /// - Example: `"eyJ0eXAiOiJKV1...".to_string()`
2466    pub access_token: String,
2467    pub active: Option<bool>,
2468    /// - Example: `Some("Bearer".to_string())`
2469    pub token_type: Option<String>,
2470}
2471#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2472pub struct CurrencyPairs {
2473    /// Additional properties not defined in the schema.
2474    #[serde(flatten)]
2475    pub additional_properties: std::collections::HashMap<String, Vec<serde_json::Value>>,
2476}
2477/// Permanently delete an existing alert. Deleting an MTA alert will reset it to the default state.
2478#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
2479pub struct DeleteAlertRequest {
2480    #[validate(nested)]
2481    pub path: DeleteAlertRequestPath,
2482    pub body: ArrayNode,
2483}
2484impl DeleteAlertRequest {
2485    /// Parse the HTTP response into the response enum.
2486    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<DeleteAlertResponse> {
2487        let status = req.status();
2488        if status == http::StatusCode::OK {
2489            let data =
2490                oas3_gen_support::Diagnostics::<AlertDeletionResponse>::json_with_diagnostics(req)
2491                    .await?;
2492            return Ok(DeleteAlertResponse::Ok(data));
2493        }
2494        if status == http::StatusCode::UNAUTHORIZED {
2495            let _ = req.bytes().await?;
2496            return Ok(DeleteAlertResponse::Unauthorized);
2497        }
2498        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
2499            let _ = req.bytes().await?;
2500            return Ok(DeleteAlertResponse::InternalServerError);
2501        }
2502        let _ = req.bytes().await?;
2503        return Ok(DeleteAlertResponse::Unknown);
2504    }
2505}
2506#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
2507pub struct DeleteAlertRequestPath {
2508    /// - Example: `"U1234567".to_string()`
2509    #[validate(length(min = 1u64))]
2510    pub account_id: String,
2511    /// order_id returned from the original alert creation, or from the list of available alerts.
2512    /// - Example: `"9876543210".to_string()`
2513    #[validate(length(min = 1u64))]
2514    pub alert_id: String,
2515}
2516/// Response types for deleteAlert
2517#[derive(Debug, Clone)]
2518pub enum DeleteAlertResponse {
2519    ///200: An object containing details on the deleted endpoint.
2520    Ok(AlertDeletionResponse),
2521    ///401: Invalid or expired access token
2522    Unauthorized,
2523    ///500: Internal Server Error; Unable to delete alert in case when provided alert id doesn't exist
2524    InternalServerError,
2525    ///default: Unknown response
2526    Unknown,
2527}
2528/// Deletes a previously created allocation group. This endpoint is only supported for Financial Advisors and IBroker Accounts.
2529#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
2530pub struct DeleteAllocationGroupRequest {
2531    #[validate(nested)]
2532    pub body: NameRequestBody,
2533}
2534impl DeleteAllocationGroupRequest {
2535    /// Parse the HTTP response into the response enum.
2536    pub async fn parse_response(
2537        req: reqwest::Response,
2538    ) -> anyhow::Result<CreateAllocationGroupResponse> {
2539        let status = req.status();
2540        if status == http::StatusCode::OK {
2541            let data = oas3_gen_support::Diagnostics::<SuccessResponse>::json_with_diagnostics(req)
2542                .await?;
2543            return Ok(CreateAllocationGroupResponse::Ok(data));
2544        }
2545        if status == http::StatusCode::UNAUTHORIZED {
2546            let _ = req.bytes().await?;
2547            return Ok(CreateAllocationGroupResponse::Unauthorized);
2548        }
2549        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
2550            let _ = req.bytes().await?;
2551            return Ok(CreateAllocationGroupResponse::InternalServerError);
2552        }
2553        if status == http::StatusCode::SERVICE_UNAVAILABLE {
2554            let _ = req.bytes().await?;
2555            return Ok(CreateAllocationGroupResponse::ServiceUnavailable);
2556        }
2557        let _ = req.bytes().await?;
2558        return Ok(CreateAllocationGroupResponse::Unknown);
2559    }
2560}
2561#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
2562pub struct DeleteBankInstruction {
2563    /// - Example: `"U399192".to_string()`
2564    #[serde(rename = "accountId")]
2565    #[validate(length(min = 1u64, max = 32u64))]
2566    pub account_id: String,
2567    /// - Example: `"WIRE"`
2568    #[serde(rename = "bankInstructionMethod")]
2569    pub bank_instruction_method: DeleteBankInstructionBankInstructionMethod,
2570    /// - Example: `"Test-instruction".to_string()`
2571    #[serde(rename = "bankInstructionName")]
2572    #[validate(length(min = 1u64, max = 150u64))]
2573    pub bank_instruction_name: String,
2574    /// - Example: `1012983.0`
2575    #[serde(rename = "clientInstructionId")]
2576    pub client_instruction_id: f64,
2577    /// - Example: `"USD".to_string()`
2578    #[validate(length(min = 1u64, max = 3u64))]
2579    pub currency: String,
2580}
2581#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
2582pub enum DeleteBankInstructionBankInstructionMethod {
2583    #[serde(rename = "WIRE")]
2584    #[default]
2585    Wire,
2586    #[serde(rename = "ACH")]
2587    Ach,
2588}
2589impl core::fmt::Display for DeleteBankInstructionBankInstructionMethod {
2590    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2591        match self {
2592            Self::Wire => write!(f, "WIRE"),
2593            Self::Ach => write!(f, "ACH"),
2594        }
2595    }
2596}
2597/// Delete a specific device from our saved list of notification devices.
2598#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
2599pub struct DeleteFyiDeviceRequest {
2600    pub path: DeleteFyiDeviceRequestPath,
2601}
2602impl DeleteFyiDeviceRequest {
2603    /// Parse the HTTP response into the response enum.
2604    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<DeleteFyiDeviceResponse> {
2605        let status = req.status();
2606        if status == http::StatusCode::OK {
2607            let _ = req.bytes().await?;
2608            return Ok(DeleteFyiDeviceResponse::Ok);
2609        }
2610        let _ = req.bytes().await?;
2611        return Ok(DeleteFyiDeviceResponse::Unknown);
2612    }
2613}
2614#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
2615pub struct DeleteFyiDeviceRequestPath {
2616    /// Display the device identifier to delete from IB's saved list. Can be retrieved from /fyi/deliveryoptions.
2617    pub device_id: serde_json::Value,
2618}
2619/// Response types for deleteFyiDevice
2620#[derive(Debug, Clone)]
2621pub enum DeleteFyiDeviceResponse {
2622    ///200: No response message is returned. Instead, you will only receive an empty string with a 200 OK status code indicating a successfully deleted account.
2623    Ok,
2624    ///default: Unknown response
2625    Unknown,
2626}
2627/// Delete a specified watchlist from the username's settings.
2628#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
2629pub struct DeleteWatchlistRequest {
2630    #[validate(nested)]
2631    pub query: DeleteWatchlistRequestQuery,
2632}
2633impl DeleteWatchlistRequest {
2634    /// Parse the HTTP response into the response enum.
2635    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<DeleteWatchlistResponse> {
2636        let status = req.status();
2637        if status == http::StatusCode::OK {
2638            let data =
2639                oas3_gen_support::Diagnostics::<WatchlistDeleteSuccess>::json_with_diagnostics(req)
2640                    .await?;
2641            return Ok(DeleteWatchlistResponse::Ok(data));
2642        }
2643        if status == http::StatusCode::BAD_REQUEST {
2644            let _ = req.bytes().await?;
2645            return Ok(DeleteWatchlistResponse::BadRequest);
2646        }
2647        if status == http::StatusCode::UNAUTHORIZED {
2648            let _ = req.bytes().await?;
2649            return Ok(DeleteWatchlistResponse::Unauthorized);
2650        }
2651        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
2652            let _ = req.bytes().await?;
2653            return Ok(DeleteWatchlistResponse::InternalServerError);
2654        }
2655        if status == http::StatusCode::SERVICE_UNAVAILABLE {
2656            let _ = req.bytes().await?;
2657            return Ok(DeleteWatchlistResponse::ServiceUnavailable);
2658        }
2659        let _ = req.bytes().await?;
2660        return Ok(DeleteWatchlistResponse::Unknown);
2661    }
2662}
2663#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
2664pub struct DeleteWatchlistRequestQuery {
2665    /// Watchlist ID of the watchlist to be deleted.
2666    /// - Example: `"1234".to_string()`
2667    #[validate(length(min = 1u64))]
2668    pub id: String,
2669}
2670/// Response types for deleteWatchlist
2671#[derive(Debug, Clone)]
2672pub enum DeleteWatchlistResponse {
2673    ///200: Successful deletion of specified watchlist.
2674    Ok(WatchlistDeleteSuccess),
2675    ///400: Invalid input format or missing required fields
2676    BadRequest,
2677    ///401: Invalid or expired access token
2678    Unauthorized,
2679    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
2680     */
2681    InternalServerError,
2682    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
2683     */
2684    ServiceUnavailable,
2685    ///default: Unknown response
2686    Unknown,
2687}
2688#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2689pub struct DeliveryOptions {
2690    /// Returns an array of device information.
2691    #[serde(rename = "E")]
2692    pub e: Option<Vec<DeliveryOptionsE>>,
2693    /// Email option is enabled or not.
2694    #[serde(rename = "M")]
2695    pub m: Option<i32>,
2696}
2697#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2698pub struct DeliveryOptionsE {
2699    /// Device is enabled or not.
2700    #[serde(rename = "A")]
2701    pub a: Option<String>,
2702    /// Returns the deice identifier.
2703    #[serde(rename = "I")]
2704    pub i: Option<String>,
2705    /// Returns the human readable device name.
2706    #[serde(rename = "NM")]
2707    pub nm: Option<String>,
2708    /// Returns the unique device ID.
2709    #[serde(rename = "UI")]
2710    pub ui: Option<String>,
2711}
2712#[serde_with::skip_serializing_none]
2713#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
2714pub struct DepositFundsInstruction {
2715    /// - Example: `"U46377".to_string()`
2716    #[serde(rename = "accountId")]
2717    #[validate(length(min = 1u64, max = 32u64))]
2718    pub account_id: String,
2719    /// - Example: `100.0`
2720    pub amount: f64,
2721    /// - Example: `"WIRE"`
2722    #[serde(rename = "bankInstructionMethod")]
2723    pub bank_instruction_method: DepositFundsInstructionBankInstructionMethod,
2724    /// - Example: `Some("Instruction".to_string())`
2725    #[serde(rename = "bankInstructionName")]
2726    #[validate(length(min = 0u64, max = 150u64))]
2727    pub bank_instruction_name: Option<String>,
2728    /// - Example: `1012983.0`
2729    #[serde(rename = "clientInstructionId")]
2730    pub client_instruction_id: f64,
2731    /// - Example: `"USD".to_string()`
2732    #[validate(length(min = 1u64, max = 3u64))]
2733    pub currency: String,
2734    /// - Example: `Some("identifier".to_string())`
2735    #[validate(length(min = 0u64, max = 64u64))]
2736    pub identifier: Option<String>,
2737    #[serde(rename = "iraDepositDetail")]
2738    pub ira_deposit_detail: Option<DepositFundsInstructionIraDepositDetail>,
2739    #[serde(rename = "openBanking")]
2740    #[validate(nested)]
2741    pub open_banking: Option<DepositFundsInstructionOpenBanking>,
2742    #[serde(rename = "recurringInstructionDetail")]
2743    #[validate(nested)]
2744    pub recurring_instruction_detail: Option<RecurringInstructionDetail>,
2745    /// - Example: `Some("Senders Institution name".to_string())`
2746    #[serde(rename = "senderInstitutionName")]
2747    #[validate(length(min = 0u64, max = 128u64))]
2748    pub sender_institution_name: Option<String>,
2749    /// - Example: `Some("Sending Institution name".to_string())`
2750    #[serde(rename = "sendingInstitution")]
2751    #[validate(length(min = 0u64, max = 128u64))]
2752    pub sending_institution: Option<String>,
2753    /// - Example: `Some("U46377".to_string())`
2754    #[serde(rename = "specialInstruction")]
2755    #[validate(length(min = 0u64, max = 128u64))]
2756    pub special_instruction: Option<String>,
2757}
2758#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
2759pub enum DepositFundsInstructionBankInstructionMethod {
2760    #[serde(rename = "ACH")]
2761    #[default]
2762    Ach,
2763    #[serde(rename = "WIRE")]
2764    Wire,
2765    #[serde(rename = "eDDA")]
2766    EDDA,
2767    #[serde(rename = "OPEN_BANKING")]
2768    OpenBanking,
2769}
2770impl core::fmt::Display for DepositFundsInstructionBankInstructionMethod {
2771    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2772        match self {
2773            Self::Ach => write!(f, "ACH"),
2774            Self::Wire => write!(f, "WIRE"),
2775            Self::EDDA => write!(f, "eDDA"),
2776            Self::OpenBanking => write!(f, "OPEN_BANKING"),
2777        }
2778    }
2779}
2780#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
2781pub struct DepositFundsInstructionIraDepositDetail {
2782    /// - Example: `"TRADITIONAL"`
2783    #[serde(rename = "fromIraType")]
2784    pub from_ira_type: DepositFundsInstructionIraDepositDetailFromIraType,
2785    /// - Example: `"ROLLOVER"`
2786    #[serde(rename = "iraContributionType")]
2787    pub ira_contribution_type: DepositFundsInstructionIraDepositDetailIraContributionType,
2788    /// - Example: `"CURRENT"`
2789    #[serde(rename = "iraTaxYearType")]
2790    pub ira_tax_year_type: DepositFundsInstructionIraDepositDetailIraTaxYearType,
2791}
2792#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
2793pub enum DepositFundsInstructionIraDepositDetailFromIraType {
2794    #[serde(rename = "NONE")]
2795    #[default]
2796    None,
2797    #[serde(rename = "TRADITIONAL")]
2798    Traditional,
2799    #[serde(rename = "ROLLOVER")]
2800    Rollover,
2801    #[serde(rename = "ROTH")]
2802    Roth,
2803    #[serde(rename = "SEP")]
2804    Sep,
2805    #[serde(rename = "EDUCATION")]
2806    Education,
2807    #[serde(rename = "TRADITIONAL_INHERITED")]
2808    TraditionalInherited,
2809    #[serde(rename = "ROTH_INHERITED")]
2810    RothInherited,
2811    #[serde(rename = "SEP_INHERITED")]
2812    SepInherited,
2813    #[serde(rename = "RETIREMENT_SAVING_PLAN")]
2814    RetirementSavingPlan,
2815    #[serde(rename = "SPOUSAL_RETIREMENT_SAVING_PLAN")]
2816    SpousalRetirementSavingPlan,
2817    #[serde(rename = "TAX_FREE_SAVING_ACCOUNT")]
2818    TaxFreeSavingAccount,
2819}
2820impl core::fmt::Display for DepositFundsInstructionIraDepositDetailFromIraType {
2821    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2822        match self {
2823            Self::None => write!(f, "NONE"),
2824            Self::Traditional => write!(f, "TRADITIONAL"),
2825            Self::Rollover => write!(f, "ROLLOVER"),
2826            Self::Roth => write!(f, "ROTH"),
2827            Self::Sep => write!(f, "SEP"),
2828            Self::Education => write!(f, "EDUCATION"),
2829            Self::TraditionalInherited => write!(f, "TRADITIONAL_INHERITED"),
2830            Self::RothInherited => write!(f, "ROTH_INHERITED"),
2831            Self::SepInherited => write!(f, "SEP_INHERITED"),
2832            Self::RetirementSavingPlan => write!(f, "RETIREMENT_SAVING_PLAN"),
2833            Self::SpousalRetirementSavingPlan => {
2834                write!(f, "SPOUSAL_RETIREMENT_SAVING_PLAN")
2835            }
2836            Self::TaxFreeSavingAccount => write!(f, "TAX_FREE_SAVING_ACCOUNT"),
2837        }
2838    }
2839}
2840#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
2841pub enum DepositFundsInstructionIraDepositDetailIraContributionType {
2842    #[serde(rename = "ROLLOVER")]
2843    #[default]
2844    Rollover,
2845    #[serde(rename = "LATE_ROLLOVER")]
2846    LateRollover,
2847    #[serde(rename = "DIRECT_ROLLOVER")]
2848    DirectRollover,
2849    #[serde(rename = "CONTRIBUTION")]
2850    Contribution,
2851    #[serde(rename = "SPOUSAL_CONTRIBUTION")]
2852    SpousalContribution,
2853    #[serde(rename = "EMPLOYER_SEP_CONTRIBUTION")]
2854    EmployerSepContribution,
2855}
2856impl core::fmt::Display for DepositFundsInstructionIraDepositDetailIraContributionType {
2857    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2858        match self {
2859            Self::Rollover => write!(f, "ROLLOVER"),
2860            Self::LateRollover => write!(f, "LATE_ROLLOVER"),
2861            Self::DirectRollover => write!(f, "DIRECT_ROLLOVER"),
2862            Self::Contribution => write!(f, "CONTRIBUTION"),
2863            Self::SpousalContribution => write!(f, "SPOUSAL_CONTRIBUTION"),
2864            Self::EmployerSepContribution => write!(f, "EMPLOYER_SEP_CONTRIBUTION"),
2865        }
2866    }
2867}
2868#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
2869pub enum DepositFundsInstructionIraDepositDetailIraTaxYearType {
2870    #[serde(rename = "CURRENT")]
2871    #[default]
2872    Current,
2873    #[serde(rename = "PRIOR")]
2874    Prior,
2875}
2876impl core::fmt::Display for DepositFundsInstructionIraDepositDetailIraTaxYearType {
2877    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2878        match self {
2879            Self::Current => write!(f, "CURRENT"),
2880            Self::Prior => write!(f, "PRIOR"),
2881        }
2882    }
2883}
2884#[serde_with::skip_serializing_none]
2885#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
2886#[serde(default)]
2887pub struct DepositFundsInstructionOpenBanking {
2888    #[serde(rename = "plaidOptions")]
2889    #[validate(nested)]
2890    pub plaid_options: Option<DepositFundsInstructionOpenBankingPlaidOptions>,
2891    /// - Example: `"PLAID".to_string()`
2892    #[serde(rename = "serviceProvider")]
2893    #[default("PLAID".to_string())]
2894    pub service_provider: String,
2895}
2896#[serde_with::skip_serializing_none]
2897#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
2898pub struct DepositFundsInstructionOpenBankingPlaidOptions {
2899    /// This should be a URI with a custom scheme and this can be any value you'd like, as long as it isn't a reserved one such as http or tel. By convention, it's often one associated with the name of your application.
2900    /// - Example: `Some("wonderwallet://hosted-link-complete".to_string())`
2901    #[serde(rename = "completionRedirectUri")]
2902    #[validate(length(min = 0u64))]
2903    pub completion_redirect_uri: Option<String>,
2904    #[serde(rename = "isMobileApp")]
2905    pub is_mobile_app: Option<bool>,
2906    /// Client Name displayed on Plaid Link UI
2907    /// - Example: `Some("WonderWallet".to_string())`
2908    #[serde(rename = "linkDisplayName")]
2909    pub link_display_name: Option<String>,
2910}
2911#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2912pub struct DepositFundsPollingResponse {
2913    #[serde(rename = "instructionResult")]
2914    pub instruction_result: Option<DepositFundsPollingResult>,
2915    /// - Example: `-1988905739.0`
2916    #[serde(rename = "instructionSetId")]
2917    pub instruction_set_id: f64,
2918    /// - Example: `202.0`
2919    pub status: f64,
2920}
2921#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2922pub struct DepositFundsPollingResult {
2923    /// - Example: `1012983.0`
2924    #[serde(rename = "clientInstructionId")]
2925    pub client_instruction_id: f64,
2926    #[serde(rename = "depositDetails")]
2927    pub deposit_details: Option<DepositFundsPollingResultDepositDetails>,
2928    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
2929    pub description: Option<String>,
2930    pub error: Option<ResultError>,
2931    /// - Example: `Some(23456745.0)`
2932    #[serde(rename = "ibReferenceId")]
2933    pub ib_reference_id: Option<f64>,
2934    /// - Example: `45123654.0`
2935    #[serde(rename = "instructionId")]
2936    pub instruction_id: f64,
2937    /// - Example: `"PENDING"`
2938    #[serde(rename = "instructionStatus")]
2939    pub instruction_status: PollingInstructionResultInstructionStatus,
2940    /// - Example: `"INTERNAL_CASH_TRANSFER"`
2941    #[serde(rename = "instructionType")]
2942    pub instruction_type: InstructionResultInstructionType,
2943}
2944#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2945pub struct DepositFundsPollingResultDepositDetails {
2946    pub amount: Option<f64>,
2947    pub currency: Option<String>,
2948    #[serde(rename = "openBanking")]
2949    pub open_banking: Option<DepositFundsPollingResultDepositDetailsOpenBanking>,
2950    #[serde(rename = "whenAvailable")]
2951    pub when_available: Option<String>,
2952}
2953#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2954pub struct DepositFundsPollingResultDepositDetailsOpenBanking {
2955    #[serde(rename = "providerResponse")]
2956    pub provider_response: Option<serde_json::Value>,
2957    #[serde(rename = "serviceProvider")]
2958    pub service_provider: Option<String>,
2959}
2960#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2961pub struct Detail200Response {
2962    /// Collection of accounts held in the model.
2963    #[serde(rename = "accountInfoList")]
2964    pub account_info_list: Option<Vec<Detail200ResponseAccountInfoList>>,
2965    /// Base currency of the model.
2966    #[serde(rename = "baseCcyMaster")]
2967    pub base_ccy_master: Option<String>,
2968    /// Model retrieving accounts from.
2969    pub model: Option<String>,
2970    /// Unique identifier for the request.
2971    #[serde(rename = "reqID")]
2972    pub req_id: Option<i32>,
2973}
2974#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
2975pub struct Detail200ResponseAccountInfoList {
2976    /// Account identifier.
2977    pub account: Option<String>,
2978    /// Account's imbalance from the target allocation.
2979    #[serde(rename = "accountImbalance")]
2980    pub account_imbalance: Option<String>,
2981    /// Account alias.
2982    pub alias: Option<String>,
2983    /// Base currency of the account.
2984    #[serde(rename = "baseCcyAccount")]
2985    pub base_ccy_account: Option<String>,
2986    /// Cost basis.
2987    #[serde(rename = "costBasis")]
2988    pub cost_basis: Option<String>,
2989    /// Exchange rate of the account base currency to the model base currency.
2990    #[serde(rename = "exchangeRate")]
2991    pub exchange_rate: Option<f64>,
2992    /// The net liquidation value of the instrument.
2993    pub nlv: Option<String>,
2994    /// The number of instruments held by the account outside of the alloted range from the presets.
2995    #[serde(rename = "numInstrumentsOutsideRange")]
2996    pub num_instruments_outside_range: Option<i32>,
2997    /// The unrealized profit and loss of the model within the account.
2998    #[serde(rename = "unrealizedPnL")]
2999    pub unrealized_pn_l: Option<String>,
3000}
3001#[serde_with::skip_serializing_none]
3002#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
3003pub struct DetailRequestBody {
3004    /// Determine if Profit and Loss values
3005    #[serde(rename = "calcPnls")]
3006    pub calc_pnls: Option<bool>,
3007    /// Request model to pull account details from.
3008    pub model: Option<String>,
3009    /// Request identifier to uniquely track a request.
3010    /// - Example: `Some(540_608i32)`
3011    #[serde(rename = "reqID")]
3012    pub req_id: Option<i32>,
3013}
3014#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3015pub struct DetailedContractInformation {
3016    /// Confirms if the currency type. If trading exclusively in your base currency, "base" will be returned.
3017    #[serde(rename = "currencyType")]
3018    pub currency_type: Option<String>,
3019    /// Returns the request identifier, getPerformanceAllPeriods.
3020    pub id: Option<String>,
3021    /// Returns an array containing accounts reviewed.
3022    pub included: Option<Vec<String>>,
3023    /// Returns the total data points.
3024    pub nd: Option<i32>,
3025    /// Portfolio Measure. Used to indicate TWR or MWR values returned.
3026    pub pm: Option<String>,
3027    /// Returns the data identifier (Internal Use Only).
3028    pub rc: Option<i32>,
3029    /// Returns the accountIds being viewed and returned.
3030    pub view: Option<Vec<String>>,
3031    /// Additional properties not defined in the schema.
3032    #[serde(flatten)]
3033    pub additional_properties: std::collections::HashMap<String, serde_json::Value>,
3034}
3035#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3036pub struct DisclaimerInfo {
3037    /// Returns the Disclaimer message.
3038    #[serde(rename = "DT")]
3039    pub dt: Option<String>,
3040    /// Returns the Typecode for the given disclaimer.
3041    #[serde(rename = "FC")]
3042    pub fc: Option<String>,
3043}
3044#[serde_with::skip_serializing_none]
3045#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
3046#[serde(default)]
3047pub struct DwacInstruction {
3048    /// - Example: `"U46377".to_string()`
3049    #[serde(rename = "accountId")]
3050    #[validate(length(min = 1u64, max = 32u64))]
3051    pub account_id: String,
3052    /// - Example: `Some("Title".to_string())`
3053    #[serde(rename = "accountTitle")]
3054    #[validate(length(min = 0u64, max = 140u64))]
3055    pub account_title: Option<String>,
3056    /// - Example: `1012983.0`
3057    #[serde(rename = "clientInstructionId")]
3058    pub client_instruction_id: f64,
3059    /// - Example: `"12345678A".to_string()`
3060    #[serde(rename = "contraBrokerAccountId")]
3061    #[validate(length(min = 1u64, max = 20u64))]
3062    pub contra_broker_account_id: String,
3063    /// - Example: `"123456789".to_string()`
3064    #[serde(rename = "contraBrokerTaxId")]
3065    #[validate(length(min = 1u64, max = 25u64))]
3066    pub contra_broker_tax_id: String,
3067    /// - Example: `"IN".to_string()`
3068    #[default("IN".to_string())]
3069    pub direction: String,
3070    /// - Example: `1000.0`
3071    pub quantity: f64,
3072    /// - Example: `Some("refId".to_string())`
3073    #[serde(rename = "referenceId")]
3074    #[validate(length(min = 0u64, max = 20u64))]
3075    pub reference_id: Option<String>,
3076    #[serde(rename = "tradingInstrument")]
3077    pub trading_instrument: TradingInstrument,
3078}
3079#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3080pub struct DynAccountSearchResponse {
3081    /// Contains a series of objects that pertain to the account information requested.
3082    #[serde(rename = "matchedAccounts")]
3083    pub matched_accounts: Option<Vec<DynAccountSearchResponseMatchedAccount>>,
3084    /// Displays the searchPattern used for the request.
3085    pub pattern: Option<String>,
3086}
3087#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3088pub struct DynAccountSearchResponseMatchedAccount {
3089    /// Returns a matching account ID that corresponds to the matching value.
3090    #[serde(rename = "accountId")]
3091    pub account_id: Option<String>,
3092    /// Returns the corresponding alias or alternative name for the specific account ID. May be a duplicate of the accountId value in most cases.
3093    pub alias: Option<String>,
3094    /// Returns the allocation identifier used internally for the account.
3095    #[serde(rename = "allocationId")]
3096    pub allocation_id: Option<String>,
3097}
3098#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3099pub struct EchoResponse {
3100    /// - Example: `Some({})`
3101    #[serde(rename = "queryParameters")]
3102    pub query_parameters: Option<serde_json::Value>,
3103    /// - Example: `"GET"`
3104    #[serde(rename = "requestMethod")]
3105    pub request_method: EchoResponseRequestMethod,
3106    /// - Example: `"HTTPS"`
3107    #[serde(rename = "securityPolicy")]
3108    pub security_policy: EchoResponseSecurityPolicy,
3109}
3110#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
3111pub enum EchoResponseRequestMethod {
3112    #[serde(rename = "GET")]
3113    #[default]
3114    Get,
3115    #[serde(rename = "POST")]
3116    Post,
3117    #[serde(rename = "PATCH")]
3118    Patch,
3119    #[serde(rename = "PUT")]
3120    Put,
3121}
3122impl core::fmt::Display for EchoResponseRequestMethod {
3123    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3124        match self {
3125            Self::Get => write!(f, "GET"),
3126            Self::Post => write!(f, "POST"),
3127            Self::Patch => write!(f, "PATCH"),
3128            Self::Put => write!(f, "PUT"),
3129        }
3130    }
3131}
3132#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
3133pub enum EchoResponseSecurityPolicy {
3134    #[serde(rename = "HTTPS")]
3135    #[default]
3136    Https,
3137    #[serde(rename = "SIGNED_JWT")]
3138    SignedJwt,
3139    #[serde(rename = "ENCRYPTED_JWE")]
3140    EncryptedJwe,
3141}
3142impl core::fmt::Display for EchoResponseSecurityPolicy {
3143    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3144        match self {
3145            Self::Https => write!(f, "HTTPS"),
3146            Self::SignedJwt => write!(f, "SIGNED_JWT"),
3147            Self::EncryptedJwe => write!(f, "ENCRYPTED_JWE"),
3148        }
3149    }
3150}
3151#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
3152pub struct EddaInstruction {
3153    /// - Example: `"U2323232".to_string()`
3154    #[serde(rename = "accountId")]
3155    #[validate(length(min = 1u64, max = 32u64))]
3156    pub account_id: String,
3157    /// - Example: `"132456".to_string()`
3158    #[serde(rename = "bankAccountNumber")]
3159    #[validate(length(min = 1u64, max = 32u64))]
3160    pub bank_account_number: String,
3161    /// - Example: `"003".to_string()`
3162    #[serde(rename = "bankBranchCode")]
3163    #[validate(length(min = 1u64, max = 3u64))]
3164    pub bank_branch_code: String,
3165    /// - Example: `"003".to_string()`
3166    #[serde(rename = "bankClearingCode")]
3167    #[validate(length(min = 1u64, max = 3u64))]
3168    pub bank_clearing_code: String,
3169    /// - Example: `"Instruction Name".to_string()`
3170    #[serde(rename = "bankInstructionName")]
3171    #[validate(length(min = 1u64, max = 100u64))]
3172    pub bank_instruction_name: String,
3173    /// - Example: `1012983.0`
3174    #[serde(rename = "clientInstructionId")]
3175    pub client_instruction_id: f64,
3176    /// - Example: `"CNH".to_string()`
3177    #[validate(length(min = 1u64, max = 3u64))]
3178    pub currency: String,
3179    /// - Example: `"hkId"`
3180    #[serde(rename = "debtorIdentificationDocumentType")]
3181    pub debtor_identification_document_type: EddaInstructionDebtorIdentificationDocumentType,
3182}
3183#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
3184pub enum EddaInstructionDebtorIdentificationDocumentType {
3185    #[serde(rename = "hkId")]
3186    #[default]
3187    HkId,
3188    #[serde(rename = "passport")]
3189    Passport,
3190    #[serde(rename = "chinaId")]
3191    ChinaId,
3192    #[serde(rename = "hkMacaoEntryPermit")]
3193    HkMacaoEntryPermit,
3194}
3195impl core::fmt::Display for EddaInstructionDebtorIdentificationDocumentType {
3196    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3197        match self {
3198            Self::HkId => write!(f, "hkId"),
3199            Self::Passport => write!(f, "passport"),
3200            Self::ChinaId => write!(f, "chinaId"),
3201            Self::HkMacaoEntryPermit => write!(f, "hkMacaoEntryPermit"),
3202        }
3203    }
3204}
3205#[serde_with::skip_serializing_none]
3206#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
3207pub struct EnabledRequestBody {
3208    /// the notification should be enabled or disabled.
3209    pub enabled: Option<bool>,
3210}
3211#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3212pub struct EntityIRABene {
3213    #[serde(rename = "articleOfWill")]
3214    pub article_of_will: Option<String>,
3215    #[serde(rename = "entityType")]
3216    pub entity_type: Option<String>,
3217    pub location: Option<std::collections::HashMap<String, String>>,
3218    pub name: Option<String>,
3219    #[serde(rename = "type")]
3220    pub r#type: Option<String>,
3221}
3222#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3223pub struct EnumerationResponse {
3224    #[serde(rename = "enumerationsType")]
3225    pub enumerations_type: Option<String>,
3226    #[serde(rename = "formNumber")]
3227    pub form_number: Option<String>,
3228    #[serde(rename = "jsonData")]
3229    pub json_data: Option<serde_json::Value>,
3230}
3231/// <ul><li>exchange-bundles - query most up to date list of exchange-bundles for tradingPermissions</li><li>business-and-occupation - list of occupation and employerBusiness for employmentDetails</li><li>employee-track - query most up to date companyId for account. For affiliation details, if company has an existing IBKR Employee Track account</li><li>fin-info-ranges - query most up to date range IDs by currency for annualNetIncome, netWorth, liquidNetWorth</li><li>acats - query most up to date values for brokerId and brokerName. Used if funding via US ACATS extPositionsTransfers</li><li>aton - query most up to date values for brokerId and brokerName. Used if funding via US ACATS extPositionsTransfers</li><li>market-data - query most up to date values for brokerId and brokerName. Used if funding via ATON Canada extPositionsTransfers</li><li>edd-avt - query questions associated with EDD (Enhanced Due Diligence) or AVT (Additional Verification) tasks assigned to an account</li><li>prohibited-country - view list of prohibited countries. Applicants that reside in prohibited country are restricted from opening an account with IBKR. Error will be thrown IF legalResidenceCountry, OR country (included within Residence, mailingAddress and employerAddress, taxResidency node) is a prohibited country</li><li>employee-plans - view EPA that are linked to master account (applicable IF offering SEP IRA accounts)</li><li>questionnaires - obtain list of questionnaires</li><li>security-questions - obtain list of questions supported for IBKR security questions</li><li>quiz-questions - obtain list of questions associated with IBKR knowledge assessment</li><li>wire-instructions - obtain list of wire instructions</li><li>product-country-bundles - obtain list of product country bundles</li></ul>
3232#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
3233pub enum EnumerationType {
3234    #[serde(rename = "exchange-bundles")]
3235    #[default]
3236    ExchangeBundles,
3237    #[serde(rename = "business-and-occupation")]
3238    BusinessAndOccupation,
3239    #[serde(rename = "employee-track")]
3240    EmployeeTrack,
3241    #[serde(rename = "fin-info-ranges")]
3242    FinInfoRanges,
3243    #[serde(rename = "acats")]
3244    Acats,
3245    #[serde(rename = "aton")]
3246    Aton,
3247    #[serde(rename = "market-data")]
3248    MarketData,
3249    #[serde(rename = "edd-avt")]
3250    EddAvt,
3251    #[serde(rename = "prohibited-country")]
3252    ProhibitedCountry,
3253    #[serde(rename = "employee-plans")]
3254    EmployeePlans,
3255    #[serde(rename = "questionnaires")]
3256    Questionnaires,
3257    #[serde(rename = "security-questions")]
3258    SecurityQuestions,
3259    #[serde(rename = "quiz-questions")]
3260    QuizQuestions,
3261    #[serde(rename = "wire-instructions")]
3262    WireInstructions,
3263    #[serde(rename = "product-country-bundles")]
3264    ProductCountryBundles,
3265}
3266impl core::fmt::Display for EnumerationType {
3267    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3268        match self {
3269            Self::ExchangeBundles => write!(f, "exchange-bundles"),
3270            Self::BusinessAndOccupation => write!(f, "business-and-occupation"),
3271            Self::EmployeeTrack => write!(f, "employee-track"),
3272            Self::FinInfoRanges => write!(f, "fin-info-ranges"),
3273            Self::Acats => write!(f, "acats"),
3274            Self::Aton => write!(f, "aton"),
3275            Self::MarketData => write!(f, "market-data"),
3276            Self::EddAvt => write!(f, "edd-avt"),
3277            Self::ProhibitedCountry => write!(f, "prohibited-country"),
3278            Self::EmployeePlans => write!(f, "employee-plans"),
3279            Self::Questionnaires => write!(f, "questionnaires"),
3280            Self::SecurityQuestions => write!(f, "security-questions"),
3281            Self::QuizQuestions => write!(f, "quiz-questions"),
3282            Self::WireInstructions => write!(f, "wire-instructions"),
3283            Self::ProductCountryBundles => write!(f, "product-country-bundles"),
3284        }
3285    }
3286}
3287#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3288pub struct ErrorResponse {
3289    pub error: Option<Box<ErrorResponse>>,
3290    #[serde(rename = "errorDescription")]
3291    pub error_description: Option<String>,
3292    #[serde(rename = "hasError")]
3293    pub has_error: Option<bool>,
3294}
3295#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
3296pub struct ExternalAssetTransfersBulkRequestBody {
3297    #[serde(rename = "instructionType")]
3298    pub instruction_type: TransferRequestBody2InstructionType,
3299    pub instructions: Vec<serde_json::Value>,
3300}
3301#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
3302pub struct ExternalCashTransfersBulkRequestBody {
3303    #[serde(rename = "instructionType")]
3304    pub instruction_type: TransferRequestBody3InstructionType,
3305    pub instructions: Vec<serde_json::Value>,
3306}
3307#[serde_with::skip_serializing_none]
3308#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
3309#[serde(default)]
3310pub struct ExternalPositionTransfer {
3311    /// - Example: `"SOL12345".to_string()`
3312    #[serde(rename = "accountAtBroker")]
3313    #[validate(length(min = 1u64, max = 34u64))]
3314    pub account_at_broker: String,
3315    /// - Example: `"U2323232".to_string()`
3316    #[serde(rename = "accountId")]
3317    #[validate(length(min = 1u64, max = 32u64))]
3318    pub account_id: String,
3319    /// - Example: `"0226".to_string()`
3320    #[serde(rename = "brokerId")]
3321    #[validate(length(min = 1u64, max = 20u64))]
3322    pub broker_id: String,
3323    /// - Example: `"Wall Street Financial Group".to_string()`
3324    #[serde(rename = "brokerName")]
3325    #[validate(length(min = 1u64, max = 256u64))]
3326    pub broker_name: String,
3327    /// - Example: `1012983.0`
3328    #[serde(rename = "clientInstructionId")]
3329    pub client_instruction_id: f64,
3330    /// - Example: `"sample signature".to_string()`
3331    #[validate(length(min = 1u64, max = 140u64))]
3332    pub signature: String,
3333    /// - Example: `Some("RO")`
3334    #[serde(rename = "sourceIRAType")]
3335    pub source_iratype: Option<ExternalPositionTransferSourceIratype>,
3336    /// - Example: `"ACATS"`
3337    #[serde(rename = "subType")]
3338    pub sub_type: SubType,
3339    /// - Example: `"FULL".to_string()`
3340    #[serde(rename = "type")]
3341    #[default("FULL".to_string())]
3342    pub r#type: String,
3343}
3344#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
3345pub enum ExternalPositionTransferSourceIratype {
3346    #[serde(rename = "RO")]
3347    #[default]
3348    Ro,
3349    #[serde(rename = "RI")]
3350    Ri,
3351    #[serde(rename = "RT")]
3352    Rt,
3353    #[serde(rename = "SP")]
3354    Sp,
3355    #[serde(rename = "ED")]
3356    Ed,
3357    #[serde(rename = "TH")]
3358    Th,
3359    #[serde(rename = "RH")]
3360    Rh,
3361    #[serde(rename = "SH")]
3362    Sh,
3363}
3364impl core::fmt::Display for ExternalPositionTransferSourceIratype {
3365    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3366        match self {
3367            Self::Ro => write!(f, "RO"),
3368            Self::Ri => write!(f, "RI"),
3369            Self::Rt => write!(f, "RT"),
3370            Self::Sp => write!(f, "SP"),
3371            Self::Ed => write!(f, "ED"),
3372            Self::Th => write!(f, "TH"),
3373            Self::Rh => write!(f, "RH"),
3374            Self::Sh => write!(f, "SH"),
3375        }
3376    }
3377}
3378#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3379pub struct FailedTickleResponse {
3380    /// reason why tickle was accepted by not processed
3381    pub error: Option<String>,
3382}
3383#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3384pub struct Features {
3385    /// Displayed as the string of your symbol Contains a series of objects for each symbol that matches the requested.
3386    pub symbol: Option<Vec<FeaturesSymbol>>,
3387}
3388#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3389pub struct FeaturesSymbol {
3390    /// Contract identifier for the specific symbol
3391    pub conid: Option<i32>,
3392    /// Expiration date of the specific future contract.
3393    #[serde(rename = "expirationDate")]
3394    pub expiration_date: Option<i32>,
3395    /// Represents the final day for contract rollover for long futures.
3396    #[serde(rename = "longFuturesCutOff")]
3397    pub long_futures_cut_off: Option<i32>,
3398    /// Last trade date of the future contract.
3399    pub ltd: Option<i32>,
3400    /// Represents the final day for contract rollover for shorted futures.
3401    #[serde(rename = "shortFuturesCutOff")]
3402    pub short_futures_cut_off: Option<i32>,
3403    /// The requested symbol value.
3404    pub symbol: Option<String>,
3405    /// Contract identifier for the future's underlying contract.
3406    #[serde(rename = "underlyingConid")]
3407    pub underlying_conid: Option<i32>,
3408}
3409#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3410pub struct FileData {
3411    pub data: Option<serde_json::Value>,
3412    pub name: Option<String>,
3413}
3414#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3415pub struct FileDetailsResponse {
3416    #[serde(rename = "accountId")]
3417    pub account_id: Option<String>,
3418    #[serde(rename = "requestFileName")]
3419    pub request_file_name: Option<String>,
3420    #[serde(rename = "responseFileName")]
3421    pub response_file_name: Option<String>,
3422}
3423#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
3424pub struct FopInstruction {
3425    /// - Example: `"U46377".to_string()`
3426    #[serde(rename = "accountId")]
3427    #[validate(length(min = 1u64, max = 32u64))]
3428    pub account_id: String,
3429    /// - Example: `1012983.0`
3430    #[serde(rename = "clientInstructionId")]
3431    pub client_instruction_id: f64,
3432    /// - Example: `"12345678A".to_string()`
3433    #[serde(rename = "contraBrokerAccountId")]
3434    #[validate(length(min = 1u64, max = 20u64))]
3435    pub contra_broker_account_id: String,
3436    /// - Example: `"534".to_string()`
3437    #[serde(rename = "contraBrokerDtcCode")]
3438    #[validate(length(min = 1u64, max = 20u64))]
3439    pub contra_broker_dtc_code: String,
3440    /// - Example: `"IN"`
3441    pub direction: InstructionDirection,
3442    /// - Example: `1000.0`
3443    pub quantity: f64,
3444    #[serde(rename = "tradingInstrument")]
3445    pub trading_instrument: TradingInstrument,
3446}
3447#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3448pub struct ForecastDetailsResponse {
3449    /// The affiliated market category declared in /forecast/category/tree.
3450    pub category: Option<String>,
3451    /// Contract identifier of "no" contract
3452    pub conid_no: Option<i32>,
3453    /// Contract identifier of "yes" contract
3454    pub conid_yes: Option<i32>,
3455    /// Contract exchange.
3456    pub exchange: Option<String>,
3457    /// Contract expiration date in YYYYMMDD format.
3458    pub expiration: Option<String>,
3459    /// Logo category to use in logo service to get image.
3460    pub logo_category: Option<String>,
3461    /// name of contract's market.
3462    pub market_name: Option<String>,
3463    /// measured period
3464    pub measured_period: Option<String>,
3465    /// Ratio of payout scaling.
3466    pub payout: Option<f64>,
3467    /// Contract question (i.e. "Will this happen on this date?")
3468    pub question: Option<String>,
3469    /// "Y" or "N", yes or no contract.
3470    pub side: Option<String>,
3471    /// Contract strike.
3472    pub strike: Option<f64>,
3473    /// Strike label to display.
3474    pub strike_label: Option<String>,
3475    /// Contract symbol.
3476    pub symbol: Option<String>,
3477    /// Immediate underlier to contract (i.e. future conid for FOPs)
3478    pub underlying_conid: Option<i32>,
3479}
3480#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3481pub struct ForecastMarketResponse {
3482    /// List of contracts matching the requested market.
3483    pub contracts: Option<Vec<ForecastMarketResponseContract>>,
3484    /// Exchange that was passed in request or determined internally.
3485    pub exchange: Option<String>,
3486    /// Indicates whether UI should or should not display underlying chart.
3487    pub exclude_historical_data: Option<bool>,
3488    /// Logo category to use in logo service to retrieve image.
3489    pub logo_category: Option<String>,
3490    /// Market contract identifier.
3491    pub market_name: Option<String>,
3492    /// Ratio of payout scaling.
3493    pub payout: Option<f64>,
3494    /// Market symbol.
3495    pub symbol: Option<String>,
3496}
3497#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3498pub struct ForecastMarketResponseContract {
3499    /// Market contract identifier.
3500    pub conid: Option<i32>,
3501    /// Contract expiration date in YYYYMMDD format.
3502    pub expiration: Option<String>,
3503    /// Label UI to show for the expiration tabs.
3504    pub expiry_label: Option<String>,
3505    /// "Y" or "N" denoting a Yes or No contract.
3506    pub side: Option<String>,
3507    /// Contract strike price.
3508    pub strike: Option<f64>,
3509    /// Strike label to display.
3510    pub strike_label: Option<String>,
3511    /// Specified date of expiration.
3512    pub time_specifier: Option<String>,
3513    /// Immediate underlier to contract (i.e. future conid for FOPs).
3514    pub underlying_conid: Option<i32>,
3515}
3516#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3517pub struct ForecastRulesResponse {
3518    /// Product asset class.
3519    pub asset_class: Option<String>,
3520    /// Link to data from source agency.
3521    pub data_and_resolution_link: Option<String>,
3522    /// Long product description.
3523    pub description: Option<String>,
3524    /// Exchange timezone.
3525    pub exchange_timezone: Option<String>,
3526    /// last trade time in epoch seconds.
3527    pub last_trade_time: Option<i32>,
3528    /// Name of the contract's market.
3529    pub market_name: Option<String>,
3530    /// Link to market rules document.
3531    pub market_rules_link: Option<String>,
3532    /// Measured period of the contract.
3533    pub measured_period: Option<String>,
3534    /// Formatted payout amount.
3535    pub payout: Option<String>,
3536    /// Payout time in epoch seconds.
3537    pub payout_time: Option<i32>,
3538    /// Formatted price increment amount.
3539    pub price_increment: Option<String>,
3540    /// Product code (symbol).
3541    pub product_code: Option<String>,
3542    /// Release time in epoch seconds.
3543    pub release_time: Option<i32>,
3544    /// Name of the contract's source agency.
3545    pub source_agency: Option<String>,
3546    /// Either strike or strike label depending on contract type.
3547    pub threshold: Option<String>,
3548}
3549#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3550pub struct ForecastSchedulesResponse {
3551    /// Exchange timezone of event contract.
3552    pub timezone: Option<String>,
3553    /// List containing trading objects for each date.
3554    pub trading_schedules: Option<Vec<ForecastSchedulesResponseTradingSchedule>>,
3555}
3556#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3557pub struct ForecastSchedulesResponseTradingSchedule {
3558    /// Provides the day of the week corresponding to the trading schedule.
3559    pub day_of_week: Option<String>,
3560    /// List containing the opening times for the event contract. Multiple trading blocks may be returned if the contract has an intraday trading closure.
3561    pub trading_times: Option<Vec<ForecastSchedulesResponseTradingScheduleTradingTime>>,
3562}
3563#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3564pub struct ForecastSchedulesResponseTradingScheduleTradingTime {
3565    /// The closing time for the given trading session.
3566    pub close: Option<String>,
3567    /// The opening time for the given trading session.
3568    pub open: Option<String>,
3569}
3570#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3571pub struct FormDetails {
3572    #[serde(rename = "acceptableDocs")]
3573    pub acceptable_docs: Option<Vec<String>>,
3574    pub action: Option<String>,
3575    #[serde(rename = "apiSupportedTask")]
3576    pub api_supported_task: Option<bool>,
3577    #[serde(rename = "dateModified")]
3578    pub date_modified: Option<chrono::DateTime<chrono::Utc>>,
3579    pub error: Option<Box<ErrorResponse>>,
3580    #[serde(rename = "errorDescription")]
3581    pub error_description: Option<String>,
3582    #[serde(rename = "fileLength")]
3583    pub file_length: Option<i64>,
3584    #[serde(rename = "fileName")]
3585    pub file_name: Option<String>,
3586    #[serde(rename = "formName")]
3587    pub form_name: Option<String>,
3588    #[serde(rename = "formNumber")]
3589    pub form_number: Option<i32>,
3590    #[serde(rename = "hasError")]
3591    pub has_error: Option<bool>,
3592    pub language: Option<String>,
3593    pub payload: Option<FormPayload>,
3594    pub questionnaire: Option<Vec<QuestionnaireResponse>>,
3595    #[serde(rename = "sha1Checksum")]
3596    pub sha1checksum: Option<String>,
3597    #[serde(rename = "type")]
3598    pub r#type: Option<String>,
3599}
3600#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3601pub struct FormFileResponse {
3602    pub error: Option<Box<ErrorResponse>>,
3603    #[serde(rename = "errorDescription")]
3604    pub error_description: Option<String>,
3605    #[serde(rename = "fileData")]
3606    pub file_data: Option<FileData>,
3607    #[serde(rename = "formDetails")]
3608    pub form_details: Option<Vec<FormDetails>>,
3609    #[serde(rename = "hasError")]
3610    pub has_error: Option<bool>,
3611    pub timestamp: Option<chrono::DateTime<chrono::Utc>>,
3612}
3613#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3614pub struct FormPayload {
3615    pub data: Option<String>,
3616    #[serde(rename = "mimeType")]
3617    pub mime_type: Option<String>,
3618}
3619/// Contains commodities specific fund values.
3620#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3621pub struct Funds {
3622    /// This value reflects your available funds at the next margin change.
3623    #[serde(rename = "Lk Ahd Avlbl Fnds")]
3624    pub lk_ahd_avlbl_fnds: Option<String>,
3625    /// Displays predicted post-expiration account value.
3626    #[serde(rename = "Prdctd Pst-xpry Excss")]
3627    pub prdctd_pst_xpry_excss: Option<String>,
3628    /// Describes currently avialable funds in your account for trading.
3629    pub current_available: Option<String>,
3630    /// Describes total value of the account.
3631    pub current_excess: Option<String>,
3632    /// Describes available funds for overnight trading.
3633    pub overnight_available: Option<String>,
3634    /// Overnight refers to the window of time after the local market trading day is closed.
3635    ///   * `Securities` - Equivalent to regular trading hours.
3636    ///    * `Commodities` - Commodities Net Liquidation value. Overnight Maintenance margin.
3637    pub overnight_excess: Option<String>,
3638}
3639#[serde_with::skip_serializing_none]
3640#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
3641pub struct FyiEnableDeviceOption {
3642    #[serde(rename = "deviceId")]
3643    pub device_id: Option<String>,
3644    #[serde(rename = "deviceName")]
3645    pub device_name: Option<String>,
3646    /// enable or disable device
3647    pub enabled: Option<bool>,
3648    #[serde(rename = "uiName")]
3649    pub ui_name: Option<String>,
3650}
3651pub type FyiSettings = Vec<FyiSettingsFyiSetting>;
3652#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3653pub struct FyiSettingsFyiSetting {
3654    /// Returns ony if the subscription can be disabled/enabled manually. See /fyi/settings/{typecode} for how to enable/disable.
3655    #[serde(rename = "A")]
3656    pub a: Option<i32>,
3657    /// Fyi code for enabling or disabling the notification.
3658    #[serde(rename = "FC")]
3659    pub fc: Option<String>,
3660    /// Returns a detailed description of the topic.
3661    #[serde(rename = "FD")]
3662    pub fd: Option<String>,
3663    /// Returns a human readable title for the notification.
3664    #[serde(rename = "FN")]
3665    pub r#fn: Option<String>,
3666    /// Disclaimer if the notification was read.
3667    #[serde(rename = "H")]
3668    pub h: Option<i32>,
3669}
3670#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
3671pub struct FyiVT {
3672    /// Returns the time in ms to complete the edit.
3673    #[serde(rename = "T")]
3674    pub t: Option<i32>,
3675    /// Returns 1 to state message was acknowledged.
3676    #[serde(rename = "V")]
3677    pub v: Option<i32>,
3678}
3679/// Generate OAuth 2.0 access tokens based on request parameters.
3680#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
3681pub struct GenerateTokenRequest {
3682    pub body: TokenRequest,
3683}
3684impl GenerateTokenRequest {
3685    /// Parse the HTTP response into the response enum.
3686    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GenerateTokenResponse> {
3687        let status = req.status();
3688        if status == http::StatusCode::OK {
3689            let data =
3690                oas3_gen_support::Diagnostics::<TokenResponse>::json_with_diagnostics(req).await?;
3691            return Ok(GenerateTokenResponse::Ok(data));
3692        }
3693        if status == http::StatusCode::BAD_REQUEST {
3694            let _ = req.bytes().await?;
3695            return Ok(GenerateTokenResponse::BadRequest);
3696        }
3697        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
3698            let _ = req.bytes().await?;
3699            return Ok(GenerateTokenResponse::InternalServerError);
3700        }
3701        let _ = req.bytes().await?;
3702        return Ok(GenerateTokenResponse::Unknown);
3703    }
3704}
3705/// Response types for generateToken
3706#[derive(Debug, Clone)]
3707pub enum GenerateTokenResponse {
3708    ///200: Returns a token response.
3709    Ok(TokenResponse),
3710    ///400: Returns a [Problem detail](https://datatracker.ietf.org/doc/html/rfc9457) instance representing a bad request.
3711    BadRequest,
3712    ///500: Returns a [Problem detail](https://datatracker.ietf.org/doc/html/rfc9457) instance representing an internal server error.
3713    InternalServerError,
3714    ///default: Unknown response
3715    Unknown,
3716}
3717/// Returns a summary of an account's market value, by currency and asset class.
3718#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
3719pub struct GetAccountMarketSummaryRequest {
3720    #[validate(nested)]
3721    pub path: GetAccountMarketSummaryRequestPath,
3722}
3723impl GetAccountMarketSummaryRequest {
3724    /// Parse the HTTP response into the response enum.
3725    pub async fn parse_response(
3726        req: reqwest::Response,
3727    ) -> anyhow::Result<GetAccountMarketSummaryResponse> {
3728        let status = req.status();
3729        if status == http::StatusCode::OK {
3730            let data =
3731                oas3_gen_support::Diagnostics::<SummaryMarketValueResponse>::json_with_diagnostics(
3732                    req,
3733                )
3734                .await?;
3735            return Ok(GetAccountMarketSummaryResponse::Ok(data));
3736        }
3737        if status == http::StatusCode::BAD_REQUEST {
3738            let _ = req.bytes().await?;
3739            return Ok(GetAccountMarketSummaryResponse::BadRequest);
3740        }
3741        if status == http::StatusCode::UNAUTHORIZED {
3742            let _ = req.bytes().await?;
3743            return Ok(GetAccountMarketSummaryResponse::Unauthorized);
3744        }
3745        if status == http::StatusCode::SERVICE_UNAVAILABLE {
3746            let _ = req.bytes().await?;
3747            return Ok(GetAccountMarketSummaryResponse::ServiceUnavailable);
3748        }
3749        let _ = req.bytes().await?;
3750        return Ok(GetAccountMarketSummaryResponse::Unknown);
3751    }
3752}
3753#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
3754pub struct GetAccountMarketSummaryRequestPath {
3755    /// Pass the account identifier to receive information for.
3756    /// - Example: `"U1234567".to_string()`
3757    #[validate(length(min = 1u64))]
3758    pub account_id: String,
3759}
3760/// Response types for getAccountMarketSummary
3761#[derive(Debug, Clone)]
3762pub enum GetAccountMarketSummaryResponse {
3763    ///200: Indicates a successful market value request.
3764    Ok(SummaryMarketValueResponse),
3765    ///400: bad request; passed input cannot pass initial validation and detected right away
3766    BadRequest,
3767    ///401: Invalid or expired access token
3768    Unauthorized,
3769    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
3770     */
3771    ServiceUnavailable,
3772    ///default: Unknown response
3773    Unknown,
3774}
3775/// Receive a list of all applicant names on the account and for which account and entity is represented.
3776#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
3777pub struct GetAccountOwnersRequest {
3778    #[validate(nested)]
3779    pub path: GetAccountOwnersRequestPath,
3780}
3781impl GetAccountOwnersRequest {
3782    /// Parse the HTTP response into the response enum.
3783    pub async fn parse_response(
3784        req: reqwest::Response,
3785    ) -> anyhow::Result<GetAccountOwnersResponse> {
3786        let status = req.status();
3787        if status == http::StatusCode::OK {
3788            let data =
3789                oas3_gen_support::Diagnostics::<SignatureAndOwners>::json_with_diagnostics(req)
3790                    .await?;
3791            return Ok(GetAccountOwnersResponse::Ok(data));
3792        }
3793        if status == http::StatusCode::BAD_REQUEST {
3794            let _ = req.bytes().await?;
3795            return Ok(GetAccountOwnersResponse::BadRequest);
3796        }
3797        if status == http::StatusCode::UNAUTHORIZED {
3798            let _ = req.bytes().await?;
3799            return Ok(GetAccountOwnersResponse::Unauthorized);
3800        }
3801        if status == http::StatusCode::SERVICE_UNAVAILABLE {
3802            let _ = req.bytes().await?;
3803            return Ok(GetAccountOwnersResponse::ServiceUnavailable);
3804        }
3805        let _ = req.bytes().await?;
3806        return Ok(GetAccountOwnersResponse::Unknown);
3807    }
3808}
3809#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
3810pub struct GetAccountOwnersRequestPath {
3811    /// The account identifier to receive information for
3812    #[validate(length(min = 1u64))]
3813    pub account_id: String,
3814}
3815/// Response types for getAccountOwners
3816#[derive(Debug, Clone)]
3817pub enum GetAccountOwnersResponse {
3818    ///200: An object containing valid accounts and the account properties regarding trading access. This endpoint is also used to confirm account validation.
3819    Ok(SignatureAndOwners),
3820    ///400: bad request; accountId is empty
3821    BadRequest,
3822    ///401: Invalid or expired access token
3823    Unauthorized,
3824    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
3825     */
3826    ServiceUnavailable,
3827    ///default: Unknown response
3828    Unknown,
3829}
3830/// Provides a general overview of the account details such as balance values.
3831#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
3832pub struct GetAccountSummaryRequest {
3833    #[validate(nested)]
3834    pub path: GetAccountSummaryRequestPath,
3835}
3836impl GetAccountSummaryRequest {
3837    /// Parse the HTTP response into the response enum.
3838    pub async fn parse_response(
3839        req: reqwest::Response,
3840    ) -> anyhow::Result<GetAccountSummaryResponse> {
3841        let status = req.status();
3842        if status == http::StatusCode::OK {
3843            let data =
3844                oas3_gen_support::Diagnostics::<AccountSummaryResponse>::json_with_diagnostics(req)
3845                    .await?;
3846            return Ok(GetAccountSummaryResponse::Ok(data));
3847        }
3848        if status == http::StatusCode::BAD_REQUEST {
3849            let _ = req.bytes().await?;
3850            return Ok(GetAccountSummaryResponse::BadRequest);
3851        }
3852        if status == http::StatusCode::UNAUTHORIZED {
3853            let _ = req.bytes().await?;
3854            return Ok(GetAccountSummaryResponse::Unauthorized);
3855        }
3856        if status == http::StatusCode::SERVICE_UNAVAILABLE {
3857            let _ = req.bytes().await?;
3858            return Ok(GetAccountSummaryResponse::ServiceUnavailable);
3859        }
3860        let _ = req.bytes().await?;
3861        return Ok(GetAccountSummaryResponse::Unknown);
3862    }
3863}
3864#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
3865pub struct GetAccountSummaryRequestPath {
3866    /// Pass the account identifier to receive information for.
3867    /// - Example: `"U1234567".to_string()`
3868    #[validate(length(min = 1u64))]
3869    pub account_id: String,
3870}
3871/// Response types for getAccountSummary
3872#[derive(Debug, Clone)]
3873pub enum GetAccountSummaryResponse {
3874    ///200: Provides a general overview of the account details such as balance values.
3875    Ok(AccountSummaryResponse),
3876    ///400: bad request; passed input cannot pass initial validation and detected right away
3877    BadRequest,
3878    ///401: Invalid or expired access token
3879    Unauthorized,
3880    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
3881     */
3882    ServiceUnavailable,
3883    ///default: Unknown response
3884    Unknown,
3885}
3886/// Request all accounts held within a model.
3887#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
3888pub struct GetAccountsInModelRequest {
3889    pub body: DetailRequestBody,
3890}
3891impl GetAccountsInModelRequest {
3892    /// Parse the HTTP response into the response enum.
3893    pub async fn parse_response(
3894        req: reqwest::Response,
3895    ) -> anyhow::Result<GetAccountsInModelResponse> {
3896        let status = req.status();
3897        if status == http::StatusCode::OK {
3898            let data =
3899                oas3_gen_support::Diagnostics::<Detail200Response>::json_with_diagnostics(req)
3900                    .await?;
3901            return Ok(GetAccountsInModelResponse::Ok(data));
3902        }
3903        if status == http::StatusCode::UNAUTHORIZED {
3904            let _ = req.bytes().await?;
3905            return Ok(GetAccountsInModelResponse::Unauthorized);
3906        }
3907        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
3908            let _ = req.bytes().await?;
3909            return Ok(GetAccountsInModelResponse::InternalServerError);
3910        }
3911        if status == http::StatusCode::SERVICE_UNAVAILABLE {
3912            let _ = req.bytes().await?;
3913            return Ok(GetAccountsInModelResponse::ServiceUnavailable);
3914        }
3915        let _ = req.bytes().await?;
3916        return Ok(GetAccountsInModelResponse::Unknown);
3917    }
3918}
3919/// Response types for getAccountsInModel
3920#[derive(Debug, Clone)]
3921pub enum GetAccountsInModelResponse {
3922    ///200: Successfully retrieve account details of in a model.
3923    Ok(Detail200Response),
3924    ///401: Invalid or expired access token
3925    Unauthorized,
3926    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
3927     */
3928    InternalServerError,
3929    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
3930     */
3931    ServiceUnavailable,
3932    ///default: Unknown response
3933    Unknown,
3934}
3935/// Request details of a specific alert by providing the assigned alertId Id.
3936#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
3937pub struct GetAlertDetailsRequest {
3938    pub path: GetAlertDetailsRequestPath,
3939    pub query: GetAlertDetailsRequestQuery,
3940}
3941impl GetAlertDetailsRequest {
3942    /// Parse the HTTP response into the response enum.
3943    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAlertDetailsResponse> {
3944        let status = req.status();
3945        if status == http::StatusCode::OK {
3946            let data =
3947                oas3_gen_support::Diagnostics::<AlertDetails>::json_with_diagnostics(req).await?;
3948            return Ok(GetAlertDetailsResponse::Ok(data));
3949        }
3950        if status == http::StatusCode::BAD_REQUEST {
3951            let _ = req.bytes().await?;
3952            return Ok(GetAlertDetailsResponse::BadRequest);
3953        }
3954        if status == http::StatusCode::UNAUTHORIZED {
3955            let _ = req.bytes().await?;
3956            return Ok(GetAlertDetailsResponse::Unauthorized);
3957        }
3958        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
3959            let _ = req.bytes().await?;
3960            return Ok(GetAlertDetailsResponse::InternalServerError);
3961        }
3962        if status == http::StatusCode::SERVICE_UNAVAILABLE {
3963            let _ = req.bytes().await?;
3964            return Ok(GetAlertDetailsResponse::ServiceUnavailable);
3965        }
3966        let _ = req.bytes().await?;
3967        return Ok(GetAlertDetailsResponse::Unknown);
3968    }
3969}
3970#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
3971pub struct GetAlertDetailsRequestPath {
3972    /// alert identifier, internally referenced as order id
3973    pub alert_id: i64,
3974}
3975#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
3976pub struct GetAlertDetailsRequestQuery {
3977    /// queryType
3978    #[serde(rename = "type")]
3979    #[default("Q".to_string())]
3980    pub r#type: String,
3981}
3982/// Response types for getAlertDetails
3983#[derive(Debug, Clone)]
3984pub enum GetAlertDetailsResponse {
3985    ///200: An object containing all unique details of the specified alert.
3986    Ok(AlertDetails),
3987    ///400: bad request if orderId is empty or type is invalid
3988    BadRequest,
3989    ///401: Invalid or expired access token
3990    Unauthorized,
3991    ///500: orderId is not parsable; unable to process request
3992    InternalServerError,
3993    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
3994     */
3995    ServiceUnavailable,
3996    ///default: Unknown response
3997    Unknown,
3998}
3999/// Returns supported IB Algos for an instrument. A pre-flight request must be submitted before retrieving information.
4000#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4001pub struct GetAlgosByInstrumentRequest {
4002    #[validate(nested)]
4003    pub path: GetAlgosByInstrumentRequestPath,
4004    pub query: GetAlgosByInstrumentRequestQuery,
4005}
4006impl GetAlgosByInstrumentRequest {
4007    /// Parse the HTTP response into the response enum.
4008    pub async fn parse_response(
4009        req: reqwest::Response,
4010    ) -> anyhow::Result<GetAlgosByInstrumentResponse> {
4011        let status = req.status();
4012        if status == http::StatusCode::OK {
4013            let data =
4014                oas3_gen_support::Diagnostics::<AlgosResponse>::json_with_diagnostics(req).await?;
4015            return Ok(GetAlgosByInstrumentResponse::Ok(data));
4016        }
4017        if status == http::StatusCode::UNAUTHORIZED {
4018            let _ = req.bytes().await?;
4019            return Ok(GetAlgosByInstrumentResponse::Unauthorized);
4020        }
4021        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4022            let _ = req.bytes().await?;
4023            return Ok(GetAlgosByInstrumentResponse::InternalServerError);
4024        }
4025        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4026            let _ = req.bytes().await?;
4027            return Ok(GetAlgosByInstrumentResponse::ServiceUnavailable);
4028        }
4029        let _ = req.bytes().await?;
4030        return Ok(GetAlgosByInstrumentResponse::Unknown);
4031    }
4032}
4033#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
4034pub struct GetAlgosByInstrumentRequestPath {
4035    /// Contract identifier for the requested contract of interest.
4036    #[validate(length(min = 1u64))]
4037    pub conid: String,
4038}
4039#[serde_with::skip_serializing_none]
4040#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
4041pub struct GetAlgosByInstrumentRequestQuery {
4042    /// List of algo ids delimited by ";" to filter by. Max of 8 algos ids can be specified. Case sensitive to algo id.
4043    pub algos: Option<GetAlgosByInstrumentRequestQueryAlgos>,
4044    /// Whether or not to add algo descriptions to response. Set to 1 for yes, 0 for no.
4045    #[serde(rename = "addDescription")]
4046    #[default(Some(Default::default()))]
4047    pub add_description: Option<AlertActivationRequestAlertActive>,
4048    /// Whether or not to show algo parameters. Set to 1 for yes, 0 for no.
4049    #[serde(rename = "addParams")]
4050    #[default(Some(Default::default()))]
4051    pub add_params: Option<AlertActivationRequestAlertActive>,
4052}
4053/// List of algo ids delimited by ";" to filter by. Max of 8 algos ids can be specified. Case sensitive to algo id.
4054#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
4055pub enum GetAlgosByInstrumentRequestQueryAlgos {
4056    #[default]
4057    Adaptive,
4058    Vwap,
4059}
4060impl core::fmt::Display for GetAlgosByInstrumentRequestQueryAlgos {
4061    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4062        match self {
4063            Self::Adaptive => write!(f, "Adaptive"),
4064            Self::Vwap => write!(f, "Vwap"),
4065        }
4066    }
4067}
4068/// Response types for getAlgosByInstrument
4069#[derive(Debug, Clone)]
4070pub enum GetAlgosByInstrumentResponse {
4071    ///200: Returns a list of available algos and a description of their behavior.
4072    Ok(AlgosResponse),
4073    ///401: Invalid or expired access token
4074    Unauthorized,
4075    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4076     */
4077    InternalServerError,
4078    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4079     */
4080    ServiceUnavailable,
4081    ///default: Unknown response
4082    Unknown,
4083}
4084/// Get positions in accounts for a given instrument (no secDef await control)
4085#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4086pub struct GetAllAccountsForConidRequest {
4087    pub path: GetAllAccountsForConidRequestPath,
4088}
4089impl GetAllAccountsForConidRequest {
4090    /// Parse the HTTP response into the response enum.
4091    pub async fn parse_response(
4092        req: reqwest::Response,
4093    ) -> anyhow::Result<GetAllAccountsForConidResponse> {
4094        let status = req.status();
4095        if status == http::StatusCode::OK {
4096            let data =
4097                oas3_gen_support::Diagnostics::<Position200Response>::json_with_diagnostics(req)
4098                    .await?;
4099            return Ok(GetAllAccountsForConidResponse::Ok(data));
4100        }
4101        if status == http::StatusCode::BAD_REQUEST {
4102            let _ = req.bytes().await?;
4103            return Ok(GetAllAccountsForConidResponse::BadRequest);
4104        }
4105        if status == http::StatusCode::UNAUTHORIZED {
4106            let _ = req.bytes().await?;
4107            return Ok(GetAllAccountsForConidResponse::Unauthorized);
4108        }
4109        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4110            let _ = req.bytes().await?;
4111            return Ok(GetAllAccountsForConidResponse::InternalServerError);
4112        }
4113        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4114            let _ = req.bytes().await?;
4115            return Ok(GetAllAccountsForConidResponse::ServiceUnavailable);
4116        }
4117        let _ = req.bytes().await?;
4118        return Ok(GetAllAccountsForConidResponse::Unknown);
4119    }
4120}
4121#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
4122pub struct GetAllAccountsForConidRequestPath {
4123    /// Conid of the instrument for which positions are requested.
4124    /// - Example: `8_314i32`
4125    pub conid: i32,
4126}
4127/// Response types for getAllAccountsForConid
4128#[derive(Debug, Clone)]
4129pub enum GetAllAccountsForConidResponse {
4130    ///200: Object containing positions in the requested conid broken out by account.
4131    Ok(Position200Response),
4132    ///400: Invalid input format or missing required fields
4133    BadRequest,
4134    ///401: Invalid or expired access token
4135    Unauthorized,
4136    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4137     */
4138    InternalServerError,
4139    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4140     */
4141    ServiceUnavailable,
4142    ///default: Unknown response
4143    Unknown,
4144}
4145/// return accounts
4146#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4147pub struct GetAllAccountsRequest {}
4148impl GetAllAccountsRequest {
4149    /// Parse the HTTP response into the response enum.
4150    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAllAccountsResponse> {
4151        let status = req.status();
4152        if status == http::StatusCode::OK {
4153            let data =
4154                oas3_gen_support::Diagnostics::<Account200Response2>::json_with_diagnostics(req)
4155                    .await?;
4156            return Ok(GetAllAccountsResponse::Ok(data));
4157        }
4158        if status == http::StatusCode::UNAUTHORIZED {
4159            let _ = req.bytes().await?;
4160            return Ok(GetAllAccountsResponse::Unauthorized);
4161        }
4162        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4163            let _ = req.bytes().await?;
4164            return Ok(GetAllAccountsResponse::InternalServerError);
4165        }
4166        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4167            let _ = req.bytes().await?;
4168            return Ok(GetAllAccountsResponse::ServiceUnavailable);
4169        }
4170        let _ = req.bytes().await?;
4171        return Ok(GetAllAccountsResponse::Unknown);
4172    }
4173}
4174/// Response types for getAllAccounts
4175#[derive(Debug, Clone)]
4176pub enum GetAllAccountsResponse {
4177    ///200: returned array with user account
4178    Ok(Account200Response2),
4179    ///401: Invalid or expired access token
4180    Unauthorized,
4181    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4182     */
4183    InternalServerError,
4184    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4185     */
4186    ServiceUnavailable,
4187    ///default: Unknown response
4188    Unknown,
4189}
4190/// Retrieve a list of all alerts attached to the provided account.
4191#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4192pub struct GetAllAlertsRequest {
4193    #[validate(nested)]
4194    pub path: GetAllAlertsRequestPath,
4195}
4196impl GetAllAlertsRequest {
4197    /// Parse the HTTP response into the response enum.
4198    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAllAlertsResponse> {
4199        let status = req.status();
4200        if status == http::StatusCode::OK {
4201            let data = oas3_gen_support::Diagnostics::<Alerts>::json_with_diagnostics(req).await?;
4202            return Ok(GetAllAlertsResponse::Ok(data));
4203        }
4204        if status == http::StatusCode::UNAUTHORIZED {
4205            let _ = req.bytes().await?;
4206            return Ok(GetAllAlertsResponse::Unauthorized);
4207        }
4208        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4209            let _ = req.bytes().await?;
4210            return Ok(GetAllAlertsResponse::ServiceUnavailable);
4211        }
4212        let _ = req.bytes().await?;
4213        return Ok(GetAllAlertsResponse::Unknown);
4214    }
4215}
4216#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
4217pub struct GetAllAlertsRequestPath {
4218    /// Identifier for the unique account to retrieve information from.
4219    /// - Example: `"U1234567".to_string()`
4220    #[validate(length(min = 1u64))]
4221    pub account_id: String,
4222}
4223/// Response types for getAllAlerts
4224#[derive(Debug, Clone)]
4225pub enum GetAllAlertsResponse {
4226    ///200: An array of objects detailing contract information.
4227    Ok(Alerts),
4228    ///401: Invalid or expired access token
4229    Unauthorized,
4230    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4231     */
4232    ServiceUnavailable,
4233    ///default: Unknown response
4234    Unknown,
4235}
4236/// Get a list of available notifications.
4237#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4238pub struct GetAllFyisRequest {
4239    pub query: GetAllFyisRequestQuery,
4240}
4241impl GetAllFyisRequest {
4242    /// Parse the HTTP response into the response enum.
4243    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAllFyisResponse> {
4244        let status = req.status();
4245        if status == http::StatusCode::OK {
4246            let data =
4247                oas3_gen_support::Diagnostics::<Notifications>::json_with_diagnostics(req).await?;
4248            return Ok(GetAllFyisResponse::Ok(data));
4249        }
4250        if status == http::StatusCode::BAD_REQUEST {
4251            let _ = req.bytes().await?;
4252            return Ok(GetAllFyisResponse::BadRequest);
4253        }
4254        if status == http::StatusCode::UNAUTHORIZED {
4255            let _ = req.bytes().await?;
4256            return Ok(GetAllFyisResponse::Unauthorized);
4257        }
4258        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4259            let _ = req.bytes().await?;
4260            return Ok(GetAllFyisResponse::InternalServerError);
4261        }
4262        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4263            let _ = req.bytes().await?;
4264            return Ok(GetAllFyisResponse::ServiceUnavailable);
4265        }
4266        let _ = req.bytes().await?;
4267        return Ok(GetAllFyisResponse::Unknown);
4268    }
4269}
4270#[serde_with::skip_serializing_none]
4271#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
4272pub struct GetAllFyisRequestQuery {
4273    /// Specify the maximum number of notifications to receive. Can request a maximum of 10 notifications.
4274    /// - Example: `10i32`
4275    pub max: i32,
4276    /// Include only the specified typecode notifications in the request.
4277    pub include: Option<serde_json::Value>,
4278    /// Include all subscribed notifications except the typecodes passed here.
4279    pub exclude: Option<serde_json::Value>,
4280    /// if more required, notifcationId of last notification should be used to define next batch border
4281    pub id: Option<serde_json::Value>,
4282}
4283/// Response types for getAllFyis
4284#[derive(Debug, Clone)]
4285pub enum GetAllFyisResponse {
4286    ///200: Successfully enabled or disabled your email notifications.
4287    Ok(Notifications),
4288    ///400: Invalid input format or missing required fields
4289    BadRequest,
4290    ///401: Invalid or expired access token
4291    Unauthorized,
4292    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4293     */
4294    InternalServerError,
4295    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4296     */
4297    ServiceUnavailable,
4298    ///default: Unknown response
4299    Unknown,
4300}
4301/// Request all positions held within the model.
4302#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4303pub struct GetAllModelPositionsRequest {
4304    pub body: PositionRequestBody2,
4305}
4306impl GetAllModelPositionsRequest {
4307    /// Parse the HTTP response into the response enum.
4308    pub async fn parse_response(
4309        req: reqwest::Response,
4310    ) -> anyhow::Result<GetAllModelPositionsResponse> {
4311        let status = req.status();
4312        if status == http::StatusCode::OK {
4313            let data =
4314                oas3_gen_support::Diagnostics::<ModelPositionResponse>::json_with_diagnostics(req)
4315                    .await?;
4316            return Ok(GetAllModelPositionsResponse::Ok(data));
4317        }
4318        if status == http::StatusCode::UNAUTHORIZED {
4319            let _ = req.bytes().await?;
4320            return Ok(GetAllModelPositionsResponse::Unauthorized);
4321        }
4322        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4323            let _ = req.bytes().await?;
4324            return Ok(GetAllModelPositionsResponse::InternalServerError);
4325        }
4326        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4327            let _ = req.bytes().await?;
4328            return Ok(GetAllModelPositionsResponse::ServiceUnavailable);
4329        }
4330        let _ = req.bytes().await?;
4331        return Ok(GetAllModelPositionsResponse::Unknown);
4332    }
4333}
4334/// Response types for getAllModelPositions
4335#[derive(Debug, Clone)]
4336pub enum GetAllModelPositionsResponse {
4337    ///200: Successfully retrieve position details
4338    Ok(ModelPositionResponse),
4339    ///401: Invalid or expired access token
4340    Unauthorized,
4341    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4342     */
4343    InternalServerError,
4344    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4345     */
4346    ServiceUnavailable,
4347    ///default: Unknown response
4348    Unknown,
4349}
4350/// Retrieve attributes of the subaccounts in the account structure.
4351#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4352pub struct GetAllSubaccountsRequest {}
4353impl GetAllSubaccountsRequest {
4354    /// Parse the HTTP response into the response enum.
4355    pub async fn parse_response(
4356        req: reqwest::Response,
4357    ) -> anyhow::Result<GetAllSubaccountsResponse> {
4358        let status = req.status();
4359        if status == http::StatusCode::OK {
4360            let data =
4361                oas3_gen_support::Diagnostics::<Subaccount200Response>::json_with_diagnostics(req)
4362                    .await?;
4363            return Ok(GetAllSubaccountsResponse::Ok(data));
4364        }
4365        if status == http::StatusCode::UNAUTHORIZED {
4366            let _ = req.bytes().await?;
4367            return Ok(GetAllSubaccountsResponse::Unauthorized);
4368        }
4369        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4370            let _ = req.bytes().await?;
4371            return Ok(GetAllSubaccountsResponse::InternalServerError);
4372        }
4373        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4374            let _ = req.bytes().await?;
4375            return Ok(GetAllSubaccountsResponse::ServiceUnavailable);
4376        }
4377        let _ = req.bytes().await?;
4378        return Ok(GetAllSubaccountsResponse::Unknown);
4379    }
4380}
4381/// Response types for getAllSubaccounts
4382#[derive(Debug, Clone)]
4383pub enum GetAllSubaccountsResponse {
4384    ///200: Array of objects representing accounts in the structure.
4385    Ok(Subaccount200Response),
4386    ///401: Invalid or expired access token
4387    Unauthorized,
4388    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4389     */
4390    InternalServerError,
4391    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4392     */
4393    ServiceUnavailable,
4394    ///default: Unknown response
4395    Unknown,
4396}
4397/// Returns all saved watchlists stored on IB backend for the username in use in the current Web API session.
4398#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4399pub struct GetAllWatchlistsRequest {
4400    pub query: GetAllWatchlistsRequestQuery,
4401}
4402impl GetAllWatchlistsRequest {
4403    /// Parse the HTTP response into the response enum.
4404    pub async fn parse_response(
4405        req: reqwest::Response,
4406    ) -> anyhow::Result<GetAllWatchlistsResponse> {
4407        let status = req.status();
4408        if status == http::StatusCode::OK {
4409            let data =
4410                oas3_gen_support::Diagnostics::<WatchlistsResponse>::json_with_diagnostics(req)
4411                    .await?;
4412            return Ok(GetAllWatchlistsResponse::Ok(data));
4413        }
4414        if status == http::StatusCode::UNAUTHORIZED {
4415            let _ = req.bytes().await?;
4416            return Ok(GetAllWatchlistsResponse::Unauthorized);
4417        }
4418        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4419            let _ = req.bytes().await?;
4420            return Ok(GetAllWatchlistsResponse::InternalServerError);
4421        }
4422        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4423            let _ = req.bytes().await?;
4424            return Ok(GetAllWatchlistsResponse::ServiceUnavailable);
4425        }
4426        let _ = req.bytes().await?;
4427        return Ok(GetAllWatchlistsResponse::Unknown);
4428    }
4429}
4430#[serde_with::skip_serializing_none]
4431#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
4432pub struct GetAllWatchlistsRequestQuery {
4433    /// Can only be used with value USER_WATCHLIST, which returns only user-created watchlists and excludes those created by IB.
4434    /// - Example: `Some("USER_WATCHLIST".to_string())`
4435    #[serde(rename = "SC")]
4436    #[default(Some("USER_WATCHLIST".to_string()))]
4437    pub sc: Option<String>,
4438}
4439/// Response types for getAllWatchlists
4440#[derive(Debug, Clone)]
4441pub enum GetAllWatchlistsResponse {
4442    ///200: Historical data query successfully returned data.
4443    Ok(WatchlistsResponse),
4444    ///401: Invalid or expired access token
4445    Unauthorized,
4446    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4447     */
4448    InternalServerError,
4449    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4450     */
4451    ServiceUnavailable,
4452    ///default: Unknown response
4453    Unknown,
4454}
4455/// Retrieve summaries for all models under the advisor account.
4456#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4457pub struct GetAllmodelsRequest {
4458    pub body: ReqIDRequestBody,
4459}
4460impl GetAllmodelsRequest {
4461    /// Parse the HTTP response into the response enum.
4462    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAllmodelsResponse> {
4463        let status = req.status();
4464        if status == http::StatusCode::OK {
4465            let data =
4466                oas3_gen_support::Diagnostics::<ModelListResponse>::json_with_diagnostics(req)
4467                    .await?;
4468            return Ok(GetAllmodelsResponse::Ok(data));
4469        }
4470        if status == http::StatusCode::UNAUTHORIZED {
4471            let _ = req.bytes().await?;
4472            return Ok(GetAllmodelsResponse::Unauthorized);
4473        }
4474        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4475            let _ = req.bytes().await?;
4476            return Ok(GetAllmodelsResponse::InternalServerError);
4477        }
4478        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4479            let _ = req.bytes().await?;
4480            return Ok(GetAllmodelsResponse::ServiceUnavailable);
4481        }
4482        let _ = req.bytes().await?;
4483        return Ok(GetAllmodelsResponse::Unknown);
4484    }
4485}
4486/// Response types for getAllmodels
4487#[derive(Debug, Clone)]
4488pub enum GetAllmodelsResponse {
4489    ///200: Successfully retrieve the model list
4490    Ok(ModelListResponse),
4491    ///401: Invalid or expired access token
4492    Unauthorized,
4493    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4494     */
4495    InternalServerError,
4496    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4497     */
4498    ServiceUnavailable,
4499    ///default: Unknown response
4500    Unknown,
4501}
4502/// Retrieves a list of all sub-accounts and returns their net liquidity and available equity for advisors to make decisions on what accounts should be allocated and how. This endpoint is only supported for Financial Advisors and IBroker Accounts.
4503#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4504pub struct GetAllocatableSubaccountsRequest {}
4505impl GetAllocatableSubaccountsRequest {
4506    /// Parse the HTTP response into the response enum.
4507    pub async fn parse_response(
4508        req: reqwest::Response,
4509    ) -> anyhow::Result<GetAllocatableSubaccountsResponse> {
4510        let status = req.status();
4511        if status == http::StatusCode::OK {
4512            let data =
4513                oas3_gen_support::Diagnostics::<SubAccounts>::json_with_diagnostics(req).await?;
4514            return Ok(GetAllocatableSubaccountsResponse::Ok(data));
4515        }
4516        if status == http::StatusCode::UNAUTHORIZED {
4517            let _ = req.bytes().await?;
4518            return Ok(GetAllocatableSubaccountsResponse::Unauthorized);
4519        }
4520        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4521            let _ = req.bytes().await?;
4522            return Ok(GetAllocatableSubaccountsResponse::InternalServerError);
4523        }
4524        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4525            let _ = req.bytes().await?;
4526            return Ok(GetAllocatableSubaccountsResponse::ServiceUnavailable);
4527        }
4528        let _ = req.bytes().await?;
4529        return Ok(GetAllocatableSubaccountsResponse::Unknown);
4530    }
4531}
4532/// Response types for getAllocatableSubaccounts
4533#[derive(Debug, Clone)]
4534pub enum GetAllocatableSubaccountsResponse {
4535    ///200: Indicates data is being returned successfully.
4536    Ok(SubAccounts),
4537    ///401: Invalid or expired access token
4538    Unauthorized,
4539    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4540     */
4541    InternalServerError,
4542    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4543     */
4544    ServiceUnavailable,
4545    ///default: Unknown response
4546    Unknown,
4547}
4548/// Retrieves a list of all of the advisor's allocation groups. This describes the name of the allocation group, number of subaccounts within the group, and the method in use for the group. This endpoint is only supported for Financial Advisors and IBroker Accounts.
4549#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4550pub struct GetAllocationGroupsRequest {}
4551impl GetAllocationGroupsRequest {
4552    /// Parse the HTTP response into the response enum.
4553    pub async fn parse_response(
4554        req: reqwest::Response,
4555    ) -> anyhow::Result<GetAllocationGroupsResponse> {
4556        let status = req.status();
4557        if status == http::StatusCode::OK {
4558            let data =
4559                oas3_gen_support::Diagnostics::<AllocationGroups>::json_with_diagnostics(req)
4560                    .await?;
4561            return Ok(GetAllocationGroupsResponse::Ok(data));
4562        }
4563        if status == http::StatusCode::UNAUTHORIZED {
4564            let _ = req.bytes().await?;
4565            return Ok(GetAllocationGroupsResponse::Unauthorized);
4566        }
4567        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4568            let _ = req.bytes().await?;
4569            return Ok(GetAllocationGroupsResponse::InternalServerError);
4570        }
4571        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4572            let _ = req.bytes().await?;
4573            return Ok(GetAllocationGroupsResponse::ServiceUnavailable);
4574        }
4575        let _ = req.bytes().await?;
4576        return Ok(GetAllocationGroupsResponse::Unknown);
4577    }
4578}
4579/// Response types for getAllocationGroups
4580#[derive(Debug, Clone)]
4581pub enum GetAllocationGroupsResponse {
4582    ///200: Returns the "data" array, which contains all allocation groups under the advisor account.
4583    Ok(AllocationGroups),
4584    ///401: Invalid or expired access token
4585    Unauthorized,
4586    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4587     */
4588    InternalServerError,
4589    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4590     */
4591    ServiceUnavailable,
4592    ///default: Unknown response
4593    Unknown,
4594}
4595/// Retrieve the preset behavior for allocation groups for specific events. This endpoint is only supported for Financial Advisors and IBroker Accounts.
4596#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4597pub struct GetAllocationPresetsRequest {}
4598impl GetAllocationPresetsRequest {
4599    /// Parse the HTTP response into the response enum.
4600    pub async fn parse_response(
4601        req: reqwest::Response,
4602    ) -> anyhow::Result<GetAllocationPresetsResponse> {
4603        let status = req.status();
4604        if status == http::StatusCode::OK {
4605            let data = oas3_gen_support::Diagnostics::<Presets>::json_with_diagnostics(req).await?;
4606            return Ok(GetAllocationPresetsResponse::Ok(data));
4607        }
4608        if status == http::StatusCode::UNAUTHORIZED {
4609            let _ = req.bytes().await?;
4610            return Ok(GetAllocationPresetsResponse::Unauthorized);
4611        }
4612        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4613            let _ = req.bytes().await?;
4614            return Ok(GetAllocationPresetsResponse::InternalServerError);
4615        }
4616        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4617            let _ = req.bytes().await?;
4618            return Ok(GetAllocationPresetsResponse::ServiceUnavailable);
4619        }
4620        let _ = req.bytes().await?;
4621        return Ok(GetAllocationPresetsResponse::Unknown);
4622    }
4623}
4624/// Response types for getAllocationPresets
4625#[derive(Debug, Clone)]
4626pub enum GetAllocationPresetsResponse {
4627    ///200: Successfully retrieve preset details
4628    Ok(Presets),
4629    ///401: Invalid or expired access token
4630    Unauthorized,
4631    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4632     */
4633    InternalServerError,
4634    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4635     */
4636    ServiceUnavailable,
4637    ///default: Unknown response
4638    Unknown,
4639}
4640/// Get an account's allocations by asset class, sector group, and sector.
4641#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4642pub struct GetAssetAllocationRequest {
4643    #[validate(nested)]
4644    pub path: GetAssetAllocationRequestPath,
4645    pub query: GetAssetAllocationRequestQuery,
4646}
4647impl GetAssetAllocationRequest {
4648    /// Parse the HTTP response into the response enum.
4649    pub async fn parse_response(
4650        req: reqwest::Response,
4651    ) -> anyhow::Result<GetAssetAllocationResponse> {
4652        let status = req.status();
4653        if status == http::StatusCode::OK {
4654            let data =
4655                oas3_gen_support::Diagnostics::<PortfolioAllocations>::json_with_diagnostics(req)
4656                    .await?;
4657            return Ok(GetAssetAllocationResponse::Ok(data));
4658        }
4659        if status == http::StatusCode::BAD_REQUEST {
4660            let _ = req.bytes().await?;
4661            return Ok(GetAssetAllocationResponse::BadRequest);
4662        }
4663        if status == http::StatusCode::UNAUTHORIZED {
4664            let _ = req.bytes().await?;
4665            return Ok(GetAssetAllocationResponse::Unauthorized);
4666        }
4667        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4668            let _ = req.bytes().await?;
4669            return Ok(GetAssetAllocationResponse::InternalServerError);
4670        }
4671        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4672            let _ = req.bytes().await?;
4673            return Ok(GetAssetAllocationResponse::ServiceUnavailable);
4674        }
4675        let _ = req.bytes().await?;
4676        return Ok(GetAssetAllocationResponse::Unknown);
4677    }
4678}
4679#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
4680pub struct GetAssetAllocationRequestPath {
4681    /// Account ID whose allocations are requested.
4682    #[validate(length(min = 1u64))]
4683    pub account_id: String,
4684}
4685#[serde_with::skip_serializing_none]
4686#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
4687pub struct GetAssetAllocationRequestQuery {
4688    /// model
4689    pub model: Option<serde_json::Value>,
4690}
4691/// Response types for getAssetAllocation
4692#[derive(Debug, Clone)]
4693pub enum GetAssetAllocationResponse {
4694    ///200: response with allocations
4695    Ok(PortfolioAllocations),
4696    ///400: Invalid input format or missing required fields
4697    BadRequest,
4698    ///401: Invalid or expired access token
4699    Unauthorized,
4700    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4701     */
4702    InternalServerError,
4703    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4704     */
4705    ServiceUnavailable,
4706    ///default: Unknown response
4707    Unknown,
4708}
4709#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
4710pub struct GetAvailableStmtDatesResponse {
4711    pub data: Option<AvailableStatementDatesData>,
4712}
4713#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
4714pub struct GetAvailableTaxFormsResponse {
4715    pub data: Option<AvailableTaxFormsData>,
4716}
4717#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
4718pub struct GetAvailableTradeConfirmationDatesResponse {
4719    pub data: Option<GetAvailableTradeConfirmationDatesResponseData>,
4720}
4721#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
4722pub struct GetAvailableTradeConfirmationDatesResponseData {
4723    /// - Example: `Some("String".to_string())`
4724    #[serde(rename = "dataType")]
4725    pub data_type: Option<String>,
4726    /// available trade confirmation dates
4727    pub value: Option<Vec<String>>,
4728}
4729/// Returns a summary of an account's equity and cash balances, in total and by account segment.
4730#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4731pub struct GetBalanceSummaryRequest {
4732    #[validate(nested)]
4733    pub path: GetBalanceSummaryRequestPath,
4734}
4735impl GetBalanceSummaryRequest {
4736    /// Parse the HTTP response into the response enum.
4737    pub async fn parse_response(
4738        req: reqwest::Response,
4739    ) -> anyhow::Result<GetBalanceSummaryResponse> {
4740        let status = req.status();
4741        if status == http::StatusCode::OK {
4742            let data = oas3_gen_support::Diagnostics::<
4743                SummaryOfAccountBalancesResponse,
4744            >::json_with_diagnostics(req)
4745                .await?;
4746            return Ok(GetBalanceSummaryResponse::Ok(data));
4747        }
4748        if status == http::StatusCode::BAD_REQUEST {
4749            let _ = req.bytes().await?;
4750            return Ok(GetBalanceSummaryResponse::BadRequest);
4751        }
4752        if status == http::StatusCode::UNAUTHORIZED {
4753            let _ = req.bytes().await?;
4754            return Ok(GetBalanceSummaryResponse::Unauthorized);
4755        }
4756        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4757            let _ = req.bytes().await?;
4758            return Ok(GetBalanceSummaryResponse::ServiceUnavailable);
4759        }
4760        let _ = req.bytes().await?;
4761        return Ok(GetBalanceSummaryResponse::Unknown);
4762    }
4763}
4764#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
4765pub struct GetBalanceSummaryRequestPath {
4766    /// Pass the account identifier to receive information for.
4767    /// - Example: `"U1234567".to_string()`
4768    #[validate(length(min = 1u64))]
4769    pub account_id: String,
4770}
4771/// Response types for getBalanceSummary
4772#[derive(Debug, Clone)]
4773pub enum GetBalanceSummaryResponse {
4774    ///200: Indicates a successful return of available funds.
4775    Ok(SummaryOfAccountBalancesResponse),
4776    ///400: bad request; passed input cannot pass initial validation and detected right away
4777    BadRequest,
4778    ///401: Invalid or expired access token
4779    Unauthorized,
4780    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4781     */
4782    ServiceUnavailable,
4783    ///default: Unknown response
4784    Unknown,
4785}
4786/// Request a list of filters relating to a given Bond issuerID. The issuerId is retrieved from /iserver/secdef/search and can be used in /iserver/secdef/info?issuerId={issuerId} for retrieving conIds.
4787#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4788pub struct GetBondFiltersRequest {
4789    #[validate(nested)]
4790    pub query: GetBondFiltersRequestQuery,
4791}
4792impl GetBondFiltersRequest {
4793    /// Parse the HTTP response into the response enum.
4794    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetBondFiltersResponse> {
4795        let status = req.status();
4796        if status == http::StatusCode::OK {
4797            let data =
4798                oas3_gen_support::Diagnostics::<BondFiltersResponse>::json_with_diagnostics(req)
4799                    .await?;
4800            return Ok(GetBondFiltersResponse::Ok(data));
4801        }
4802        if status == http::StatusCode::UNAUTHORIZED {
4803            let _ = req.bytes().await?;
4804            return Ok(GetBondFiltersResponse::Unauthorized);
4805        }
4806        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4807            let _ = req.bytes().await?;
4808            return Ok(GetBondFiltersResponse::InternalServerError);
4809        }
4810        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4811            let _ = req.bytes().await?;
4812            return Ok(GetBondFiltersResponse::ServiceUnavailable);
4813        }
4814        let _ = req.bytes().await?;
4815        return Ok(GetBondFiltersResponse::Unknown);
4816    }
4817}
4818#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
4819pub struct GetBondFiltersRequestQuery {
4820    /// This should always be set to "BOND"
4821    /// - Example: `"BOND".to_string()`
4822    #[validate(length(min = 1u64))]
4823    pub symbol: String,
4824    /// Specifies the issuerId of the bond issuer type. IssuerId can be retrieved from the /iserver/secdef/search endpoint searching for a genric bond symbol and using the BOND secType.
4825    /// - Example: `"e1400715".to_string()`
4826    #[serde(rename = "issuerId")]
4827    #[validate(length(min = 1u64))]
4828    pub issuer_id: String,
4829}
4830/// Response types for getBondFilters
4831#[derive(Debug, Clone)]
4832pub enum GetBondFiltersResponse {
4833    ///200: Successful requests return the currency exchange rate of the target currency value divided by the source currency.
4834    Ok(BondFiltersResponse),
4835    ///401: Invalid or expired access token
4836    Unauthorized,
4837    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4838     */
4839    InternalServerError,
4840    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4841     */
4842    ServiceUnavailable,
4843    ///default: Unknown response
4844    Unknown,
4845}
4846#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
4847pub struct GetBrokerListResponse {
4848    pub brokers: Vec<String>,
4849    /// - Example: `"COMPLEX_ASSET_TRANSFER".to_string()`
4850    #[serde(rename = "instructionType")]
4851    pub instruction_type: String,
4852}
4853/// Returns a list of accounts the user has trading access to, their respective aliases and the currently selected account. Note this endpoint must be called before modifying an order or querying open orders.
4854#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4855pub struct GetBrokerageAccountsRequest {}
4856impl GetBrokerageAccountsRequest {
4857    /// Parse the HTTP response into the response enum.
4858    pub async fn parse_response(
4859        req: reqwest::Response,
4860    ) -> anyhow::Result<GetBrokerageAccountsResponse> {
4861        let status = req.status();
4862        if status == http::StatusCode::OK {
4863            let data =
4864                oas3_gen_support::Diagnostics::<UserAccountsResponse>::json_with_diagnostics(req)
4865                    .await?;
4866            return Ok(GetBrokerageAccountsResponse::Ok(data));
4867        }
4868        if status == http::StatusCode::UNAUTHORIZED {
4869            let _ = req.bytes().await?;
4870            return Ok(GetBrokerageAccountsResponse::Unauthorized);
4871        }
4872        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4873            let _ = req.bytes().await?;
4874            return Ok(GetBrokerageAccountsResponse::ServiceUnavailable);
4875        }
4876        let _ = req.bytes().await?;
4877        return Ok(GetBrokerageAccountsResponse::Unknown);
4878    }
4879}
4880/// Response types for getBrokerageAccounts
4881#[derive(Debug, Clone)]
4882pub enum GetBrokerageAccountsResponse {
4883    ///200: An object containing valid accounts and the account properties regarding trading access. This endpoint is also used to confirm account validation.
4884    Ok(UserAccountsResponse),
4885    ///401: Invalid or expired access token
4886    Unauthorized,
4887    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4888     */
4889    ServiceUnavailable,
4890    ///default: Unknown response
4891    Unknown,
4892}
4893/// Current Authentication status to the Brokerage system. Market Data and Trading is not possible if not authenticated.
4894#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4895pub struct GetBrokerageStatusRequest {}
4896impl GetBrokerageStatusRequest {
4897    /// Parse the HTTP response into the response enum.
4898    pub async fn parse_response(
4899        req: reqwest::Response,
4900    ) -> anyhow::Result<GetBrokerageStatusResponse> {
4901        let status = req.status();
4902        if status == http::StatusCode::OK {
4903            let data =
4904                oas3_gen_support::Diagnostics::<BrokerageSessionStatus>::json_with_diagnostics(req)
4905                    .await?;
4906            return Ok(GetBrokerageStatusResponse::Ok(data));
4907        }
4908        if status == http::StatusCode::UNAUTHORIZED {
4909            let _ = req.bytes().await?;
4910            return Ok(GetBrokerageStatusResponse::Unauthorized);
4911        }
4912        let _ = req.bytes().await?;
4913        return Ok(GetBrokerageStatusResponse::Unknown);
4914    }
4915}
4916/// Response types for getBrokerageStatus
4917#[derive(Debug, Clone)]
4918pub enum GetBrokerageStatusResponse {
4919    ///200: Detailed status of the Brokerage session
4920    Ok(BrokerageSessionStatus),
4921    ///401: Invalid or expired access token
4922    Unauthorized,
4923    ///default: Unknown response
4924    Unknown,
4925}
4926/// Provides all positions held in the account acquired as a combination, including values such as ratios, size, and market value.
4927#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4928pub struct GetComboPositionsRequest {
4929    #[validate(nested)]
4930    pub path: GetComboPositionsRequestPath,
4931    pub query: GetComboPositionsRequestQuery,
4932}
4933impl GetComboPositionsRequest {
4934    /// Parse the HTTP response into the response enum.
4935    pub async fn parse_response(
4936        req: reqwest::Response,
4937    ) -> anyhow::Result<GetComboPositionsResponse> {
4938        let status = req.status();
4939        if status == http::StatusCode::OK {
4940            let data =
4941                oas3_gen_support::Diagnostics::<ComboPositionResponse>::json_with_diagnostics(req)
4942                    .await?;
4943            return Ok(GetComboPositionsResponse::Ok(data));
4944        }
4945        if status == http::StatusCode::UNAUTHORIZED {
4946            let _ = req.bytes().await?;
4947            return Ok(GetComboPositionsResponse::Unauthorized);
4948        }
4949        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
4950            let _ = req.bytes().await?;
4951            return Ok(GetComboPositionsResponse::InternalServerError);
4952        }
4953        if status == http::StatusCode::SERVICE_UNAVAILABLE {
4954            let _ = req.bytes().await?;
4955            return Ok(GetComboPositionsResponse::ServiceUnavailable);
4956        }
4957        let _ = req.bytes().await?;
4958        return Ok(GetComboPositionsResponse::Unknown);
4959    }
4960}
4961#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
4962pub struct GetComboPositionsRequestPath {
4963    #[validate(length(min = 1u64))]
4964    pub account_id: String,
4965}
4966#[serde_with::skip_serializing_none]
4967#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
4968pub struct GetComboPositionsRequestQuery {
4969    /// Set if request should be made without caching.
4970    #[default(Some(false))]
4971    pub nocache: Option<bool>,
4972}
4973/// Response types for getComboPositions
4974#[derive(Debug, Clone)]
4975pub enum GetComboPositionsResponse {
4976    ///200: response with combo position definitions
4977    Ok(ComboPositionResponse),
4978    ///401: Invalid or expired access token
4979    Unauthorized,
4980    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
4981     */
4982    InternalServerError,
4983    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
4984     */
4985    ServiceUnavailable,
4986    ///default: Unknown response
4987    Unknown,
4988}
4989/// Send out a request to retrieve all contracts made available on a requested exchange. This returns all contracts that are tradable on the exchange, even those that are not using the exchange as their primary listing.
4990#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
4991pub struct GetConidsByExchangeRequest {
4992    #[validate(nested)]
4993    pub query: GetConidsByExchangeRequestQuery,
4994}
4995impl GetConidsByExchangeRequest {
4996    /// Parse the HTTP response into the response enum.
4997    pub async fn parse_response(
4998        req: reqwest::Response,
4999    ) -> anyhow::Result<GetConidsByExchangeResponse> {
5000        let status = req.status();
5001        if status == http::StatusCode::OK {
5002            let data =
5003                oas3_gen_support::Diagnostics::<Vec<serde_json::Value>>::json_with_diagnostics(req)
5004                    .await?;
5005            return Ok(GetConidsByExchangeResponse::Ok(data));
5006        }
5007        if status == http::StatusCode::UNAUTHORIZED {
5008            let _ = req.bytes().await?;
5009            return Ok(GetConidsByExchangeResponse::Unauthorized);
5010        }
5011        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5012            let _ = req.bytes().await?;
5013            return Ok(GetConidsByExchangeResponse::InternalServerError);
5014        }
5015        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5016            let _ = req.bytes().await?;
5017            return Ok(GetConidsByExchangeResponse::ServiceUnavailable);
5018        }
5019        let _ = req.bytes().await?;
5020        return Ok(GetConidsByExchangeResponse::Unknown);
5021    }
5022}
5023#[serde_with::skip_serializing_none]
5024#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5025pub struct GetConidsByExchangeRequestQuery {
5026    /// Exchange from which derivatives should be retrieved from.
5027    /// - Example: `"AMEX".to_string()`
5028    #[validate(length(min = 1u64))]
5029    pub exchange: String,
5030    /// asset class
5031    #[serde(rename = "assetClass")]
5032    #[default(Some(Default::default()))]
5033    pub asset_class: Option<serde_json::Value>,
5034}
5035/// Response types for getConidsByExchange
5036#[derive(Debug, Clone)]
5037pub enum GetConidsByExchangeResponse {
5038    ///200: Successful response containing a contract's security definition.
5039    Ok(Vec<serde_json::Value>),
5040    ///401: Invalid or expired access token
5041    Unauthorized,
5042    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5043     */
5044    InternalServerError,
5045    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5046     */
5047    ServiceUnavailable,
5048    ///default: Unknown response
5049    Unknown,
5050}
5051/// Returns the attributes of the instrument.
5052#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5053pub struct GetContractInfoRequest {
5054    pub query: GetContractInfoRequestQuery,
5055}
5056impl GetContractInfoRequest {
5057    /// Parse the HTTP response into the response enum.
5058    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetContractInfoResponse> {
5059        let status = req.status();
5060        if status == http::StatusCode::OK {
5061            let data =
5062                oas3_gen_support::Diagnostics::<SecDefInfoResponse>::json_with_diagnostics(req)
5063                    .await?;
5064            return Ok(GetContractInfoResponse::Ok(data));
5065        }
5066        if status == http::StatusCode::BAD_REQUEST {
5067            let _ = req.bytes().await?;
5068            return Ok(GetContractInfoResponse::BadRequest);
5069        }
5070        if status == http::StatusCode::UNAUTHORIZED {
5071            let _ = req.bytes().await?;
5072            return Ok(GetContractInfoResponse::Unauthorized);
5073        }
5074        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5075            let _ = req.bytes().await?;
5076            return Ok(GetContractInfoResponse::InternalServerError);
5077        }
5078        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5079            let _ = req.bytes().await?;
5080            return Ok(GetContractInfoResponse::ServiceUnavailable);
5081        }
5082        let _ = req.bytes().await?;
5083        return Ok(GetContractInfoResponse::Unknown);
5084    }
5085}
5086#[serde_with::skip_serializing_none]
5087#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
5088pub struct GetContractInfoRequestQuery {
5089    /// Contract identifier of the underlying. May also pass the final derivative conid directly.
5090    /// - Example: `Some("265598".to_string())`
5091    pub conid: Option<String>,
5092    /// Security type of the requested contract of interest.
5093    pub sectype: Option<serde_json::Value>,
5094    /// Expiration month for the given derivative.
5095    pub month: Option<serde_json::Value>,
5096    /// Designate the exchange you wish to receive information for in relation to the contract.
5097    pub exchange: Option<serde_json::Value>,
5098    /// Set the strike price for the requested contract details
5099    pub strike: Option<serde_json::Value>,
5100    /// Set the right for the given contract. * `C` - for Call options. * `P` - for Put options.
5101    pub right: Option<IndividualPositionPutOrCall>,
5102    /// Set the issuerId for the given bond issuer type.
5103    /// - Example: `Some("e1234567".to_string())`
5104    #[serde(rename = "issuerId")]
5105    pub issuer_id: Option<String>,
5106    /// comma separted list of additional filters. Applicable when SecTyp is BOND
5107    pub filters: Option<serde_json::Value>,
5108}
5109/// Response types for getContractInfo
5110#[derive(Debug, Clone)]
5111pub enum GetContractInfoResponse {
5112    ///200: Successful response containing a contract's security definition.
5113    Ok(SecDefInfoResponse),
5114    ///400: Invalid input format or missing required fields
5115    BadRequest,
5116    ///401: Invalid or expired access token
5117    Unauthorized,
5118    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5119     */
5120    InternalServerError,
5121    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5122     */
5123    ServiceUnavailable,
5124    ///default: Unknown response
5125    Unknown,
5126}
5127/// Returns trading related rules for a specific contract and side.
5128#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5129pub struct GetContractRulesRequest {
5130    pub body: RuleRequestBody,
5131}
5132impl GetContractRulesRequest {
5133    /// Parse the HTTP response into the response enum.
5134    pub async fn parse_response(
5135        req: reqwest::Response,
5136    ) -> anyhow::Result<GetContractRulesResponse> {
5137        let status = req.status();
5138        if status == http::StatusCode::OK {
5139            let data =
5140                oas3_gen_support::Diagnostics::<ContractRules>::json_with_diagnostics(req).await?;
5141            return Ok(GetContractRulesResponse::Ok(data));
5142        }
5143        if status == http::StatusCode::UNAUTHORIZED {
5144            let _ = req.bytes().await?;
5145            return Ok(GetContractRulesResponse::Unauthorized);
5146        }
5147        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5148            let _ = req.bytes().await?;
5149            return Ok(GetContractRulesResponse::InternalServerError);
5150        }
5151        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5152            let _ = req.bytes().await?;
5153            return Ok(GetContractRulesResponse::ServiceUnavailable);
5154        }
5155        let _ = req.bytes().await?;
5156        return Ok(GetContractRulesResponse::Unknown);
5157    }
5158}
5159/// Response types for getContractRules
5160#[derive(Debug, Clone)]
5161pub enum GetContractRulesResponse {
5162    ///200: An array of objects detailing contract information.
5163    Ok(ContractRules),
5164    ///401: Invalid or expired access token
5165    Unauthorized,
5166    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5167     */
5168    InternalServerError,
5169    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5170     */
5171    ServiceUnavailable,
5172    ///default: Unknown response
5173    Unknown,
5174}
5175/// Returns lists of valid strikes for options contracts on a given underlier, for all currently trading expirations. The /iserver/secdef/search endpoint must be called prior for the underlying. Otherwise empty arrays will return for "puts" and "calls".
5176#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5177pub struct GetContractStrikesRequest {
5178    #[validate(nested)]
5179    pub query: GetContractStrikesRequestQuery,
5180}
5181impl GetContractStrikesRequest {
5182    /// Parse the HTTP response into the response enum.
5183    pub async fn parse_response(
5184        req: reqwest::Response,
5185    ) -> anyhow::Result<GetContractStrikesResponse> {
5186        let status = req.status();
5187        if status == http::StatusCode::OK {
5188            let data =
5189                oas3_gen_support::Diagnostics::<Strike200Response>::json_with_diagnostics(req)
5190                    .await?;
5191            return Ok(GetContractStrikesResponse::Ok(data));
5192        }
5193        if status == http::StatusCode::BAD_REQUEST {
5194            let _ = req.bytes().await?;
5195            return Ok(GetContractStrikesResponse::BadRequest);
5196        }
5197        if status == http::StatusCode::UNAUTHORIZED {
5198            let _ = req.bytes().await?;
5199            return Ok(GetContractStrikesResponse::Unauthorized);
5200        }
5201        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5202            let _ = req.bytes().await?;
5203            return Ok(GetContractStrikesResponse::InternalServerError);
5204        }
5205        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5206            let _ = req.bytes().await?;
5207            return Ok(GetContractStrikesResponse::ServiceUnavailable);
5208        }
5209        let _ = req.bytes().await?;
5210        return Ok(GetContractStrikesResponse::Unknown);
5211    }
5212}
5213#[serde_with::skip_serializing_none]
5214#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5215pub struct GetContractStrikesRequestQuery {
5216    /// Contract identifier of the underlying. May also pass the final derivative conid directly.
5217    /// - Example: `"265598".to_string()`
5218    #[validate(length(min = 1u64))]
5219    pub conid: String,
5220    /// Security type of the requested contract of interest. Valid asset classes are:
5221    ///  * `FOP` - Futures Option
5222    ///  * `OPT` - Option
5223    ///  * `WAR` - Warrant
5224    pub sectype: GetContractStrikesRequestQuerySectype,
5225    /// Expiration month for the given derivative. Expiration months can be retrieved from /iserver/secdef/search under an {object}/sections/{object}/months
5226    /// - Example: `"JAN24".to_string()`
5227    #[validate(length(min = 1u64))]
5228    pub month: String,
5229    /// Exchange from which derivatives should be retrieved from. This field is mandatory when requesting Futures Options strikes.
5230    /// - Example: `Some("CME".to_string())`
5231    #[default(Some("SMART".to_string()))]
5232    pub exchange: Option<String>,
5233}
5234/// Security type of the requested contract of interest. Valid asset classes are:
5235///  * `FOP` - Futures Option
5236///  * `OPT` - Option
5237///  * `WAR` - Warrant
5238#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
5239pub enum GetContractStrikesRequestQuerySectype {
5240    #[serde(rename = "OPT")]
5241    #[default]
5242    Opt,
5243    #[serde(rename = "FOP")]
5244    Fop,
5245    #[serde(rename = "WAR")]
5246    War,
5247}
5248impl core::fmt::Display for GetContractStrikesRequestQuerySectype {
5249    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5250        match self {
5251            Self::Opt => write!(f, "OPT"),
5252            Self::Fop => write!(f, "FOP"),
5253            Self::War => write!(f, "WAR"),
5254        }
5255    }
5256}
5257/// Response types for getContractStrikes
5258#[derive(Debug, Clone)]
5259pub enum GetContractStrikesResponse {
5260    ///200: Successful response containing a contract's security definition.
5261    Ok(Strike200Response),
5262    ///400: Invalid input format or missing required fields
5263    BadRequest,
5264    ///401: Invalid or expired access token
5265    Unauthorized,
5266    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5267     */
5268    InternalServerError,
5269    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5270     */
5271    ServiceUnavailable,
5272    ///default: Unknown response
5273    Unknown,
5274}
5275/// Returns a list of contracts based on the search symbol provided as a query param.
5276#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5277pub struct GetContractSymbolsFromBodyRequest {
5278    #[validate(nested)]
5279    pub body: SearchRequestBody,
5280}
5281impl GetContractSymbolsFromBodyRequest {
5282    /// Parse the HTTP response into the response enum.
5283    pub async fn parse_response(
5284        req: reqwest::Response,
5285    ) -> anyhow::Result<GetContractSymbolsResponse> {
5286        let status = req.status();
5287        if status == http::StatusCode::OK {
5288            let data =
5289                oas3_gen_support::Diagnostics::<SecdefSearchResponse>::json_with_diagnostics(req)
5290                    .await?;
5291            return Ok(GetContractSymbolsResponse::Ok(data));
5292        }
5293        if status == http::StatusCode::BAD_REQUEST {
5294            let _ = req.bytes().await?;
5295            return Ok(GetContractSymbolsResponse::BadRequest);
5296        }
5297        if status == http::StatusCode::UNAUTHORIZED {
5298            let _ = req.bytes().await?;
5299            return Ok(GetContractSymbolsResponse::Unauthorized);
5300        }
5301        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5302            let _ = req.bytes().await?;
5303            return Ok(GetContractSymbolsResponse::InternalServerError);
5304        }
5305        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5306            let _ = req.bytes().await?;
5307            return Ok(GetContractSymbolsResponse::ServiceUnavailable);
5308        }
5309        let _ = req.bytes().await?;
5310        return Ok(GetContractSymbolsResponse::Unknown);
5311    }
5312}
5313/// Returns a list of contracts based on the search symbol provided as a query param.
5314#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5315pub struct GetContractSymbolsRequest {
5316    pub query: GetContractSymbolsRequestQuery,
5317}
5318impl GetContractSymbolsRequest {
5319    /// Parse the HTTP response into the response enum.
5320    pub async fn parse_response(
5321        req: reqwest::Response,
5322    ) -> anyhow::Result<GetContractSymbolsResponse> {
5323        let status = req.status();
5324        if status == http::StatusCode::OK {
5325            let data =
5326                oas3_gen_support::Diagnostics::<SecdefSearchResponse>::json_with_diagnostics(req)
5327                    .await?;
5328            return Ok(GetContractSymbolsResponse::Ok(data));
5329        }
5330        if status == http::StatusCode::BAD_REQUEST {
5331            let _ = req.bytes().await?;
5332            return Ok(GetContractSymbolsResponse::BadRequest);
5333        }
5334        if status == http::StatusCode::UNAUTHORIZED {
5335            let _ = req.bytes().await?;
5336            return Ok(GetContractSymbolsResponse::Unauthorized);
5337        }
5338        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5339            let _ = req.bytes().await?;
5340            return Ok(GetContractSymbolsResponse::InternalServerError);
5341        }
5342        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5343            let _ = req.bytes().await?;
5344            return Ok(GetContractSymbolsResponse::ServiceUnavailable);
5345        }
5346        let _ = req.bytes().await?;
5347        return Ok(GetContractSymbolsResponse::Unknown);
5348    }
5349}
5350#[serde_with::skip_serializing_none]
5351#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
5352pub struct GetContractSymbolsRequestQuery {
5353    /// The ticker symbol, bond issuer type, or company name of the equity you are looking to trade.
5354    /// - Example: `Some("AAPL".to_string())`
5355    pub symbol: Option<String>,
5356    /// Available underlying security types:
5357    ///   * `STK` - Represents an underlying as a Stock security type.
5358    ///   * `IND` - Represents an underlying as an Index security type.
5359    ///   * `BOND` - Represents an underlying as a Bond security type.
5360    #[serde(rename = "secType")]
5361    #[default(Some(Default::default()))]
5362    pub sec_type: Option<GetContractSymbolsRequestQuerySecType>,
5363    /// Denotes if the symbol value is the ticker symbol or part of the company's name.
5364    pub name: Option<bool>,
5365    pub more: Option<bool>,
5366    /// fund search
5367    pub fund: Option<bool>,
5368    #[serde(rename = "fundFamilyConidEx")]
5369    pub fund_family_conid_ex: Option<String>,
5370    /// pattern search
5371    pub pattern: Option<bool>,
5372    pub referrer: Option<String>,
5373}
5374#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
5375pub enum GetContractSymbolsRequestQuerySecType {
5376    #[serde(rename = "STK")]
5377    #[default]
5378    Stk,
5379    #[serde(rename = "IND")]
5380    Ind,
5381    #[serde(rename = "BOND")]
5382    Bond,
5383}
5384impl core::fmt::Display for GetContractSymbolsRequestQuerySecType {
5385    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5386        match self {
5387            Self::Stk => write!(f, "STK"),
5388            Self::Ind => write!(f, "IND"),
5389            Self::Bond => write!(f, "BOND"),
5390        }
5391    }
5392}
5393/// Response types for getContractSymbols
5394#[derive(Debug, Clone)]
5395pub enum GetContractSymbolsResponse {
5396    ///200: An array of objects detailing contract information.
5397    Ok(SecdefSearchResponse),
5398    ///400: Invalid input format or missing required fields
5399    BadRequest,
5400    ///401: Invalid or expired access token
5401    Unauthorized,
5402    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5403     */
5404    InternalServerError,
5405    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5406     */
5407    ServiceUnavailable,
5408    ///default: Unknown response
5409    Unknown,
5410}
5411/// Obtains available currency pairs corresponding to the given target currency.
5412#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5413pub struct GetCurrencyPairsRequest {
5414    #[validate(nested)]
5415    pub query: GetCurrencyPairsRequestQuery,
5416}
5417impl GetCurrencyPairsRequest {
5418    /// Parse the HTTP response into the response enum.
5419    pub async fn parse_response(
5420        req: reqwest::Response,
5421    ) -> anyhow::Result<GetCurrencyPairsResponse> {
5422        let status = req.status();
5423        if status == http::StatusCode::OK {
5424            let data =
5425                oas3_gen_support::Diagnostics::<CurrencyPairs>::json_with_diagnostics(req).await?;
5426            return Ok(GetCurrencyPairsResponse::Ok(data));
5427        }
5428        if status == http::StatusCode::BAD_REQUEST {
5429            let _ = req.bytes().await?;
5430            return Ok(GetCurrencyPairsResponse::BadRequest);
5431        }
5432        if status == http::StatusCode::UNAUTHORIZED {
5433            let _ = req.bytes().await?;
5434            return Ok(GetCurrencyPairsResponse::Unauthorized);
5435        }
5436        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5437            let _ = req.bytes().await?;
5438            return Ok(GetCurrencyPairsResponse::InternalServerError);
5439        }
5440        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5441            let _ = req.bytes().await?;
5442            return Ok(GetCurrencyPairsResponse::ServiceUnavailable);
5443        }
5444        let _ = req.bytes().await?;
5445        return Ok(GetCurrencyPairsResponse::Unknown);
5446    }
5447}
5448#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5449pub struct GetCurrencyPairsRequestQuery {
5450    /// Specify the target currency you would like to receive official pairs of.
5451    /// - Example: `"USD".to_string()`
5452    #[validate(length(min = 1u64))]
5453    pub currency: String,
5454}
5455/// Response types for getCurrencyPairs
5456#[derive(Debug, Clone)]
5457pub enum GetCurrencyPairsResponse {
5458    ///200: Returns a list of valid forex pairs for the given currency. The currency can apply as both the target or base currency.
5459    Ok(CurrencyPairs),
5460    ///400: Invalid input format or missing required fields
5461    BadRequest,
5462    ///401: Invalid or expired access token
5463    Unauthorized,
5464    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5465     */
5466    InternalServerError,
5467    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5468     */
5469    ServiceUnavailable,
5470    ///default: Unknown response
5471    Unknown,
5472}
5473/// Returns a list of accounts matching a query pattern set in the request. Broker accounts configured with the DYNACCT property will not receive account information at login. Instead, they must dynamically query then set their account number. Customers without the DYNACCT property will receive a 503 error.
5474#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5475pub struct GetDynamicAccountsRequest {
5476    #[validate(nested)]
5477    pub path: GetDynamicAccountsRequestPath,
5478}
5479impl GetDynamicAccountsRequest {
5480    /// Parse the HTTP response into the response enum.
5481    pub async fn parse_response(
5482        req: reqwest::Response,
5483    ) -> anyhow::Result<GetDynamicAccountsResponse> {
5484        let status = req.status();
5485        if status == http::StatusCode::OK {
5486            let data =
5487                oas3_gen_support::Diagnostics::<DynAccountSearchResponse>::json_with_diagnostics(
5488                    req,
5489                )
5490                .await?;
5491            return Ok(GetDynamicAccountsResponse::Ok(data));
5492        }
5493        if status == http::StatusCode::UNAUTHORIZED {
5494            let _ = req.bytes().await?;
5495            return Ok(GetDynamicAccountsResponse::Unauthorized);
5496        }
5497        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5498            let _ = req.bytes().await?;
5499            return Ok(GetDynamicAccountsResponse::ServiceUnavailable);
5500        }
5501        let _ = req.bytes().await?;
5502        return Ok(GetDynamicAccountsResponse::Unknown);
5503    }
5504}
5505#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
5506pub struct GetDynamicAccountsRequestPath {
5507    /// The pattern used to describe credentials to search for. Including part of part of an account ID will return the full value.
5508    /// - Example: `"U123".to_string()`
5509    #[validate(length(min = 1u64))]
5510    pub search_pattern: String,
5511}
5512/// Response types for getDynamicAccounts
5513#[derive(Debug, Clone)]
5514pub enum GetDynamicAccountsResponse {
5515    ///200: Returns all accounts that match the searchPattern string.
5516    Ok(DynAccountSearchResponse),
5517    ///401: Invalid or expired access token
5518    Unauthorized,
5519    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5520     */
5521    ServiceUnavailable,
5522    ///default: Unknown response
5523    Unknown,
5524}
5525/// Obtains the exchange rates of the currency pair.
5526#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5527pub struct GetExchangeRatesRequest {
5528    #[validate(nested)]
5529    pub query: GetExchangeRatesRequestQuery,
5530}
5531impl GetExchangeRatesRequest {
5532    /// Parse the HTTP response into the response enum.
5533    pub async fn parse_response(
5534        req: reqwest::Response,
5535    ) -> anyhow::Result<GetExchangeRatesResponse> {
5536        let status = req.status();
5537        if status == http::StatusCode::OK {
5538            let data =
5539                oas3_gen_support::Diagnostics::<RateResponse>::json_with_diagnostics(req).await?;
5540            return Ok(GetExchangeRatesResponse::Ok(data));
5541        }
5542        if status == http::StatusCode::BAD_REQUEST {
5543            let _ = req.bytes().await?;
5544            return Ok(GetExchangeRatesResponse::BadRequest);
5545        }
5546        if status == http::StatusCode::UNAUTHORIZED {
5547            let _ = req.bytes().await?;
5548            return Ok(GetExchangeRatesResponse::Unauthorized);
5549        }
5550        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5551            let _ = req.bytes().await?;
5552            return Ok(GetExchangeRatesResponse::InternalServerError);
5553        }
5554        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5555            let _ = req.bytes().await?;
5556            return Ok(GetExchangeRatesResponse::ServiceUnavailable);
5557        }
5558        let _ = req.bytes().await?;
5559        return Ok(GetExchangeRatesResponse::Unknown);
5560    }
5561}
5562#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5563pub struct GetExchangeRatesRequestQuery {
5564    /// Specify the quote currency to request data for.
5565    /// - Example: `"EUR".to_string()`
5566    #[validate(length(min = 1u64))]
5567    pub target: String,
5568    /// Specify the base currency to request data for.
5569    /// - Example: `"USD".to_string()`
5570    #[validate(length(min = 1u64))]
5571    pub source: String,
5572}
5573/// Response types for getExchangeRates
5574#[derive(Debug, Clone)]
5575pub enum GetExchangeRatesResponse {
5576    ///200: Successful requests return the currency exchange rate of the target currency value divided by the source currency.
5577    Ok(RateResponse),
5578    ///400: Invalid input format or missing required fields
5579    BadRequest,
5580    ///401: Invalid or expired access token
5581    Unauthorized,
5582    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5583     */
5584    InternalServerError,
5585    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5586     */
5587    ServiceUnavailable,
5588    ///default: Unknown response
5589    Unknown,
5590}
5591/// Returns the category names, parent ids, and markets for Event Contracts.
5592#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5593pub struct GetForecastCategoriesRequest {}
5594impl GetForecastCategoriesRequest {
5595    /// Parse the HTTP response into the response enum.
5596    pub async fn parse_response(
5597        req: reqwest::Response,
5598    ) -> anyhow::Result<GetForecastCategoriesResponse> {
5599        let status = req.status();
5600        if status == http::StatusCode::OK {
5601            let data =
5602                oas3_gen_support::Diagnostics::<CategoryTreeResponse>::json_with_diagnostics(req)
5603                    .await?;
5604            return Ok(GetForecastCategoriesResponse::Ok(data));
5605        }
5606        if status == http::StatusCode::UNAUTHORIZED {
5607            let _ = req.bytes().await?;
5608            return Ok(GetForecastCategoriesResponse::Unauthorized);
5609        }
5610        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5611            let _ = req.bytes().await?;
5612            return Ok(GetForecastCategoriesResponse::InternalServerError);
5613        }
5614        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5615            let _ = req.bytes().await?;
5616            return Ok(GetForecastCategoriesResponse::ServiceUnavailable);
5617        }
5618        let _ = req.bytes().await?;
5619        return Ok(GetForecastCategoriesResponse::Unknown);
5620    }
5621}
5622/// Response types for getForecastCategories
5623#[derive(Debug, Clone)]
5624pub enum GetForecastCategoriesResponse {
5625    ///200: Returns a list of category identifiers and name to be used for more granular contract discovery.
5626    Ok(CategoryTreeResponse),
5627    ///401: Invalid or expired access token
5628    Unauthorized,
5629    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5630     */
5631    InternalServerError,
5632    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5633     */
5634    ServiceUnavailable,
5635    ///default: Unknown response
5636    Unknown,
5637}
5638/// Provides instrument details for the specific forecast contract.
5639#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5640pub struct GetForecastContractRequest {
5641    #[validate(nested)]
5642    pub query: GetForecastContractRequestQuery,
5643}
5644impl GetForecastContractRequest {
5645    /// Parse the HTTP response into the response enum.
5646    pub async fn parse_response(
5647        req: reqwest::Response,
5648    ) -> anyhow::Result<GetForecastContractResponse> {
5649        let status = req.status();
5650        if status == http::StatusCode::OK {
5651            let data =
5652                oas3_gen_support::Diagnostics::<ForecastDetailsResponse>::json_with_diagnostics(
5653                    req,
5654                )
5655                .await?;
5656            return Ok(GetForecastContractResponse::Ok(data));
5657        }
5658        if status == http::StatusCode::UNAUTHORIZED {
5659            let _ = req.bytes().await?;
5660            return Ok(GetForecastContractResponse::Unauthorized);
5661        }
5662        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5663            let _ = req.bytes().await?;
5664            return Ok(GetForecastContractResponse::InternalServerError);
5665        }
5666        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5667            let _ = req.bytes().await?;
5668            return Ok(GetForecastContractResponse::ServiceUnavailable);
5669        }
5670        let _ = req.bytes().await?;
5671        return Ok(GetForecastContractResponse::Unknown);
5672    }
5673}
5674#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5675pub struct GetForecastContractRequestQuery {
5676    /// Provide the contract identifier to retrieve the information for.
5677    #[validate(length(min = 1u64))]
5678    pub conid: String,
5679}
5680/// Response types for getForecastContract
5681#[derive(Debug, Clone)]
5682pub enum GetForecastContractResponse {
5683    ///200: Returns the expanded list of the event contract containing both Yes and No side identifier information.
5684    Ok(ForecastDetailsResponse),
5685    ///401: Invalid or expired access token
5686    Unauthorized,
5687    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5688     */
5689    InternalServerError,
5690    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5691     */
5692    ServiceUnavailable,
5693    ///default: Unknown response
5694    Unknown,
5695}
5696/// Returns all high level contract details affiliated with the underlying market conid provided.
5697#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5698pub struct GetForecastMarketsRequest {
5699    #[validate(nested)]
5700    pub query: GetForecastMarketsRequestQuery,
5701}
5702impl GetForecastMarketsRequest {
5703    /// Parse the HTTP response into the response enum.
5704    pub async fn parse_response(
5705        req: reqwest::Response,
5706    ) -> anyhow::Result<GetForecastMarketsResponse> {
5707        let status = req.status();
5708        if status == http::StatusCode::OK {
5709            let data =
5710                oas3_gen_support::Diagnostics::<ForecastMarketResponse>::json_with_diagnostics(req)
5711                    .await?;
5712            return Ok(GetForecastMarketsResponse::Ok(data));
5713        }
5714        if status == http::StatusCode::UNAUTHORIZED {
5715            let _ = req.bytes().await?;
5716            return Ok(GetForecastMarketsResponse::Unauthorized);
5717        }
5718        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5719            let _ = req.bytes().await?;
5720            return Ok(GetForecastMarketsResponse::InternalServerError);
5721        }
5722        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5723            let _ = req.bytes().await?;
5724            return Ok(GetForecastMarketsResponse::ServiceUnavailable);
5725        }
5726        let _ = req.bytes().await?;
5727        return Ok(GetForecastMarketsResponse::Unknown);
5728    }
5729}
5730#[serde_with::skip_serializing_none]
5731#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5732pub struct GetForecastMarketsRequestQuery {
5733    /// Underlying event index contract identifier.
5734    #[serde(rename = "underlyingConid")]
5735    #[validate(length(min = 1u64))]
5736    pub underlying_conid: String,
5737    /// Exchange to filter contract by.
5738    pub exchange: Option<String>,
5739}
5740/// Response types for getForecastMarkets
5741#[derive(Debug, Clone)]
5742pub enum GetForecastMarketsResponse {
5743    ///200: Returns the liquid and extended trading hours of the coming and prior trading days.
5744    Ok(ForecastMarketResponse),
5745    ///401: Invalid or expired access token
5746    Unauthorized,
5747    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5748     */
5749    InternalServerError,
5750    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5751     */
5752    ServiceUnavailable,
5753    ///default: Unknown response
5754    Unknown,
5755}
5756/// Provides trading rules for specific event contracts.
5757#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5758pub struct GetForecastRulesRequest {
5759    #[validate(nested)]
5760    pub query: GetForecastRulesRequestQuery,
5761}
5762impl GetForecastRulesRequest {
5763    /// Parse the HTTP response into the response enum.
5764    pub async fn parse_response(
5765        req: reqwest::Response,
5766    ) -> anyhow::Result<GetForecastRulesResponse> {
5767        let status = req.status();
5768        if status == http::StatusCode::OK {
5769            let data =
5770                oas3_gen_support::Diagnostics::<ForecastRulesResponse>::json_with_diagnostics(req)
5771                    .await?;
5772            return Ok(GetForecastRulesResponse::Ok(data));
5773        }
5774        if status == http::StatusCode::UNAUTHORIZED {
5775            let _ = req.bytes().await?;
5776            return Ok(GetForecastRulesResponse::Unauthorized);
5777        }
5778        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5779            let _ = req.bytes().await?;
5780            return Ok(GetForecastRulesResponse::InternalServerError);
5781        }
5782        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5783            let _ = req.bytes().await?;
5784            return Ok(GetForecastRulesResponse::ServiceUnavailable);
5785        }
5786        let _ = req.bytes().await?;
5787        return Ok(GetForecastRulesResponse::Unknown);
5788    }
5789}
5790#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5791pub struct GetForecastRulesRequestQuery {
5792    /// Provide the contract identifier to retrieve rules for.
5793    #[validate(length(min = 1u64))]
5794    pub conid: String,
5795}
5796/// Response types for getForecastRules
5797#[derive(Debug, Clone)]
5798pub enum GetForecastRulesResponse {
5799    ///200: Returns the corresponding contracts rules.
5800    Ok(ForecastRulesResponse),
5801    ///401: Invalid or expired access token
5802    Unauthorized,
5803    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5804     */
5805    InternalServerError,
5806    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5807     */
5808    ServiceUnavailable,
5809    ///default: Unknown response
5810    Unknown,
5811}
5812/// Provides forecast trading schedules.
5813#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5814pub struct GetForecastScheduleRequest {
5815    #[validate(nested)]
5816    pub query: GetForecastScheduleRequestQuery,
5817}
5818impl GetForecastScheduleRequest {
5819    /// Parse the HTTP response into the response enum.
5820    pub async fn parse_response(
5821        req: reqwest::Response,
5822    ) -> anyhow::Result<GetForecastScheduleResponse> {
5823        let status = req.status();
5824        if status == http::StatusCode::OK {
5825            let data =
5826                oas3_gen_support::Diagnostics::<ForecastSchedulesResponse>::json_with_diagnostics(
5827                    req,
5828                )
5829                .await?;
5830            return Ok(GetForecastScheduleResponse::Ok(data));
5831        }
5832        if status == http::StatusCode::UNAUTHORIZED {
5833            let _ = req.bytes().await?;
5834            return Ok(GetForecastScheduleResponse::Unauthorized);
5835        }
5836        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5837            let _ = req.bytes().await?;
5838            return Ok(GetForecastScheduleResponse::InternalServerError);
5839        }
5840        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5841            let _ = req.bytes().await?;
5842            return Ok(GetForecastScheduleResponse::ServiceUnavailable);
5843        }
5844        let _ = req.bytes().await?;
5845        return Ok(GetForecastScheduleResponse::Unknown);
5846    }
5847}
5848#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5849pub struct GetForecastScheduleRequestQuery {
5850    /// Provide the contract identifier to retrieve the trading schedule for.
5851    #[validate(length(min = 1u64))]
5852    pub conid: String,
5853}
5854/// Response types for getForecastSchedule
5855#[derive(Debug, Clone)]
5856pub enum GetForecastScheduleResponse {
5857    ///200: Returns the liquid and extended trading hours of the coming and prior trading days.
5858    Ok(ForecastSchedulesResponse),
5859    ///401: Invalid or expired access token
5860    Unauthorized,
5861    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5862     */
5863    InternalServerError,
5864    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5865     */
5866    ServiceUnavailable,
5867    ///default: Unknown response
5868    Unknown,
5869}
5870/// Provides a summary specific for avilable funds giving more depth than the standard /summary endpoint.
5871#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5872pub struct GetFundSummaryRequest {
5873    #[validate(nested)]
5874    pub path: GetFundSummaryRequestPath,
5875}
5876impl GetFundSummaryRequest {
5877    /// Parse the HTTP response into the response enum.
5878    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetFundSummaryResponse> {
5879        let status = req.status();
5880        if status == http::StatusCode::OK {
5881            let data =
5882                oas3_gen_support::Diagnostics::<AvailableFundsResponse>::json_with_diagnostics(req)
5883                    .await?;
5884            return Ok(GetFundSummaryResponse::Ok(data));
5885        }
5886        if status == http::StatusCode::BAD_REQUEST {
5887            let _ = req.bytes().await?;
5888            return Ok(GetFundSummaryResponse::BadRequest);
5889        }
5890        if status == http::StatusCode::UNAUTHORIZED {
5891            let _ = req.bytes().await?;
5892            return Ok(GetFundSummaryResponse::Unauthorized);
5893        }
5894        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5895            let _ = req.bytes().await?;
5896            return Ok(GetFundSummaryResponse::ServiceUnavailable);
5897        }
5898        let _ = req.bytes().await?;
5899        return Ok(GetFundSummaryResponse::Unknown);
5900    }
5901}
5902#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
5903pub struct GetFundSummaryRequestPath {
5904    /// Pass the account identifier to receive information for.
5905    /// - Example: `"U1234567".to_string()`
5906    #[validate(length(min = 1u64))]
5907    pub account_id: String,
5908}
5909/// Response types for getFundSummary
5910#[derive(Debug, Clone)]
5911pub enum GetFundSummaryResponse {
5912    ///200: Indicates a successful return of available funds.
5913    Ok(AvailableFundsResponse),
5914    ///400: bad request; passed input cannot pass initial validation and detected right away
5915    BadRequest,
5916    ///401: Invalid or expired access token
5917    Unauthorized,
5918    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5919     */
5920    ServiceUnavailable,
5921    ///default: Unknown response
5922    Unknown,
5923}
5924/// Returns a list of non-expired future contracts for given symbol(s)
5925#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5926pub struct GetFutureBySymbolRequest {
5927    #[validate(nested)]
5928    pub query: GetFutureBySymbolRequestQuery,
5929}
5930impl GetFutureBySymbolRequest {
5931    /// Parse the HTTP response into the response enum.
5932    pub async fn parse_response(
5933        req: reqwest::Response,
5934    ) -> anyhow::Result<GetFutureBySymbolResponse> {
5935        let status = req.status();
5936        if status == http::StatusCode::OK {
5937            let data =
5938                oas3_gen_support::Diagnostics::<Features>::json_with_diagnostics(req).await?;
5939            return Ok(GetFutureBySymbolResponse::Ok(data));
5940        }
5941        if status == http::StatusCode::UNAUTHORIZED {
5942            let _ = req.bytes().await?;
5943            return Ok(GetFutureBySymbolResponse::Unauthorized);
5944        }
5945        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
5946            let _ = req.bytes().await?;
5947            return Ok(GetFutureBySymbolResponse::InternalServerError);
5948        }
5949        if status == http::StatusCode::SERVICE_UNAVAILABLE {
5950            let _ = req.bytes().await?;
5951            return Ok(GetFutureBySymbolResponse::ServiceUnavailable);
5952        }
5953        let _ = req.bytes().await?;
5954        return Ok(GetFutureBySymbolResponse::Unknown);
5955    }
5956}
5957#[serde_with::skip_serializing_none]
5958#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
5959pub struct GetFutureBySymbolRequestQuery {
5960    /// Indicate the symbol(s) of the underlier you are trying to retrieve futures on. Accepts comma delimited string of symbols.
5961    /// - Example: `"ES,MES".to_string()`
5962    #[validate(length(min = 1u64))]
5963    pub symbols: String,
5964    /// Primary listing exchange for the Future.
5965    /// - Example: `Some("CME".to_string())`
5966    pub exchange: Option<String>,
5967}
5968/// Response types for getFutureBySymbol
5969#[derive(Debug, Clone)]
5970pub enum GetFutureBySymbolResponse {
5971    ///200: Successful response containing a contract's security definition.
5972    Ok(Features),
5973    ///401: Invalid or expired access token
5974    Unauthorized,
5975    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
5976     */
5977    InternalServerError,
5978    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
5979     */
5980    ServiceUnavailable,
5981    ///default: Unknown response
5982    Unknown,
5983}
5984/// Options for sending fyis to email and other devices.
5985#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
5986pub struct GetFyiDeliveryRequest {}
5987impl GetFyiDeliveryRequest {
5988    /// Parse the HTTP response into the response enum.
5989    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetFyiDeliveryResponse> {
5990        let status = req.status();
5991        if status == http::StatusCode::OK {
5992            let data = oas3_gen_support::Diagnostics::<DeliveryOptions>::json_with_diagnostics(req)
5993                .await?;
5994            return Ok(GetFyiDeliveryResponse::Ok(data));
5995        }
5996        if status == http::StatusCode::UNAUTHORIZED {
5997            let _ = req.bytes().await?;
5998            return Ok(GetFyiDeliveryResponse::Unauthorized);
5999        }
6000        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6001            let _ = req.bytes().await?;
6002            return Ok(GetFyiDeliveryResponse::InternalServerError);
6003        }
6004        if status == http::StatusCode::SERVICE_UNAVAILABLE {
6005            let _ = req.bytes().await?;
6006            return Ok(GetFyiDeliveryResponse::ServiceUnavailable);
6007        }
6008        let _ = req.bytes().await?;
6009        return Ok(GetFyiDeliveryResponse::Unknown);
6010    }
6011}
6012/// Response types for getFyiDelivery
6013#[derive(Debug, Clone)]
6014pub enum GetFyiDeliveryResponse {
6015    ///200: Successfully retrieve preset details
6016    Ok(DeliveryOptions),
6017    ///401: Invalid or expired access token
6018    Unauthorized,
6019    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
6020     */
6021    InternalServerError,
6022    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
6023     */
6024    ServiceUnavailable,
6025    ///default: Unknown response
6026    Unknown,
6027}
6028/// Receive additional disclaimers based on the specified typecode.
6029#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6030pub struct GetFyiDisclaimerssRequest {
6031    pub path: GetFyiDisclaimerssRequestPath,
6032}
6033impl GetFyiDisclaimerssRequest {
6034    /// Parse the HTTP response into the response enum.
6035    pub async fn parse_response(
6036        req: reqwest::Response,
6037    ) -> anyhow::Result<GetFyiDisclaimerssResponse> {
6038        let status = req.status();
6039        if status == http::StatusCode::OK {
6040            let data =
6041                oas3_gen_support::Diagnostics::<DisclaimerInfo>::json_with_diagnostics(req).await?;
6042            return Ok(GetFyiDisclaimerssResponse::Ok(data));
6043        }
6044        if status == http::StatusCode::UNAUTHORIZED {
6045            let _ = req.bytes().await?;
6046            return Ok(GetFyiDisclaimerssResponse::Unauthorized);
6047        }
6048        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6049            let _ = req.bytes().await?;
6050            return Ok(GetFyiDisclaimerssResponse::InternalServerError);
6051        }
6052        if status == http::StatusCode::SERVICE_UNAVAILABLE {
6053            let _ = req.bytes().await?;
6054            return Ok(GetFyiDisclaimerssResponse::ServiceUnavailable);
6055        }
6056        let _ = req.bytes().await?;
6057        return Ok(GetFyiDisclaimerssResponse::Unknown);
6058    }
6059}
6060#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
6061pub struct GetFyiDisclaimerssRequestPath {
6062    /// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
6063    ///   * `BA` - Borrow Availability
6064    ///   * `CA` - Comparable Algo
6065    ///   * `DA` - Dividends Advisory
6066    ///   * `EA` - Upcoming Earnings
6067    ///   * `MF` - Mutual Fund Advisory
6068    ///   * `OE` - Option Expiration
6069    ///   * `PR` - Portfolio Builder Rebalance
6070    ///   * `SE` - Suspend Order on Economic Event
6071    ///   * `SG` - Short Term Gain turning Long Term
6072    ///   * `SM` - System Messages
6073    ///   * `T2` - Assignment Realizing Long-Term Gains
6074    ///   * `TO` - Takeover
6075    ///   * `UA` - User Alert
6076    ///   * `M8` - M871 Trades
6077    ///   * `PS` - Platform Use Suggestions
6078    ///   * `DL` - Unexercised Option Loss Prevention Reminder
6079    ///   * `PT` - Position Transfer
6080    ///   * `CB` - Missing Cost Basis
6081    ///   * `MS` - Milestones
6082    ///   * `TD` - MiFID || 10% Deprecation Notice
6083    ///   * `ST` - Save Taxes
6084    ///   * `TI` - Trade Idea
6085    ///   * `CT` - Cash Transfer
6086    pub typecode: Typecodes,
6087}
6088/// Response types for getFyiDisclaimerss
6089#[derive(Debug, Clone)]
6090pub enum GetFyiDisclaimerssResponse {
6091    ///200: Successfully disclaimer details
6092    Ok(DisclaimerInfo),
6093    ///401: Invalid or expired access token
6094    Unauthorized,
6095    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
6096     */
6097    InternalServerError,
6098    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
6099     */
6100    ServiceUnavailable,
6101    ///default: Unknown response
6102    Unknown,
6103}
6104/// Return the current choices of subscriptions for notifications.
6105#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6106pub struct GetFyiSettingsRequest {}
6107impl GetFyiSettingsRequest {
6108    /// Parse the HTTP response into the response enum.
6109    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetFyiSettingsResponse> {
6110        let status = req.status();
6111        if status == http::StatusCode::OK {
6112            let data =
6113                oas3_gen_support::Diagnostics::<FyiSettings>::json_with_diagnostics(req).await?;
6114            return Ok(GetFyiSettingsResponse::Ok(data));
6115        }
6116        if status == http::StatusCode::UNAUTHORIZED {
6117            let _ = req.bytes().await?;
6118            return Ok(GetFyiSettingsResponse::Unauthorized);
6119        }
6120        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6121            let _ = req.bytes().await?;
6122            return Ok(GetFyiSettingsResponse::InternalServerError);
6123        }
6124        if status == http::StatusCode::SERVICE_UNAVAILABLE {
6125            let _ = req.bytes().await?;
6126            return Ok(GetFyiSettingsResponse::ServiceUnavailable);
6127        }
6128        let _ = req.bytes().await?;
6129        return Ok(GetFyiSettingsResponse::Unknown);
6130    }
6131}
6132/// Response types for getFyiSettings
6133#[derive(Debug, Clone)]
6134pub enum GetFyiSettingsResponse {
6135    ///200: Indicates data is being returned successfully.
6136    Ok(FyiSettings),
6137    ///401: Invalid or expired access token
6138    Unauthorized,
6139    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
6140     */
6141    InternalServerError,
6142    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
6143     */
6144    ServiceUnavailable,
6145    ///default: Unknown response
6146    Unknown,
6147}
6148/// <br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
6149#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6150pub struct GetGwApiV1AccountsAccountidDetailsRequest {
6151    #[validate(nested)]
6152    pub path: GetGwApiV1AccountsAccountidDetailsRequestPath,
6153}
6154impl GetGwApiV1AccountsAccountidDetailsRequest {
6155    /// Parse the HTTP response into the response enum.
6156    pub async fn parse_response(
6157        req: reqwest::Response,
6158    ) -> anyhow::Result<GetGwApiV1AccountsAccountidDetailsResponse> {
6159        let status = req.status();
6160        if status == http::StatusCode::OK {
6161            let data =
6162                oas3_gen_support::Diagnostics::<AccountDetailsResponse>::json_with_diagnostics(req)
6163                    .await?;
6164            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::Ok(data));
6165        }
6166        if status == http::StatusCode::BAD_REQUEST {
6167            let _ = req.bytes().await?;
6168            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::BadRequest);
6169        }
6170        if status == http::StatusCode::UNAUTHORIZED {
6171            let _ = req.bytes().await?;
6172            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::Unauthorized);
6173        }
6174        if status == http::StatusCode::FORBIDDEN {
6175            let _ = req.bytes().await?;
6176            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::Forbidden);
6177        }
6178        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6179            let _ = req.bytes().await?;
6180            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::UnsupportedMediaType);
6181        }
6182        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6183            let _ = req.bytes().await?;
6184            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::InternalServerError);
6185        }
6186        let _ = req.bytes().await?;
6187        return Ok(GetGwApiV1AccountsAccountidDetailsResponse::Unknown);
6188    }
6189}
6190#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
6191pub struct GetGwApiV1AccountsAccountidDetailsRequestPath {
6192    #[validate(length(min = 1u64))]
6193    pub account_id: String,
6194}
6195/// Response types for get_gw_api_v1_accounts_accountid_details
6196#[derive(Debug, Clone)]
6197pub enum GetGwApiV1AccountsAccountidDetailsResponse {
6198    ///200: View information associated with account including contact data, financial information and trading configuration.
6199    Ok(AccountDetailsResponse),
6200    ///400: Returns error description representing bad request
6201    BadRequest,
6202    ///401: Returns error description representing access issue
6203    Unauthorized,
6204    ///403: Returns error description representing access issue
6205    Forbidden,
6206    ///415: Unsupported Media Type
6207    UnsupportedMediaType,
6208    ///500: Returns error description representing internal server error
6209    InternalServerError,
6210    ///default: Unknown response
6211    Unknown,
6212}
6213/// Generate URL address to complete real-time KYC verification using Au10Tix<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
6214#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6215pub struct GetGwApiV1AccountsAccountidKycRequest {
6216    #[validate(nested)]
6217    pub path: GetGwApiV1AccountsAccountidKycRequestPath,
6218}
6219impl GetGwApiV1AccountsAccountidKycRequest {
6220    /// Parse the HTTP response into the response enum.
6221    pub async fn parse_response(
6222        req: reqwest::Response,
6223    ) -> anyhow::Result<GetGwApiV1AccountsAccountidKycResponse> {
6224        let status = req.status();
6225        if status == http::StatusCode::OK {
6226            let data =
6227                oas3_gen_support::Diagnostics::<Au10TixDetailResponse>::json_with_diagnostics(req)
6228                    .await?;
6229            return Ok(GetGwApiV1AccountsAccountidKycResponse::Ok(data));
6230        }
6231        if status == http::StatusCode::BAD_REQUEST {
6232            let _ = req.bytes().await?;
6233            return Ok(GetGwApiV1AccountsAccountidKycResponse::BadRequest);
6234        }
6235        if status == http::StatusCode::UNAUTHORIZED {
6236            let _ = req.bytes().await?;
6237            return Ok(GetGwApiV1AccountsAccountidKycResponse::Unauthorized);
6238        }
6239        if status == http::StatusCode::FORBIDDEN {
6240            let _ = req.bytes().await?;
6241            return Ok(GetGwApiV1AccountsAccountidKycResponse::Forbidden);
6242        }
6243        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6244            let _ = req.bytes().await?;
6245            return Ok(GetGwApiV1AccountsAccountidKycResponse::UnsupportedMediaType);
6246        }
6247        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6248            let _ = req.bytes().await?;
6249            return Ok(GetGwApiV1AccountsAccountidKycResponse::InternalServerError);
6250        }
6251        let _ = req.bytes().await?;
6252        return Ok(GetGwApiV1AccountsAccountidKycResponse::Unknown);
6253    }
6254}
6255#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
6256pub struct GetGwApiV1AccountsAccountidKycRequestPath {
6257    #[validate(length(min = 1u64))]
6258    pub account_id: String,
6259}
6260/// Response types for get_gw_api_v1_accounts_accountid_kyc
6261#[derive(Debug, Clone)]
6262pub enum GetGwApiV1AccountsAccountidKycResponse {
6263    ///200: Generate URL address to complete real-time KYC verification using Au10Tix
6264    Ok(Au10TixDetailResponse),
6265    ///400: Returns error description representing bad request
6266    BadRequest,
6267    ///401: Returns error description representing access issue
6268    Unauthorized,
6269    ///403: Returns error description representing access issue
6270    Forbidden,
6271    ///415: Unsupported Media Type
6272    UnsupportedMediaType,
6273    ///500: Returns error description representing internal server error
6274    InternalServerError,
6275    ///default: Unknown response
6276    Unknown,
6277}
6278/// Query login messages assigned by accountId<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
6279#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6280pub struct GetGwApiV1AccountsAccountidLoginMessagesRequest {
6281    #[validate(nested)]
6282    pub path: GetGwApiV1AccountsAccountidLoginMessagesRequestPath,
6283    pub query: GetGwApiV1AccountsAccountidLoginMessagesRequestQuery,
6284}
6285impl GetGwApiV1AccountsAccountidLoginMessagesRequest {
6286    /// Parse the HTTP response into the response enum.
6287    pub async fn parse_response(
6288        req: reqwest::Response,
6289    ) -> anyhow::Result<GetGwApiV1AccountsLoginMessagesResponse> {
6290        let status = req.status();
6291        if status == http::StatusCode::OK {
6292            let data =
6293                oas3_gen_support::Diagnostics::<LoginMessageResponse>::json_with_diagnostics(req)
6294                    .await?;
6295            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Ok(data));
6296        }
6297        if status == http::StatusCode::BAD_REQUEST {
6298            let _ = req.bytes().await?;
6299            return Ok(GetGwApiV1AccountsLoginMessagesResponse::BadRequest);
6300        }
6301        if status == http::StatusCode::UNAUTHORIZED {
6302            let _ = req.bytes().await?;
6303            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Unauthorized);
6304        }
6305        if status == http::StatusCode::FORBIDDEN {
6306            let _ = req.bytes().await?;
6307            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Forbidden);
6308        }
6309        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6310            let _ = req.bytes().await?;
6311            return Ok(GetGwApiV1AccountsLoginMessagesResponse::UnsupportedMediaType);
6312        }
6313        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6314            let _ = req.bytes().await?;
6315            return Ok(GetGwApiV1AccountsLoginMessagesResponse::InternalServerError);
6316        }
6317        let _ = req.bytes().await?;
6318        return Ok(GetGwApiV1AccountsLoginMessagesResponse::Unknown);
6319    }
6320}
6321#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
6322pub struct GetGwApiV1AccountsAccountidLoginMessagesRequestPath {
6323    #[validate(length(min = 1u64))]
6324    pub account_id: String,
6325}
6326#[serde_with::skip_serializing_none]
6327#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
6328pub struct GetGwApiV1AccountsAccountidLoginMessagesRequestQuery {
6329    #[serde(rename = "type")]
6330    pub r#type: Option<String>,
6331}
6332/// Query status of account by accountId<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
6333#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6334pub struct GetGwApiV1AccountsAccountidStatusRequest {
6335    #[validate(nested)]
6336    pub path: GetGwApiV1AccountsAccountidStatusRequestPath,
6337}
6338impl GetGwApiV1AccountsAccountidStatusRequest {
6339    /// Parse the HTTP response into the response enum.
6340    pub async fn parse_response(
6341        req: reqwest::Response,
6342    ) -> anyhow::Result<GetGwApiV1AccountsAccountidStatusResponse> {
6343        let status = req.status();
6344        if status == http::StatusCode::OK {
6345            let data =
6346                oas3_gen_support::Diagnostics::<AccountStatusResponse>::json_with_diagnostics(req)
6347                    .await?;
6348            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Ok(data));
6349        }
6350        if status == http::StatusCode::BAD_REQUEST {
6351            let _ = req.bytes().await?;
6352            return Ok(GetGwApiV1AccountsAccountidStatusResponse::BadRequest);
6353        }
6354        if status == http::StatusCode::UNAUTHORIZED {
6355            let _ = req.bytes().await?;
6356            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Unauthorized);
6357        }
6358        if status == http::StatusCode::FORBIDDEN {
6359            let _ = req.bytes().await?;
6360            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Forbidden);
6361        }
6362        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6363            let _ = req.bytes().await?;
6364            return Ok(GetGwApiV1AccountsAccountidStatusResponse::UnsupportedMediaType);
6365        }
6366        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6367            let _ = req.bytes().await?;
6368            return Ok(GetGwApiV1AccountsAccountidStatusResponse::InternalServerError);
6369        }
6370        let _ = req.bytes().await?;
6371        return Ok(GetGwApiV1AccountsAccountidStatusResponse::Unknown);
6372    }
6373}
6374#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
6375pub struct GetGwApiV1AccountsAccountidStatusRequestPath {
6376    #[validate(length(min = 1u64))]
6377    pub account_id: String,
6378}
6379/// Response types for get_gw_api_v1_accounts_accountid_status
6380#[derive(Debug, Clone)]
6381pub enum GetGwApiV1AccountsAccountidStatusResponse {
6382    ///200: Query status of account by accountId.
6383    Ok(AccountStatusResponse),
6384    ///400: Returns error description representing bad request
6385    BadRequest,
6386    ///401: Returns error description representing access issue
6387    Unauthorized,
6388    ///403: Returns error description representing access issue
6389    Forbidden,
6390    ///415: Unsupported Media Type
6391    UnsupportedMediaType,
6392    ///500: Returns error description representing internal server error
6393    InternalServerError,
6394    ///default: Unknown response
6395    Unknown,
6396}
6397/// Query registration tasks assigned to account and pending tasks that are required for account approval<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
6398#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6399pub struct GetGwApiV1AccountsAccountidTasksRequest {
6400    #[validate(nested)]
6401    pub path: GetGwApiV1AccountsAccountidTasksRequestPath,
6402    pub query: GetGwApiV1AccountsAccountidTasksRequestQuery,
6403}
6404impl GetGwApiV1AccountsAccountidTasksRequest {
6405    /// Parse the HTTP response into the response enum.
6406    pub async fn parse_response(
6407        req: reqwest::Response,
6408    ) -> anyhow::Result<GetGwApiV1AccountsAccountidTasksResponse> {
6409        let status = req.status();
6410        if status == http::StatusCode::OK {
6411            let data = oas3_gen_support::Diagnostics::<Task200Response>::json_with_diagnostics(req)
6412                .await?;
6413            return Ok(GetGwApiV1AccountsAccountidTasksResponse::Ok(data));
6414        }
6415        if status == http::StatusCode::BAD_REQUEST {
6416            let _ = req.bytes().await?;
6417            return Ok(GetGwApiV1AccountsAccountidTasksResponse::BadRequest);
6418        }
6419        if status == http::StatusCode::UNAUTHORIZED {
6420            let _ = req.bytes().await?;
6421            return Ok(GetGwApiV1AccountsAccountidTasksResponse::Unauthorized);
6422        }
6423        if status == http::StatusCode::FORBIDDEN {
6424            let _ = req.bytes().await?;
6425            return Ok(GetGwApiV1AccountsAccountidTasksResponse::Forbidden);
6426        }
6427        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6428            let _ = req.bytes().await?;
6429            return Ok(GetGwApiV1AccountsAccountidTasksResponse::UnsupportedMediaType);
6430        }
6431        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6432            let _ = req.bytes().await?;
6433            return Ok(GetGwApiV1AccountsAccountidTasksResponse::InternalServerError);
6434        }
6435        let _ = req.bytes().await?;
6436        return Ok(GetGwApiV1AccountsAccountidTasksResponse::Unknown);
6437    }
6438}
6439#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
6440pub struct GetGwApiV1AccountsAccountidTasksRequestPath {
6441    #[validate(length(min = 1u64))]
6442    pub account_id: String,
6443}
6444#[serde_with::skip_serializing_none]
6445#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
6446pub struct GetGwApiV1AccountsAccountidTasksRequestQuery {
6447    #[serde(rename = "type")]
6448    #[default(Some(Default::default()))]
6449    pub r#type: Option<GetGwApiV1AccountsAccountidTasksRequestQueryType>,
6450}
6451#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
6452pub enum GetGwApiV1AccountsAccountidTasksRequestQueryType {
6453    #[serde(rename = "pending")]
6454    #[default]
6455    Pending,
6456    #[serde(rename = "registration")]
6457    Registration,
6458}
6459impl core::fmt::Display for GetGwApiV1AccountsAccountidTasksRequestQueryType {
6460    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6461        match self {
6462            Self::Pending => write!(f, "pending"),
6463            Self::Registration => write!(f, "registration"),
6464        }
6465    }
6466}
6467/// Response types for get_gw_api_v1_accounts_accountid_tasks
6468#[derive(Debug, Clone)]
6469pub enum GetGwApiV1AccountsAccountidTasksResponse {
6470    ///200: Query registration tasks assigned to account and pending tasks that are required for account approval
6471    Ok(Task200Response),
6472    ///400: Returns error description representing bad request
6473    BadRequest,
6474    ///401: Returns error description representing access issue
6475    Unauthorized,
6476    ///403: Returns error description representing access issue
6477    Forbidden,
6478    ///415: Unsupported Media Type
6479    UnsupportedMediaType,
6480    ///500: Returns error description representing internal server error
6481    InternalServerError,
6482    ///default: Unknown response
6483    Unknown,
6484}
6485/// Query all accounts associated with ‘Client ID’ that have incomplete login message<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
6486#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6487pub struct GetGwApiV1AccountsLoginMessagesRequest {
6488    pub query: GetGwApiV1AccountsLoginMessagesRequestQuery,
6489}
6490impl GetGwApiV1AccountsLoginMessagesRequest {
6491    /// Parse the HTTP response into the response enum.
6492    pub async fn parse_response(
6493        req: reqwest::Response,
6494    ) -> anyhow::Result<GetGwApiV1AccountsLoginMessagesResponse> {
6495        let status = req.status();
6496        if status == http::StatusCode::OK {
6497            let data =
6498                oas3_gen_support::Diagnostics::<LoginMessageResponse>::json_with_diagnostics(req)
6499                    .await?;
6500            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Ok(data));
6501        }
6502        if status == http::StatusCode::BAD_REQUEST {
6503            let _ = req.bytes().await?;
6504            return Ok(GetGwApiV1AccountsLoginMessagesResponse::BadRequest);
6505        }
6506        if status == http::StatusCode::UNAUTHORIZED {
6507            let _ = req.bytes().await?;
6508            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Unauthorized);
6509        }
6510        if status == http::StatusCode::FORBIDDEN {
6511            let _ = req.bytes().await?;
6512            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Forbidden);
6513        }
6514        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6515            let _ = req.bytes().await?;
6516            return Ok(GetGwApiV1AccountsLoginMessagesResponse::UnsupportedMediaType);
6517        }
6518        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6519            let _ = req.bytes().await?;
6520            return Ok(GetGwApiV1AccountsLoginMessagesResponse::InternalServerError);
6521        }
6522        let _ = req.bytes().await?;
6523        return Ok(GetGwApiV1AccountsLoginMessagesResponse::Unknown);
6524    }
6525}
6526#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
6527pub struct GetGwApiV1AccountsLoginMessagesRequestQuery {
6528    #[serde(rename = "loginMessageRequest")]
6529    pub login_message_request: serde_json::Value,
6530}
6531/// Response types for get_gw_api_v1_accounts_login_messages
6532#[derive(Debug, Clone)]
6533pub enum GetGwApiV1AccountsLoginMessagesResponse {
6534    ///200: Query all accounts associated with ‘Client ID’ that have incomplete login message
6535    Ok(LoginMessageResponse),
6536    ///400: Returns error description representing bad request
6537    BadRequest,
6538    ///401: Returns error description representing access issue
6539    Unauthorized,
6540    ///403: Returns error description representing access issue
6541    Forbidden,
6542    ///415: Unsupported Media Type
6543    UnsupportedMediaType,
6544    ///500: Returns error description representing internal server error
6545    InternalServerError,
6546    ///default: Unknown response
6547    Unknown,
6548}
6549/// Retrieve the application request and IBKR response data based on IBKR accountId or externalId. Only available for accounts that originate via API<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
6550#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6551pub struct GetGwApiV1AccountsRequest {
6552    pub query: GetGwApiV1AccountsRequestQuery,
6553}
6554impl GetGwApiV1AccountsRequest {
6555    /// Parse the HTTP response into the response enum.
6556    pub async fn parse_response(
6557        req: reqwest::Response,
6558    ) -> anyhow::Result<GetGwApiV1AccountsResponse> {
6559        let status = req.status();
6560        if status == http::StatusCode::OK {
6561            let data =
6562                oas3_gen_support::Diagnostics::<Account200Response>::json_with_diagnostics(req)
6563                    .await?;
6564            return Ok(GetGwApiV1AccountsResponse::Ok(data));
6565        }
6566        if status == http::StatusCode::BAD_REQUEST {
6567            let _ = req.bytes().await?;
6568            return Ok(GetGwApiV1AccountsResponse::BadRequest);
6569        }
6570        if status == http::StatusCode::UNAUTHORIZED {
6571            let _ = req.bytes().await?;
6572            return Ok(GetGwApiV1AccountsResponse::Unauthorized);
6573        }
6574        if status == http::StatusCode::FORBIDDEN {
6575            let _ = req.bytes().await?;
6576            return Ok(GetGwApiV1AccountsResponse::Forbidden);
6577        }
6578        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6579            let _ = req.bytes().await?;
6580            return Ok(GetGwApiV1AccountsResponse::UnsupportedMediaType);
6581        }
6582        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6583            let _ = req.bytes().await?;
6584            return Ok(GetGwApiV1AccountsResponse::InternalServerError);
6585        }
6586        let _ = req.bytes().await?;
6587        return Ok(GetGwApiV1AccountsResponse::Unknown);
6588    }
6589}
6590#[serde_with::skip_serializing_none]
6591#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
6592pub struct GetGwApiV1AccountsRequestQuery {
6593    #[serde(rename = "accountId")]
6594    pub account_id: Option<String>,
6595    #[serde(rename = "externalId")]
6596    pub external_id: Option<String>,
6597}
6598/// Response types for get_gw_api_v1_accounts
6599#[derive(Debug, Clone)]
6600pub enum GetGwApiV1AccountsResponse {
6601    ///200: Retrieve the application request and IBKR response data based on IBKR accountId or externalId. Only available for accounts that originate via API
6602    Ok(Account200Response),
6603    ///400: Returns error description representing bad request
6604    BadRequest,
6605    ///401: Returns error description representing access issue
6606    Unauthorized,
6607    ///403: Returns error description representing access issue
6608    Forbidden,
6609    ///415: Unsupported Media Type
6610    UnsupportedMediaType,
6611    ///500: Returns error description representing internal server error
6612    InternalServerError,
6613    ///default: Unknown response
6614    Unknown,
6615}
6616/// Query status of all accounts associated with ‘Client ID'<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
6617#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6618pub struct GetGwApiV1AccountsStatusRequest {
6619    pub query: GetGwApiV1AccountsStatusRequestQuery,
6620}
6621impl GetGwApiV1AccountsStatusRequest {
6622    /// Parse the HTTP response into the response enum.
6623    pub async fn parse_response(
6624        req: reqwest::Response,
6625    ) -> anyhow::Result<GetGwApiV1AccountsStatusResponse> {
6626        let status = req.status();
6627        if status == http::StatusCode::OK {
6628            let data =
6629                oas3_gen_support::Diagnostics::<AccountStatusBulkResponse>::json_with_diagnostics(
6630                    req,
6631                )
6632                .await?;
6633            return Ok(GetGwApiV1AccountsStatusResponse::Ok(data));
6634        }
6635        if status == http::StatusCode::BAD_REQUEST {
6636            let _ = req.bytes().await?;
6637            return Ok(GetGwApiV1AccountsStatusResponse::BadRequest);
6638        }
6639        if status == http::StatusCode::UNAUTHORIZED {
6640            let _ = req.bytes().await?;
6641            return Ok(GetGwApiV1AccountsStatusResponse::Unauthorized);
6642        }
6643        if status == http::StatusCode::FORBIDDEN {
6644            let _ = req.bytes().await?;
6645            return Ok(GetGwApiV1AccountsStatusResponse::Forbidden);
6646        }
6647        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6648            let _ = req.bytes().await?;
6649            return Ok(GetGwApiV1AccountsStatusResponse::UnsupportedMediaType);
6650        }
6651        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6652            let _ = req.bytes().await?;
6653            return Ok(GetGwApiV1AccountsStatusResponse::InternalServerError);
6654        }
6655        let _ = req.bytes().await?;
6656        return Ok(GetGwApiV1AccountsStatusResponse::Unknown);
6657    }
6658}
6659#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
6660pub struct GetGwApiV1AccountsStatusRequestQuery {
6661    #[serde(rename = "accountStatusRequest")]
6662    pub account_status_request: serde_json::Value,
6663}
6664/// Response types for get_gw_api_v1_accounts_status
6665#[derive(Debug, Clone)]
6666pub enum GetGwApiV1AccountsStatusResponse {
6667    ///200: Query status of all accounts associated with ‘Client ID'
6668    Ok(AccountStatusBulkResponse),
6669    ///400: Returns error description representing bad request
6670    BadRequest,
6671    ///401: Returns error description representing access issue
6672    Unauthorized,
6673    ///403: Returns error description representing access issue
6674    Forbidden,
6675    ///415: Unsupported Media Type
6676    UnsupportedMediaType,
6677    ///500: Returns error description representing internal server error
6678    InternalServerError,
6679    ///default: Unknown response
6680    Unknown,
6681}
6682/// Retrieve status of request by clientInstructionId.<br><br>**Scope**: `instructions.read`<br>**Security Policy**: `HTTPS`
6683#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6684pub struct GetGwApiV1ClientInstructionsClientinstructionidRequest {
6685    pub path: GetGwApiV1ClientInstructionsClientinstructionidRequestPath,
6686    pub query: GetGwApiV1ClientInstructionsClientinstructionidRequestQuery,
6687}
6688impl GetGwApiV1ClientInstructionsClientinstructionidRequest {
6689    /// Parse the HTTP response into the response enum.
6690    pub async fn parse_response(
6691        req: reqwest::Response,
6692    ) -> anyhow::Result<GetGwApiV1InstructionsInstructionidResponse> {
6693        let status = req.status();
6694        if status == http::StatusCode::OK {
6695            let data =
6696                oas3_gen_support::Diagnostics::<Instruction200Response>::json_with_diagnostics(req)
6697                    .await?;
6698            return Ok(GetGwApiV1InstructionsInstructionidResponse::Ok(data));
6699        }
6700        if status == http::StatusCode::NOT_FOUND {
6701            let _ = req.bytes().await?;
6702            return Ok(GetGwApiV1InstructionsInstructionidResponse::NotFound);
6703        }
6704        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6705            let _ = req.bytes().await?;
6706            return Ok(GetGwApiV1InstructionsInstructionidResponse::InternalServerError);
6707        }
6708        let _ = req.bytes().await?;
6709        return Ok(GetGwApiV1InstructionsInstructionidResponse::Unknown);
6710    }
6711}
6712#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
6713pub struct GetGwApiV1ClientInstructionsClientinstructionidRequestPath {
6714    /// The target instruction id.
6715    /// - Example: `-1_988_905_739i32`
6716    pub client_instruction_id: i32,
6717}
6718#[serde_with::skip_serializing_none]
6719#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
6720pub struct GetGwApiV1ClientInstructionsClientinstructionidRequestQuery {
6721    /// The client's clientId
6722    /// - Example: `Some("abc123".to_string())`
6723    #[serde(rename = "client-id")]
6724    pub client_id: Option<String>,
6725}
6726/// <br>**Scope**: `echo.read`<br>**Security Policy**: `HTTPS`
6727#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6728pub struct GetGwApiV1EchoHttpsRequest {}
6729impl GetGwApiV1EchoHttpsRequest {
6730    /// Parse the HTTP response into the response enum.
6731    pub async fn parse_response(
6732        req: reqwest::Response,
6733    ) -> anyhow::Result<GetGwApiV1EchoHttpsResponse> {
6734        let status = req.status();
6735        if status == http::StatusCode::OK {
6736            let data =
6737                oas3_gen_support::Diagnostics::<EchoResponse>::json_with_diagnostics(req).await?;
6738            return Ok(GetGwApiV1EchoHttpsResponse::Ok(data));
6739        }
6740        if status == http::StatusCode::UNAUTHORIZED {
6741            let _ = req.bytes().await?;
6742            return Ok(GetGwApiV1EchoHttpsResponse::Unauthorized);
6743        }
6744        if status == http::StatusCode::FORBIDDEN {
6745            let _ = req.bytes().await?;
6746            return Ok(GetGwApiV1EchoHttpsResponse::Forbidden);
6747        }
6748        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6749            let _ = req.bytes().await?;
6750            return Ok(GetGwApiV1EchoHttpsResponse::InternalServerError);
6751        }
6752        let _ = req.bytes().await?;
6753        return Ok(GetGwApiV1EchoHttpsResponse::Unknown);
6754    }
6755}
6756/// Response types for get_gw_api_v1_echo_https
6757#[derive(Debug, Clone)]
6758pub enum GetGwApiV1EchoHttpsResponse {
6759    ///200: Returns a JSON object containing the request parameters.
6760    Ok(EchoResponse),
6761    ///401: Returns a Problem detail instance representing an unauthorized request.
6762    Unauthorized,
6763    ///403: Returns a Problem detail instance representing a forbidden request.
6764    Forbidden,
6765    ///500: Returns a Problem detail instance representing an internal server error.
6766    InternalServerError,
6767    ///default: Unknown response
6768    Unknown,
6769}
6770/// Get list of brokers supported for given asset transfer type<br><br>**Scope**: `enumerations.read`<br>**Security Policy**: `HTTPS`
6771#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6772pub struct GetGwApiV1EnumerationsComplexAssetTransferRequest {
6773    #[validate(nested)]
6774    pub query: GetGwApiV1EnumerationsComplexAssetTransferRequestQuery,
6775}
6776impl GetGwApiV1EnumerationsComplexAssetTransferRequest {
6777    /// Parse the HTTP response into the response enum.
6778    pub async fn parse_response(
6779        req: reqwest::Response,
6780    ) -> anyhow::Result<GetGwApiV1EnumerationsComplexAssetTransferResponse> {
6781        let status = req.status();
6782        if status == http::StatusCode::OK {
6783            let data =
6784                oas3_gen_support::Diagnostics::<GetBrokerListResponse>::json_with_diagnostics(req)
6785                    .await?;
6786            return Ok(GetGwApiV1EnumerationsComplexAssetTransferResponse::Ok(data));
6787        }
6788        if status == http::StatusCode::BAD_REQUEST {
6789            let _ = req.bytes().await?;
6790            return Ok(GetGwApiV1EnumerationsComplexAssetTransferResponse::BadRequest);
6791        }
6792        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6793            let _ = req.bytes().await?;
6794            return Ok(GetGwApiV1EnumerationsComplexAssetTransferResponse::InternalServerError);
6795        }
6796        let _ = req.bytes().await?;
6797        return Ok(GetGwApiV1EnumerationsComplexAssetTransferResponse::Unknown);
6798    }
6799}
6800#[serde_with::skip_serializing_none]
6801#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
6802pub struct GetGwApiV1EnumerationsComplexAssetTransferRequestQuery {
6803    /// The client's clientId
6804    /// - Example: `Some("abc123".to_string())`
6805    #[serde(rename = "client-id")]
6806    pub client_id: Option<String>,
6807    /// Asset transfer type to get the list of supported brokers
6808    #[serde(rename = "instructionType")]
6809    #[validate(length(min = 1u64))]
6810    pub instruction_type: String,
6811}
6812/// Response types for get_gw_api_v1_enumerations_complex_asset_transfer
6813#[derive(Debug, Clone)]
6814pub enum GetGwApiV1EnumerationsComplexAssetTransferResponse {
6815    ///200: Returns list of brokers supported for given asset type
6816    Ok(GetBrokerListResponse),
6817    ///400: Returns a Problem detail instance representing a not found request.
6818    BadRequest,
6819    ///500: Unable to process request due to an Internal Error. Please try again later.
6820    InternalServerError,
6821    ///default: Unknown response
6822    Unknown,
6823}
6824/// Used to query list of enumerations for attributes included within extPositionsTransfers, occupation, employerBusiness, financialInformation, affiliationDetails, tradingPermissions, etc.<br><br>**Scope**: `accounts.read` OR `enumerations.read`<br>**Security Policy**: `HTTPS`
6825#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6826pub struct GetGwApiV1EnumerationsEnumerationtypeRequest {
6827    #[validate(nested)]
6828    pub path: GetGwApiV1EnumerationsEnumerationtypeRequestPath,
6829    pub query: GetGwApiV1EnumerationsEnumerationtypeRequestQuery,
6830}
6831impl GetGwApiV1EnumerationsEnumerationtypeRequest {
6832    /// Parse the HTTP response into the response enum.
6833    pub async fn parse_response(
6834        req: reqwest::Response,
6835    ) -> anyhow::Result<GetGwApiV1EnumerationsEnumerationtypeResponse> {
6836        let status = req.status();
6837        if status == http::StatusCode::OK {
6838            let data =
6839                oas3_gen_support::Diagnostics::<EnumerationResponse>::json_with_diagnostics(req)
6840                    .await?;
6841            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::Ok(data));
6842        }
6843        if status == http::StatusCode::BAD_REQUEST {
6844            let _ = req.bytes().await?;
6845            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::BadRequest);
6846        }
6847        if status == http::StatusCode::UNAUTHORIZED {
6848            let _ = req.bytes().await?;
6849            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::Unauthorized);
6850        }
6851        if status == http::StatusCode::FORBIDDEN {
6852            let _ = req.bytes().await?;
6853            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::Forbidden);
6854        }
6855        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6856            let _ = req.bytes().await?;
6857            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::UnsupportedMediaType);
6858        }
6859        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6860            let _ = req.bytes().await?;
6861            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::InternalServerError);
6862        }
6863        let _ = req.bytes().await?;
6864        return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::Unknown);
6865    }
6866}
6867#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
6868pub struct GetGwApiV1EnumerationsEnumerationtypeRequestPath {
6869    #[validate(length(min = 1u64))]
6870    pub enumeration_type: String,
6871}
6872#[serde_with::skip_serializing_none]
6873#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
6874pub struct GetGwApiV1EnumerationsEnumerationtypeRequestQuery {
6875    /// <ul><li>exchange-bundles - query most up to date list of exchange-bundles for tradingPermissions</li><li>business-and-occupation - list of occupation and employerBusiness for employmentDetails</li><li>employee-track - query most up to date companyId for account. For affiliation details, if company has an existing IBKR Employee Track account</li><li>fin-info-ranges - query most up to date range IDs by currency for annualNetIncome, netWorth, liquidNetWorth</li><li>acats - query most up to date values for brokerId and brokerName. Used if funding via US ACATS extPositionsTransfers</li><li>aton - query most up to date values for brokerId and brokerName. Used if funding via US ACATS extPositionsTransfers</li><li>market-data - query most up to date values for brokerId and brokerName. Used if funding via ATON Canada extPositionsTransfers</li><li>edd-avt - query questions associated with EDD (Enhanced Due Diligence) or AVT (Additional Verification) tasks assigned to an account</li><li>prohibited-country - view list of prohibited countries. Applicants that reside in prohibited country are restricted from opening an account with IBKR. Error will be thrown IF legalResidenceCountry, OR country (included within Residence, mailingAddress and employerAddress, taxResidency node) is a prohibited country</li><li>employee-plans - view EPA that are linked to master account (applicable IF offering SEP IRA accounts)</li><li>questionnaires - obtain list of questionnaires</li><li>security-questions - obtain list of questions supported for IBKR security questions</li><li>quiz-questions - obtain list of questions associated with IBKR knowledge assessment</li><li>wire-instructions - obtain list of wire instructions</li><li>product-country-bundles - obtain list of product country bundles</li></ul>
6876    #[serde(rename = "type")]
6877    pub r#type: Option<EnumerationType>,
6878    pub currency: Option<String>,
6879    #[serde(rename = "ibEntity")]
6880    pub ib_entity: Option<String>,
6881    #[serde(rename = "mdStatusNonPro")]
6882    pub md_status_non_pro: Option<String>,
6883    #[serde(rename = "form-number")]
6884    pub form_number: Option<String>,
6885    pub language: Option<GetGwApiV1EnumerationsEnumerationtypeRequestQueryLanguage>,
6886    #[serde(rename = "accountId")]
6887    pub account_id: Option<String>,
6888    #[serde(rename = "userName")]
6889    pub user_name: Option<String>,
6890}
6891#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
6892pub enum GetGwApiV1EnumerationsEnumerationtypeRequestQueryLanguage {
6893    #[serde(rename = "en")]
6894    #[default]
6895    En,
6896    #[serde(rename = "ar")]
6897    Ar,
6898    #[serde(rename = "de")]
6899    De,
6900    #[serde(rename = "es")]
6901    Es,
6902    #[serde(rename = "fr")]
6903    Fr,
6904    #[serde(rename = "he")]
6905    He,
6906    #[serde(rename = "hu")]
6907    Hu,
6908    #[serde(rename = "it")]
6909    It,
6910    #[serde(rename = "ja")]
6911    Ja,
6912    #[serde(rename = "nl")]
6913    Nl,
6914    #[serde(rename = "pt")]
6915    Pt,
6916    #[serde(rename = "ru")]
6917    Ru,
6918    #[serde(rename = "zh_CN")]
6919    ZhCn,
6920    #[serde(rename = "zh_TW")]
6921    ZhTw,
6922}
6923impl core::fmt::Display for GetGwApiV1EnumerationsEnumerationtypeRequestQueryLanguage {
6924    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6925        match self {
6926            Self::En => write!(f, "en"),
6927            Self::Ar => write!(f, "ar"),
6928            Self::De => write!(f, "de"),
6929            Self::Es => write!(f, "es"),
6930            Self::Fr => write!(f, "fr"),
6931            Self::He => write!(f, "he"),
6932            Self::Hu => write!(f, "hu"),
6933            Self::It => write!(f, "it"),
6934            Self::Ja => write!(f, "ja"),
6935            Self::Nl => write!(f, "nl"),
6936            Self::Pt => write!(f, "pt"),
6937            Self::Ru => write!(f, "ru"),
6938            Self::ZhCn => write!(f, "zh_CN"),
6939            Self::ZhTw => write!(f, "zh_TW"),
6940        }
6941    }
6942}
6943/// Response types for get_gw_api_v1_enumerations_enumerationtype
6944#[derive(Debug, Clone)]
6945pub enum GetGwApiV1EnumerationsEnumerationtypeResponse {
6946    ///200: Get enumerations
6947    Ok(EnumerationResponse),
6948    ///400: Returns error description representing bad request
6949    BadRequest,
6950    ///401: Returns error description representing access issue
6951    Unauthorized,
6952    ///403: Returns error description representing access issue
6953    Forbidden,
6954    ///415: Unsupported Media Type
6955    UnsupportedMediaType,
6956    ///500: Returns error description representing internal server error
6957    InternalServerError,
6958    ///default: Unknown response
6959    Unknown,
6960}
6961/// Get forms<br><br>**Scope**: `accounts.read` OR `forms.read`<br>**Security Policy**: `HTTPS`
6962#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
6963pub struct GetGwApiV1FormsRequest {
6964    pub query: GetGwApiV1FormsRequestQuery,
6965}
6966impl GetGwApiV1FormsRequest {
6967    /// Parse the HTTP response into the response enum.
6968    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetGwApiV1FormsResponse> {
6969        let status = req.status();
6970        if status == http::StatusCode::OK {
6971            let data =
6972                oas3_gen_support::Diagnostics::<FormFileResponse>::json_with_diagnostics(req)
6973                    .await?;
6974            return Ok(GetGwApiV1FormsResponse::Ok(data));
6975        }
6976        if status == http::StatusCode::BAD_REQUEST {
6977            let _ = req.bytes().await?;
6978            return Ok(GetGwApiV1FormsResponse::BadRequest);
6979        }
6980        if status == http::StatusCode::UNAUTHORIZED {
6981            let _ = req.bytes().await?;
6982            return Ok(GetGwApiV1FormsResponse::Unauthorized);
6983        }
6984        if status == http::StatusCode::FORBIDDEN {
6985            let _ = req.bytes().await?;
6986            return Ok(GetGwApiV1FormsResponse::Forbidden);
6987        }
6988        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
6989            let _ = req.bytes().await?;
6990            return Ok(GetGwApiV1FormsResponse::UnsupportedMediaType);
6991        }
6992        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
6993            let _ = req.bytes().await?;
6994            return Ok(GetGwApiV1FormsResponse::InternalServerError);
6995        }
6996        let _ = req.bytes().await?;
6997        return Ok(GetGwApiV1FormsResponse::Unknown);
6998    }
6999}
7000#[serde_with::serde_as]
7001#[serde_with::skip_serializing_none]
7002#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
7003pub struct GetGwApiV1FormsRequestQuery {
7004    #[serde_as(as = "Option<oas3_gen_support::StringWithCommaSeparator>")]
7005    #[serde(rename = "formNo")]
7006    pub form_no: Option<Vec<String>>,
7007    #[serde(rename = "getDocs")]
7008    pub get_docs: Option<String>,
7009    #[serde(rename = "fromDate")]
7010    pub from_date: Option<String>,
7011    #[serde(rename = "toDate")]
7012    pub to_date: Option<String>,
7013    pub language: Option<String>,
7014    #[default(Some(Default::default()))]
7015    pub projection: Option<GetGwApiV1FormsRequestQueryProjection>,
7016}
7017#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
7018pub enum GetGwApiV1FormsRequestQueryProjection {
7019    #[serde(rename = "PAYLOAD")]
7020    #[default]
7021    Payload,
7022    #[serde(rename = "DOCS")]
7023    Docs,
7024    #[serde(rename = "NONE")]
7025    None,
7026}
7027impl core::fmt::Display for GetGwApiV1FormsRequestQueryProjection {
7028    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7029        match self {
7030            Self::Payload => write!(f, "PAYLOAD"),
7031            Self::Docs => write!(f, "DOCS"),
7032            Self::None => write!(f, "NONE"),
7033        }
7034    }
7035}
7036/// Get required forms<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
7037#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7038pub struct GetGwApiV1FormsRequiredFormsRequest {
7039    pub query: GetGwApiV1FormsRequiredFormsRequestQuery,
7040}
7041impl GetGwApiV1FormsRequiredFormsRequest {
7042    /// Parse the HTTP response into the response enum.
7043    pub async fn parse_response(
7044        req: reqwest::Response,
7045    ) -> anyhow::Result<GetGwApiV1FormsRequiredFormsResponse> {
7046        let status = req.status();
7047        if status == http::StatusCode::OK {
7048            let data =
7049                oas3_gen_support::Diagnostics::<RequiredFormsResponse>::json_with_diagnostics(req)
7050                    .await?;
7051            return Ok(GetGwApiV1FormsRequiredFormsResponse::Ok(data));
7052        }
7053        if status == http::StatusCode::BAD_REQUEST {
7054            let _ = req.bytes().await?;
7055            return Ok(GetGwApiV1FormsRequiredFormsResponse::BadRequest);
7056        }
7057        if status == http::StatusCode::UNAUTHORIZED {
7058            let _ = req.bytes().await?;
7059            return Ok(GetGwApiV1FormsRequiredFormsResponse::Unauthorized);
7060        }
7061        if status == http::StatusCode::FORBIDDEN {
7062            let _ = req.bytes().await?;
7063            return Ok(GetGwApiV1FormsRequiredFormsResponse::Forbidden);
7064        }
7065        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
7066            let _ = req.bytes().await?;
7067            return Ok(GetGwApiV1FormsRequiredFormsResponse::UnsupportedMediaType);
7068        }
7069        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7070            let _ = req.bytes().await?;
7071            return Ok(GetGwApiV1FormsRequiredFormsResponse::InternalServerError);
7072        }
7073        let _ = req.bytes().await?;
7074        return Ok(GetGwApiV1FormsRequiredFormsResponse::Unknown);
7075    }
7076}
7077#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
7078pub struct GetGwApiV1FormsRequiredFormsRequestQuery {
7079    #[serde(rename = "requiredFormsRequest")]
7080    pub required_forms_request: serde_json::Value,
7081}
7082/// Response types for get_gw_api_v1_forms_required_forms
7083#[derive(Debug, Clone)]
7084pub enum GetGwApiV1FormsRequiredFormsResponse {
7085    ///200: Get required forms
7086    Ok(RequiredFormsResponse),
7087    ///400: Returns error description representing bad request
7088    BadRequest,
7089    ///401: Returns error description representing access issue
7090    Unauthorized,
7091    ///403: Returns error description representing access issue
7092    Forbidden,
7093    ///415: Unsupported Media Type
7094    UnsupportedMediaType,
7095    ///500: Returns error description representing internal server error
7096    InternalServerError,
7097    ///default: Unknown response
7098    Unknown,
7099}
7100/// Response types for get_gw_api_v1_forms
7101#[derive(Debug, Clone)]
7102pub enum GetGwApiV1FormsResponse {
7103    ///200: Get forms
7104    Ok(FormFileResponse),
7105    ///400: Returns error description representing bad request
7106    BadRequest,
7107    ///401: Returns error description representing access issue
7108    Unauthorized,
7109    ///403: Returns error description representing access issue
7110    Forbidden,
7111    ///415: Unsupported Media Type
7112    UnsupportedMediaType,
7113    ///500: Returns error description representing internal server error
7114    InternalServerError,
7115    ///default: Unknown response
7116    Unknown,
7117}
7118/// Retrieve status of all requests associated with instructionSetId.<br><br>**Scope**: `instructions.read`<br>**Security Policy**: `HTTPS`
7119#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7120pub struct GetGwApiV1InstructionSetsInstructionsetidRequest {
7121    pub path: GetGwApiV1InstructionSetsInstructionsetidRequestPath,
7122    pub query: GetGwApiV1InstructionSetsInstructionsetidRequestQuery,
7123}
7124impl GetGwApiV1InstructionSetsInstructionsetidRequest {
7125    /// Parse the HTTP response into the response enum.
7126    pub async fn parse_response(
7127        req: reqwest::Response,
7128    ) -> anyhow::Result<GetGwApiV1InstructionSetsInstructionsetidResponse> {
7129        let status = req.status();
7130        if status == http::StatusCode::OK {
7131            let data =
7132                oas3_gen_support::Diagnostics::<BulkMultiStatusResponse>::json_with_diagnostics(
7133                    req,
7134                )
7135                .await?;
7136            return Ok(GetGwApiV1InstructionSetsInstructionsetidResponse::Ok(data));
7137        }
7138        if status == http::StatusCode::NOT_FOUND {
7139            let _ = req.bytes().await?;
7140            return Ok(GetGwApiV1InstructionSetsInstructionsetidResponse::NotFound);
7141        }
7142        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7143            let _ = req.bytes().await?;
7144            return Ok(GetGwApiV1InstructionSetsInstructionsetidResponse::InternalServerError);
7145        }
7146        let _ = req.bytes().await?;
7147        return Ok(GetGwApiV1InstructionSetsInstructionsetidResponse::Unknown);
7148    }
7149}
7150#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
7151pub struct GetGwApiV1InstructionSetsInstructionsetidRequestPath {
7152    /// The target instruction set id.
7153    /// - Example: `-1_988_905_739i32`
7154    pub instruction_set_id: i32,
7155}
7156#[serde_with::skip_serializing_none]
7157#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
7158pub struct GetGwApiV1InstructionSetsInstructionsetidRequestQuery {
7159    /// The client's clientId
7160    /// - Example: `Some("abc123".to_string())`
7161    #[serde(rename = "client-id")]
7162    pub client_id: Option<String>,
7163}
7164/// Response types for get_gw_api_v1_instruction_sets_instructionsetid
7165#[derive(Debug, Clone)]
7166pub enum GetGwApiV1InstructionSetsInstructionsetidResponse {
7167    ///200: Returns the status multiple instructions.
7168    Ok(BulkMultiStatusResponse),
7169    ///404: Returns a Problem detail instance representing a not found request.
7170    NotFound,
7171    ///500: Unable to process request due to an Internal Error. Please try again later.
7172    InternalServerError,
7173    ///default: Unknown response
7174    Unknown,
7175}
7176/// Retrieve status of request by instructionId<br><br>**Scope**: `instructions.read`<br>**Security Policy**: `HTTPS`
7177#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7178pub struct GetGwApiV1InstructionsInstructionidRequest {
7179    pub path: GetGwApiV1InstructionsInstructionidRequestPath,
7180    pub query: GetGwApiV1InstructionsInstructionidRequestQuery,
7181}
7182impl GetGwApiV1InstructionsInstructionidRequest {
7183    /// Parse the HTTP response into the response enum.
7184    pub async fn parse_response(
7185        req: reqwest::Response,
7186    ) -> anyhow::Result<GetGwApiV1InstructionsInstructionidResponse> {
7187        let status = req.status();
7188        if status == http::StatusCode::OK {
7189            let data =
7190                oas3_gen_support::Diagnostics::<Instruction200Response>::json_with_diagnostics(req)
7191                    .await?;
7192            return Ok(GetGwApiV1InstructionsInstructionidResponse::Ok(data));
7193        }
7194        if status == http::StatusCode::NOT_FOUND {
7195            let _ = req.bytes().await?;
7196            return Ok(GetGwApiV1InstructionsInstructionidResponse::NotFound);
7197        }
7198        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7199            let _ = req.bytes().await?;
7200            return Ok(GetGwApiV1InstructionsInstructionidResponse::InternalServerError);
7201        }
7202        let _ = req.bytes().await?;
7203        return Ok(GetGwApiV1InstructionsInstructionidResponse::Unknown);
7204    }
7205}
7206#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
7207pub struct GetGwApiV1InstructionsInstructionidRequestPath {
7208    /// The target instruction id.
7209    /// - Example: `-1_988_905_739i32`
7210    pub instruction_id: i32,
7211}
7212#[serde_with::skip_serializing_none]
7213#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
7214pub struct GetGwApiV1InstructionsInstructionidRequestQuery {
7215    /// The client's clientId
7216    /// - Example: `Some("abc123".to_string())`
7217    #[serde(rename = "client-id")]
7218    pub client_id: Option<String>,
7219}
7220/// Response types for get_gw_api_v1_instructions_instructionid
7221#[derive(Debug, Clone)]
7222pub enum GetGwApiV1InstructionsInstructionidResponse {
7223    ///200: Returns the status of an instruction.
7224    Ok(Instruction200Response),
7225    ///404: Returns a Problem detail instance representing a not found request.
7226    NotFound,
7227    ///500: Unable to process request due to an Internal Error. Please try again later.
7228    InternalServerError,
7229    ///default: Unknown response
7230    Unknown,
7231}
7232/// Get list of banks which support banking connection with Interactive Brokers.<br><br>**Scope**: `enumerations.read`<br>**Security Policy**: `HTTPS`
7233#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7234pub struct GetGwApiV1ParticipatingBanksRequest {
7235    #[validate(nested)]
7236    pub query: GetGwApiV1ParticipatingBanksRequestQuery,
7237}
7238impl GetGwApiV1ParticipatingBanksRequest {
7239    /// Parse the HTTP response into the response enum.
7240    pub async fn parse_response(
7241        req: reqwest::Response,
7242    ) -> anyhow::Result<GetGwApiV1ParticipatingBanksResponse> {
7243        let status = req.status();
7244        if status == http::StatusCode::OK {
7245            let data = oas3_gen_support::Diagnostics::<
7246                GetParticipatingListResponse,
7247            >::json_with_diagnostics(req)
7248                .await?;
7249            return Ok(GetGwApiV1ParticipatingBanksResponse::Ok(data));
7250        }
7251        if status == http::StatusCode::BAD_REQUEST {
7252            let _ = req.bytes().await?;
7253            return Ok(GetGwApiV1ParticipatingBanksResponse::BadRequest);
7254        }
7255        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7256            let _ = req.bytes().await?;
7257            return Ok(GetGwApiV1ParticipatingBanksResponse::InternalServerError);
7258        }
7259        let _ = req.bytes().await?;
7260        return Ok(GetGwApiV1ParticipatingBanksResponse::Unknown);
7261    }
7262}
7263#[serde_with::skip_serializing_none]
7264#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
7265pub struct GetGwApiV1ParticipatingBanksRequestQuery {
7266    /// The client's clientId
7267    /// - Example: `Some("abc123".to_string())`
7268    #[serde(rename = "client-id")]
7269    pub client_id: Option<String>,
7270    /// Parameter for which the list of participating banks is fetched
7271    #[serde(rename = "type")]
7272    #[validate(length(min = 1u64))]
7273    pub r#type: String,
7274}
7275/// Response types for get_gw_api_v1_participating_banks
7276#[derive(Debug, Clone)]
7277pub enum GetGwApiV1ParticipatingBanksResponse {
7278    ///200: Returns the list of participating banks.
7279    Ok(GetParticipatingListResponse),
7280    ///400: Returns a Problem detail instance representing a not found request.
7281    BadRequest,
7282    ///500: Unable to process request due to an Internal Error. Please try again later.
7283    InternalServerError,
7284    ///default: Unknown response
7285    Unknown,
7286}
7287/// Fetch Requests' Details By Timeframe<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
7288#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7289pub struct GetGwApiV1RequestsRequest {
7290    pub query: GetGwApiV1RequestsRequestQuery,
7291}
7292impl GetGwApiV1RequestsRequest {
7293    /// Parse the HTTP response into the response enum.
7294    pub async fn parse_response(
7295        req: reqwest::Response,
7296    ) -> anyhow::Result<GetGwApiV1RequestsResponse> {
7297        let status = req.status();
7298        if status == http::StatusCode::OK {
7299            let data =
7300                oas3_gen_support::Diagnostics::<RequestDetailsResponse>::json_with_diagnostics(req)
7301                    .await?;
7302            return Ok(GetGwApiV1RequestsResponse::Ok(data));
7303        }
7304        if status == http::StatusCode::BAD_REQUEST {
7305            let _ = req.bytes().await?;
7306            return Ok(GetGwApiV1RequestsResponse::BadRequest);
7307        }
7308        if status == http::StatusCode::UNAUTHORIZED {
7309            let _ = req.bytes().await?;
7310            return Ok(GetGwApiV1RequestsResponse::Unauthorized);
7311        }
7312        if status == http::StatusCode::FORBIDDEN {
7313            let _ = req.bytes().await?;
7314            return Ok(GetGwApiV1RequestsResponse::Forbidden);
7315        }
7316        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
7317            let _ = req.bytes().await?;
7318            return Ok(GetGwApiV1RequestsResponse::UnsupportedMediaType);
7319        }
7320        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7321            let _ = req.bytes().await?;
7322            return Ok(GetGwApiV1RequestsResponse::InternalServerError);
7323        }
7324        let _ = req.bytes().await?;
7325        return Ok(GetGwApiV1RequestsResponse::Unknown);
7326    }
7327}
7328#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
7329pub struct GetGwApiV1RequestsRequestQuery {
7330    #[serde(rename = "requestDetails")]
7331    pub request_details: serde_json::Value,
7332}
7333/// Response types for get_gw_api_v1_requests
7334#[derive(Debug, Clone)]
7335pub enum GetGwApiV1RequestsResponse {
7336    ///200: Fetch Requests' Details By Timeframe
7337    Ok(RequestDetailsResponse),
7338    ///400: Returns error description representing bad request
7339    BadRequest,
7340    ///401: Returns error description representing access issue
7341    Unauthorized,
7342    ///403: Returns error description representing access issue
7343    Forbidden,
7344    ///415: Unsupported Media Type
7345    UnsupportedMediaType,
7346    ///500: Returns error description representing internal server error
7347    InternalServerError,
7348    ///default: Unknown response
7349    Unknown,
7350}
7351/// <br>**Scope**: `statements.read` OR `reports.read`<br>**Security Policy**: `HTTPS`
7352#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7353pub struct GetGwApiV1StatementsAvailableRequest {
7354    #[validate(nested)]
7355    pub query: GetGwApiV1StatementsAvailableRequestQuery,
7356    #[validate(nested)]
7357    pub header: GetGwApiV1StatementsAvailableRequestHeader,
7358}
7359impl GetGwApiV1StatementsAvailableRequest {
7360    /// Parse the HTTP response into the response enum.
7361    pub async fn parse_response(
7362        req: reqwest::Response,
7363    ) -> anyhow::Result<GetGwApiV1StatementsAvailableResponse> {
7364        let status = req.status();
7365        if status == http::StatusCode::OK {
7366            let data = oas3_gen_support::Diagnostics::<
7367                GetAvailableStmtDatesResponse,
7368            >::json_with_diagnostics(req)
7369                .await?;
7370            return Ok(GetGwApiV1StatementsAvailableResponse::Ok(data));
7371        }
7372        if status == http::StatusCode::BAD_REQUEST {
7373            let _ = req.bytes().await?;
7374            return Ok(GetGwApiV1StatementsAvailableResponse::BadRequest);
7375        }
7376        if status == http::StatusCode::UNAUTHORIZED {
7377            let _ = req.bytes().await?;
7378            return Ok(GetGwApiV1StatementsAvailableResponse::Unauthorized);
7379        }
7380        if status == http::StatusCode::PAYMENT_REQUIRED {
7381            let _ = req.bytes().await?;
7382            return Ok(GetGwApiV1StatementsAvailableResponse::PaymentRequired);
7383        }
7384        if status == http::StatusCode::FORBIDDEN {
7385            let _ = req.bytes().await?;
7386            return Ok(GetGwApiV1StatementsAvailableResponse::Forbidden);
7387        }
7388        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7389            let _ = req.bytes().await?;
7390            return Ok(GetGwApiV1StatementsAvailableResponse::InternalServerError);
7391        }
7392        let _ = req.bytes().await?;
7393        return Ok(GetGwApiV1StatementsAvailableResponse::Unknown);
7394    }
7395}
7396#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
7397pub struct GetGwApiV1StatementsAvailableRequestHeader {
7398    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
7399    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
7400    #[validate(length(min = 1u64))]
7401    pub authorization: String,
7402}
7403impl core::convert::TryFrom<&GetGwApiV1StatementsAvailableRequestHeader> for http::HeaderMap {
7404    type Error = http::header::InvalidHeaderValue;
7405    fn try_from(
7406        headers: &GetGwApiV1StatementsAvailableRequestHeader,
7407    ) -> core::result::Result<Self, Self::Error> {
7408        let mut map = http::HeaderMap::with_capacity(1usize);
7409        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
7410        map.insert(AUTHORIZATION, header_value);
7411        Ok(map)
7412    }
7413}
7414impl core::convert::TryFrom<GetGwApiV1StatementsAvailableRequestHeader> for http::HeaderMap {
7415    type Error = http::header::InvalidHeaderValue;
7416    fn try_from(
7417        headers: GetGwApiV1StatementsAvailableRequestHeader,
7418    ) -> core::result::Result<Self, Self::Error> {
7419        http::HeaderMap::try_from(&headers)
7420    }
7421}
7422#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
7423pub struct GetGwApiV1StatementsAvailableRequestQuery {
7424    /// Specifies the account id to retrieve information
7425    /// - Example: `"UXXXX".to_string()`
7426    #[serde(rename = "accountId")]
7427    #[validate(length(min = 1u64))]
7428    pub account_id: String,
7429}
7430/// Response types for get_gw_api_v1_statements_available
7431#[derive(Debug, Clone)]
7432pub enum GetGwApiV1StatementsAvailableResponse {
7433    ///200: Returns a JSON object containing the available report dates.
7434    Ok(GetAvailableStmtDatesResponse),
7435    ///400: Returns a Problem detail instance representing a bad request.
7436    BadRequest,
7437    ///401: Returns a Problem detail instance representing an unauthorized request.
7438    Unauthorized,
7439    ///402: Returns a Problem detail instance representing an unauthorized request.
7440    PaymentRequired,
7441    ///403: Returns a Problem detail instance representing a forbidden request.
7442    Forbidden,
7443    ///500: Returns a Problem detail instance representing an internal server error.
7444    InternalServerError,
7445    ///default: Unknown response
7446    Unknown,
7447}
7448/// <br>**Scope**: `statements.read` OR `reports.read`<br>**Security Policy**: `HTTPS`
7449#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7450pub struct GetGwApiV1TaxDocumentsAvailableRequest {
7451    #[validate(nested)]
7452    pub query: GetGwApiV1TaxDocumentsAvailableRequestQuery,
7453    #[validate(nested)]
7454    pub header: GetGwApiV1TaxDocumentsAvailableRequestHeader,
7455}
7456impl GetGwApiV1TaxDocumentsAvailableRequest {
7457    /// Parse the HTTP response into the response enum.
7458    pub async fn parse_response(
7459        req: reqwest::Response,
7460    ) -> anyhow::Result<GetGwApiV1TaxDocumentsAvailableResponse> {
7461        let status = req.status();
7462        if status == http::StatusCode::OK {
7463            let data = oas3_gen_support::Diagnostics::<
7464                GetAvailableTaxFormsResponse,
7465            >::json_with_diagnostics(req)
7466                .await?;
7467            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::Ok(data));
7468        }
7469        if status == http::StatusCode::BAD_REQUEST {
7470            let _ = req.bytes().await?;
7471            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::BadRequest);
7472        }
7473        if status == http::StatusCode::UNAUTHORIZED {
7474            let _ = req.bytes().await?;
7475            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::Unauthorized);
7476        }
7477        if status == http::StatusCode::PAYMENT_REQUIRED {
7478            let _ = req.bytes().await?;
7479            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::PaymentRequired);
7480        }
7481        if status == http::StatusCode::FORBIDDEN {
7482            let _ = req.bytes().await?;
7483            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::Forbidden);
7484        }
7485        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7486            let _ = req.bytes().await?;
7487            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::InternalServerError);
7488        }
7489        let _ = req.bytes().await?;
7490        return Ok(GetGwApiV1TaxDocumentsAvailableResponse::Unknown);
7491    }
7492}
7493#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
7494pub struct GetGwApiV1TaxDocumentsAvailableRequestHeader {
7495    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
7496    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
7497    #[validate(length(min = 1u64))]
7498    pub authorization: String,
7499}
7500impl core::convert::TryFrom<&GetGwApiV1TaxDocumentsAvailableRequestHeader> for http::HeaderMap {
7501    type Error = http::header::InvalidHeaderValue;
7502    fn try_from(
7503        headers: &GetGwApiV1TaxDocumentsAvailableRequestHeader,
7504    ) -> core::result::Result<Self, Self::Error> {
7505        let mut map = http::HeaderMap::with_capacity(1usize);
7506        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
7507        map.insert(AUTHORIZATION, header_value);
7508        Ok(map)
7509    }
7510}
7511impl core::convert::TryFrom<GetGwApiV1TaxDocumentsAvailableRequestHeader> for http::HeaderMap {
7512    type Error = http::header::InvalidHeaderValue;
7513    fn try_from(
7514        headers: GetGwApiV1TaxDocumentsAvailableRequestHeader,
7515    ) -> core::result::Result<Self, Self::Error> {
7516        http::HeaderMap::try_from(&headers)
7517    }
7518}
7519#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
7520pub struct GetGwApiV1TaxDocumentsAvailableRequestQuery {
7521    /// Specifies the account id to retrieve information
7522    /// - Example: `"UXXXX".to_string()`
7523    #[serde(rename = "accountId")]
7524    #[validate(length(min = 1u64))]
7525    pub account_id: String,
7526    /// Specifies the tax year to retrieve information
7527    /// - Example: `2_024i32`
7528    pub year: i32,
7529}
7530/// Response types for get_gw_api_v1_tax_documents_available
7531#[derive(Debug, Clone)]
7532pub enum GetGwApiV1TaxDocumentsAvailableResponse {
7533    ///200: Returns a JSON object containing the available report dates.
7534    Ok(GetAvailableTaxFormsResponse),
7535    ///400: Returns a Problem detail instance representing a bad request.
7536    BadRequest,
7537    ///401: Returns a Problem detail instance representing an unauthorized request.
7538    Unauthorized,
7539    ///402: Returns a Problem detail instance representing an unauthorized request.
7540    PaymentRequired,
7541    ///403: Returns a Problem detail instance representing a forbidden request.
7542    Forbidden,
7543    ///500: Returns a Problem detail instance representing an internal server error.
7544    InternalServerError,
7545    ///default: Unknown response
7546    Unknown,
7547}
7548/// <br>**Scope**: `statements.read` OR `reports.read`<br>**Security Policy**: `HTTPS`
7549#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7550pub struct GetGwApiV1TradeConfirmationsAvailableRequest {
7551    #[validate(nested)]
7552    pub query: GetGwApiV1TradeConfirmationsAvailableRequestQuery,
7553    #[validate(nested)]
7554    pub header: GetGwApiV1TradeConfirmationsAvailableRequestHeader,
7555}
7556impl GetGwApiV1TradeConfirmationsAvailableRequest {
7557    /// Parse the HTTP response into the response enum.
7558    pub async fn parse_response(
7559        req: reqwest::Response,
7560    ) -> anyhow::Result<GetGwApiV1TradeConfirmationsAvailableResponse> {
7561        let status = req.status();
7562        if status == http::StatusCode::OK {
7563            let data = oas3_gen_support::Diagnostics::<
7564                GetAvailableTradeConfirmationDatesResponse,
7565            >::json_with_diagnostics(req)
7566                .await?;
7567            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::Ok(data));
7568        }
7569        if status == http::StatusCode::BAD_REQUEST {
7570            let _ = req.bytes().await?;
7571            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::BadRequest);
7572        }
7573        if status == http::StatusCode::UNAUTHORIZED {
7574            let _ = req.bytes().await?;
7575            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::Unauthorized);
7576        }
7577        if status == http::StatusCode::PAYMENT_REQUIRED {
7578            let _ = req.bytes().await?;
7579            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::PaymentRequired);
7580        }
7581        if status == http::StatusCode::FORBIDDEN {
7582            let _ = req.bytes().await?;
7583            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::Forbidden);
7584        }
7585        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7586            let _ = req.bytes().await?;
7587            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::InternalServerError);
7588        }
7589        let _ = req.bytes().await?;
7590        return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::Unknown);
7591    }
7592}
7593#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
7594pub struct GetGwApiV1TradeConfirmationsAvailableRequestHeader {
7595    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
7596    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
7597    #[validate(length(min = 1u64))]
7598    pub authorization: String,
7599}
7600impl core::convert::TryFrom<&GetGwApiV1TradeConfirmationsAvailableRequestHeader>
7601    for http::HeaderMap
7602{
7603    type Error = http::header::InvalidHeaderValue;
7604    fn try_from(
7605        headers: &GetGwApiV1TradeConfirmationsAvailableRequestHeader,
7606    ) -> core::result::Result<Self, Self::Error> {
7607        let mut map = http::HeaderMap::with_capacity(1usize);
7608        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
7609        map.insert(AUTHORIZATION, header_value);
7610        Ok(map)
7611    }
7612}
7613impl core::convert::TryFrom<GetGwApiV1TradeConfirmationsAvailableRequestHeader>
7614    for http::HeaderMap
7615{
7616    type Error = http::header::InvalidHeaderValue;
7617    fn try_from(
7618        headers: GetGwApiV1TradeConfirmationsAvailableRequestHeader,
7619    ) -> core::result::Result<Self, Self::Error> {
7620        http::HeaderMap::try_from(&headers)
7621    }
7622}
7623#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
7624pub struct GetGwApiV1TradeConfirmationsAvailableRequestQuery {
7625    /// Specifies the account id to retrieve information
7626    /// - Example: `"UXXXX".to_string()`
7627    #[serde(rename = "accountId")]
7628    #[validate(length(min = 1u64))]
7629    pub account_id: String,
7630}
7631/// Response types for get_gw_api_v1_trade_confirmations_available
7632#[derive(Debug, Clone)]
7633pub enum GetGwApiV1TradeConfirmationsAvailableResponse {
7634    ///200: Returns a JSON object containing the available user-traded dates.
7635    Ok(GetAvailableTradeConfirmationDatesResponse),
7636    ///400: Returns a Problem detail instance representing a bad request.
7637    BadRequest,
7638    ///401: Returns a Problem detail instance representing an unauthorized request.
7639    Unauthorized,
7640    ///402: Returns a Problem detail instance representing an unauthorized request.
7641    PaymentRequired,
7642    ///403: Returns a Problem detail instance representing a forbidden request.
7643    Forbidden,
7644    ///500: Returns a Problem detail instance representing an internal server error.
7645    InternalServerError,
7646    ///default: Unknown response
7647    Unknown,
7648}
7649/// Verify whether user is valid and available<br><br>**Scope**: `accounts.read` OR `validations.read`<br>**Security Policy**: `HTTPS`
7650#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7651pub struct GetGwApiV1ValidationsUsernamesUsernameRequest {
7652    #[validate(nested)]
7653    pub path: GetGwApiV1ValidationsUsernamesUsernameRequestPath,
7654}
7655impl GetGwApiV1ValidationsUsernamesUsernameRequest {
7656    /// Parse the HTTP response into the response enum.
7657    pub async fn parse_response(
7658        req: reqwest::Response,
7659    ) -> anyhow::Result<GetGwApiV1ValidationsUsernamesUsernameResponse> {
7660        let status = req.status();
7661        if status == http::StatusCode::OK {
7662            let data =
7663                oas3_gen_support::Diagnostics::<UserNameAvailableResponse>::json_with_diagnostics(
7664                    req,
7665                )
7666                .await?;
7667            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::Ok(data));
7668        }
7669        if status == http::StatusCode::BAD_REQUEST {
7670            let _ = req.bytes().await?;
7671            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::BadRequest);
7672        }
7673        if status == http::StatusCode::UNAUTHORIZED {
7674            let _ = req.bytes().await?;
7675            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::Unauthorized);
7676        }
7677        if status == http::StatusCode::FORBIDDEN {
7678            let _ = req.bytes().await?;
7679            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::Forbidden);
7680        }
7681        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
7682            let _ = req.bytes().await?;
7683            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::UnsupportedMediaType);
7684        }
7685        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7686            let _ = req.bytes().await?;
7687            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::InternalServerError);
7688        }
7689        let _ = req.bytes().await?;
7690        return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::Unknown);
7691    }
7692}
7693#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
7694pub struct GetGwApiV1ValidationsUsernamesUsernameRequestPath {
7695    #[validate(length(min = 1u64))]
7696    pub username: String,
7697}
7698/// Response types for get_gw_api_v1_validations_usernames_username
7699#[derive(Debug, Clone)]
7700pub enum GetGwApiV1ValidationsUsernamesUsernameResponse {
7701    ///200: Verify whether user is valid and available
7702    Ok(UserNameAvailableResponse),
7703    ///400: Returns error description representing bad request
7704    BadRequest,
7705    ///401: Returns error description representing access issue
7706    Unauthorized,
7707    ///403: Returns error description representing access issue
7708    Forbidden,
7709    ///415: Unsupported Media Type
7710    UnsupportedMediaType,
7711    ///500: Returns error description representing internal server error
7712    InternalServerError,
7713    ///default: Unknown response
7714    Unknown,
7715}
7716/// Requests full contract details and trading rules for the given conid. A follow-up request will provide additional trading rules.
7717#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7718pub struct GetInfoAndRulesRequest {
7719    #[validate(nested)]
7720    pub path: GetInfoAndRulesRequestPath,
7721}
7722impl GetInfoAndRulesRequest {
7723    /// Parse the HTTP response into the response enum.
7724    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetInfoAndRulesResponse> {
7725        let status = req.status();
7726        if status == http::StatusCode::OK {
7727            let data = oas3_gen_support::Diagnostics::<Rule200Response>::json_with_diagnostics(req)
7728                .await?;
7729            return Ok(GetInfoAndRulesResponse::Ok(data));
7730        }
7731        if status == http::StatusCode::UNAUTHORIZED {
7732            let _ = req.bytes().await?;
7733            return Ok(GetInfoAndRulesResponse::Unauthorized);
7734        }
7735        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7736            let _ = req.bytes().await?;
7737            return Ok(GetInfoAndRulesResponse::InternalServerError);
7738        }
7739        if status == http::StatusCode::SERVICE_UNAVAILABLE {
7740            let _ = req.bytes().await?;
7741            return Ok(GetInfoAndRulesResponse::ServiceUnavailable);
7742        }
7743        let _ = req.bytes().await?;
7744        return Ok(GetInfoAndRulesResponse::Unknown);
7745    }
7746}
7747#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
7748pub struct GetInfoAndRulesRequestPath {
7749    /// Contract identifier for the requested contract of interest.
7750    /// - Example: `"265598".to_string()`
7751    #[validate(length(min = 1u64))]
7752    pub conid: String,
7753}
7754/// Response types for getInfoAndRules
7755#[derive(Debug, Clone)]
7756pub enum GetInfoAndRulesResponse {
7757    ///200: Returns all contract information and trading rules for the contract.
7758    Ok(Rule200Response),
7759    ///401: Invalid or expired access token
7760    Unauthorized,
7761    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
7762     */
7763    InternalServerError,
7764    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
7765     */
7766    ServiceUnavailable,
7767    ///default: Unknown response
7768    Unknown,
7769}
7770/// Returns a list of security definitions for the given conids.
7771#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7772pub struct GetInstrumentDefinitionRequest {
7773    #[validate(nested)]
7774    pub query: GetInstrumentDefinitionRequestQuery,
7775}
7776impl GetInstrumentDefinitionRequest {
7777    /// Parse the HTTP response into the response enum.
7778    pub async fn parse_response(
7779        req: reqwest::Response,
7780    ) -> anyhow::Result<GetInstrumentDefinitionResponse> {
7781        let status = req.status();
7782        if status == http::StatusCode::OK {
7783            let data =
7784                oas3_gen_support::Diagnostics::<TrsrvSecDefResponse>::json_with_diagnostics(req)
7785                    .await?;
7786            return Ok(GetInstrumentDefinitionResponse::Ok(data));
7787        }
7788        if status == http::StatusCode::BAD_REQUEST {
7789            let _ = req.bytes().await?;
7790            return Ok(GetInstrumentDefinitionResponse::BadRequest);
7791        }
7792        if status == http::StatusCode::UNAUTHORIZED {
7793            let _ = req.bytes().await?;
7794            return Ok(GetInstrumentDefinitionResponse::Unauthorized);
7795        }
7796        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7797            let _ = req.bytes().await?;
7798            return Ok(GetInstrumentDefinitionResponse::InternalServerError);
7799        }
7800        if status == http::StatusCode::SERVICE_UNAVAILABLE {
7801            let _ = req.bytes().await?;
7802            return Ok(GetInstrumentDefinitionResponse::ServiceUnavailable);
7803        }
7804        let _ = req.bytes().await?;
7805        return Ok(GetInstrumentDefinitionResponse::Unknown);
7806    }
7807}
7808#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
7809pub struct GetInstrumentDefinitionRequestQuery {
7810    /// A comma separated series of contract IDs.
7811    /// - Example: `"265598,8314".to_string()`
7812    #[validate(length(min = 1u64))]
7813    pub conids: String,
7814}
7815/// Response types for getInstrumentDefinition
7816#[derive(Debug, Clone)]
7817pub enum GetInstrumentDefinitionResponse {
7818    ///200: Successful response containing a contract's security definition.
7819    Ok(TrsrvSecDefResponse),
7820    ///400: Invalid input format or missing required fields
7821    BadRequest,
7822    ///401: Invalid or expired access token
7823    Unauthorized,
7824    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
7825     */
7826    InternalServerError,
7827    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
7828     */
7829    ServiceUnavailable,
7830    ///default: Unknown response
7831    Unknown,
7832}
7833/// Requests full contract details for the given conid.
7834#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7835pub struct GetInstrumentInfoRequest {
7836    #[validate(nested)]
7837    pub path: GetInstrumentInfoRequestPath,
7838}
7839impl GetInstrumentInfoRequest {
7840    /// Parse the HTTP response into the response enum.
7841    pub async fn parse_response(
7842        req: reqwest::Response,
7843    ) -> anyhow::Result<GetInstrumentInfoResponse> {
7844        let status = req.status();
7845        if status == http::StatusCode::OK {
7846            let data =
7847                oas3_gen_support::Diagnostics::<ContractInfo>::json_with_diagnostics(req).await?;
7848            return Ok(GetInstrumentInfoResponse::Ok(data));
7849        }
7850        if status == http::StatusCode::UNAUTHORIZED {
7851            let _ = req.bytes().await?;
7852            return Ok(GetInstrumentInfoResponse::Unauthorized);
7853        }
7854        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7855            let _ = req.bytes().await?;
7856            return Ok(GetInstrumentInfoResponse::InternalServerError);
7857        }
7858        if status == http::StatusCode::SERVICE_UNAVAILABLE {
7859            let _ = req.bytes().await?;
7860            return Ok(GetInstrumentInfoResponse::ServiceUnavailable);
7861        }
7862        let _ = req.bytes().await?;
7863        return Ok(GetInstrumentInfoResponse::Unknown);
7864    }
7865}
7866#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
7867pub struct GetInstrumentInfoRequestPath {
7868    /// Contract identifier for the requested contract of interest.
7869    /// - Example: `"265598".to_string()`
7870    #[validate(length(min = 1u64))]
7871    pub conid: String,
7872}
7873/// Response types for getInstrumentInfo
7874#[derive(Debug, Clone)]
7875pub enum GetInstrumentInfoResponse {
7876    ///200: Returns detailed information for the passed contract.
7877    Ok(ContractInfo),
7878    ///401: Invalid or expired access token
7879    Unauthorized,
7880    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
7881     */
7882    InternalServerError,
7883    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
7884     */
7885    ServiceUnavailable,
7886    ///default: Unknown response
7887    Unknown,
7888}
7889/// Request the list of all accounts already invested in the provided model and a summary of their investment.
7890#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7891pub struct GetInvestedAccountsInModelRequest {
7892    pub body: PositionRequestBody,
7893}
7894impl GetInvestedAccountsInModelRequest {
7895    /// Parse the HTTP response into the response enum.
7896    pub async fn parse_response(
7897        req: reqwest::Response,
7898    ) -> anyhow::Result<GetInvestedAccountsInModelResponse> {
7899        let status = req.status();
7900        if status == http::StatusCode::OK {
7901            let data =
7902                oas3_gen_support::Diagnostics::<GetInvestedAccountsSummary>::json_with_diagnostics(
7903                    req,
7904                )
7905                .await?;
7906            return Ok(GetInvestedAccountsInModelResponse::Ok(data));
7907        }
7908        if status == http::StatusCode::UNAUTHORIZED {
7909            let _ = req.bytes().await?;
7910            return Ok(GetInvestedAccountsInModelResponse::Unauthorized);
7911        }
7912        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
7913            let _ = req.bytes().await?;
7914            return Ok(GetInvestedAccountsInModelResponse::InternalServerError);
7915        }
7916        if status == http::StatusCode::SERVICE_UNAVAILABLE {
7917            let _ = req.bytes().await?;
7918            return Ok(GetInvestedAccountsInModelResponse::ServiceUnavailable);
7919        }
7920        let _ = req.bytes().await?;
7921        return Ok(GetInvestedAccountsInModelResponse::Unknown);
7922    }
7923}
7924/// Response types for getInvestedAccountsInModel
7925#[derive(Debug, Clone)]
7926pub enum GetInvestedAccountsInModelResponse {
7927    ///200: Successfully retrieve preset details
7928    Ok(GetInvestedAccountsSummary),
7929    ///401: Invalid or expired access token
7930    Unauthorized,
7931    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
7932     */
7933    InternalServerError,
7934    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
7935     */
7936    ServiceUnavailable,
7937    ///default: Unknown response
7938    Unknown,
7939}
7940#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
7941pub struct GetInvestedAccountsSummary {
7942    /// Array of account details with net liquidation values and currency information
7943    #[serde(rename = "accountList")]
7944    pub account_list: Option<Vec<GetInvestedAccountsSummaryAccountList>>,
7945    /// Base currency for the master account (ISO 4217 currency code)
7946    #[serde(rename = "baseCcyMaster")]
7947    pub base_ccy_master: Option<String>,
7948    /// Precision for the master account base currency (decimal places)
7949    #[serde(rename = "baseCcyMasterPrecision")]
7950    pub base_ccy_master_precision: Option<String>,
7951    /// Model portfolio identifier associated with this account list
7952    pub model: Option<String>,
7953    /// Unique request identifier for tracking API calls
7954    #[serde(rename = "reqID")]
7955    pub req_id: Option<i32>,
7956    /// Market data subscription status (1 = active, 0 = inactive)
7957    #[serde(rename = "subscriptionStatus")]
7958    pub subscription_status: Option<AlertActivationRequestAlertActive>,
7959}
7960#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
7961pub struct GetInvestedAccountsSummaryAccountList {
7962    /// Account identifier (account number)
7963    pub account: Option<String>,
7964    /// Net liquidation value for positions in the current model portfolio
7965    #[serde(rename = "accountModelNlv")]
7966    pub account_model_nlv: Option<String>,
7967    /// Net liquidation value for positions in other model portfolios
7968    #[serde(rename = "accountOtherModelsNlv")]
7969    pub account_other_models_nlv: Option<String>,
7970    /// User-defined alias for the account (empty string if not set)
7971    pub alias: Option<String>,
7972    /// Base currency for this account (ISO 4217 currency code)
7973    #[serde(rename = "baseCcyAccount")]
7974    pub base_ccy_account: Option<String>,
7975    /// Precision for the account base currency (decimal places)
7976    #[serde(rename = "baseCcyAccountPrecision")]
7977    pub base_ccy_account_precision: Option<String>,
7978    /// Individual cash net liquidation value in base currency
7979    #[serde(rename = "cashInIndependentNlv")]
7980    pub cash_in_independent_nlv: Option<String>,
7981    /// Exchange rate from account base currency to master base currency
7982    #[serde(rename = "exchangeRate")]
7983    pub exchange_rate: Option<f64>,
7984    /// Total net liquidation value (cash + positions) in base currency
7985    pub nlv: Option<String>,
7986    /// Individual position net liquidation value in base currency
7987    #[serde(rename = "positionsInIndependentNlv")]
7988    pub positions_in_independent_nlv: Option<String>,
7989}
7990/// Used in tiered account structures (such as Financial Advisor and IBroker Accounts) to return a list of sub-accounts, paginated up to 20 accounts per page, for which the user can view position and account-related information.  This endpoint must be called prior to calling other /portfolio endpoints for those sub-accounts. If you have less than 100 sub-accounts use /portfolio/subaccounts.  To query a list of accounts the user can trade, see /iserver/accounts.
7991#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
7992pub struct GetManySubaccountsRequest {
7993    pub query: GetManySubaccountsRequestQuery,
7994}
7995impl GetManySubaccountsRequest {
7996    /// Parse the HTTP response into the response enum.
7997    pub async fn parse_response(
7998        req: reqwest::Response,
7999    ) -> anyhow::Result<GetManySubaccountsResponse> {
8000        let status = req.status();
8001        if status == http::StatusCode::OK {
8002            let data =
8003                oas3_gen_support::Diagnostics::<Subaccounts2Response>::json_with_diagnostics(req)
8004                    .await?;
8005            return Ok(GetManySubaccountsResponse::Ok(data));
8006        }
8007        if status == http::StatusCode::UNAUTHORIZED {
8008            let _ = req.bytes().await?;
8009            return Ok(GetManySubaccountsResponse::Unauthorized);
8010        }
8011        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8012            let _ = req.bytes().await?;
8013            return Ok(GetManySubaccountsResponse::InternalServerError);
8014        }
8015        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8016            let _ = req.bytes().await?;
8017            return Ok(GetManySubaccountsResponse::ServiceUnavailable);
8018        }
8019        let _ = req.bytes().await?;
8020        return Ok(GetManySubaccountsResponse::Unknown);
8021    }
8022}
8023#[serde_with::skip_serializing_none]
8024#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
8025pub struct GetManySubaccountsRequestQuery {
8026    /// accountId
8027    /// - Example: `Some("DU123456".to_string())`
8028    #[serde(rename = "accountId")]
8029    pub account_id: Option<String>,
8030    /// Set if request should be made without caching.
8031    #[default(Some(false))]
8032    pub nocache: Option<bool>,
8033}
8034/// Response types for getManySubaccounts
8035#[derive(Debug, Clone)]
8036pub enum GetManySubaccountsResponse {
8037    ///200: response with subaccount definitions
8038    Ok(Subaccounts2Response),
8039    ///401: Invalid or expired access token
8040    Unauthorized,
8041    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8042     */
8043    InternalServerError,
8044    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8045     */
8046    ServiceUnavailable,
8047    ///default: Unknown response
8048    Unknown,
8049}
8050/// Returns a summary of an account's margin, in total and by account segment.
8051#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8052pub struct GetMarginSummaryRequest {
8053    #[validate(nested)]
8054    pub path: GetMarginSummaryRequestPath,
8055}
8056impl GetMarginSummaryRequest {
8057    /// Parse the HTTP response into the response enum.
8058    pub async fn parse_response(
8059        req: reqwest::Response,
8060    ) -> anyhow::Result<GetMarginSummaryResponse> {
8061        let status = req.status();
8062        if status == http::StatusCode::OK {
8063            let data = oas3_gen_support::Diagnostics::<
8064                SummaryOfAccountMarginResponse,
8065            >::json_with_diagnostics(req)
8066                .await?;
8067            return Ok(GetMarginSummaryResponse::Ok(data));
8068        }
8069        if status == http::StatusCode::BAD_REQUEST {
8070            let _ = req.bytes().await?;
8071            return Ok(GetMarginSummaryResponse::BadRequest);
8072        }
8073        if status == http::StatusCode::UNAUTHORIZED {
8074            let _ = req.bytes().await?;
8075            return Ok(GetMarginSummaryResponse::Unauthorized);
8076        }
8077        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8078            let _ = req.bytes().await?;
8079            return Ok(GetMarginSummaryResponse::ServiceUnavailable);
8080        }
8081        let _ = req.bytes().await?;
8082        return Ok(GetMarginSummaryResponse::Unknown);
8083    }
8084}
8085#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
8086pub struct GetMarginSummaryRequestPath {
8087    /// Pass the account identifier to receive information for.
8088    /// - Example: `"U1234567".to_string()`
8089    #[validate(length(min = 1u64))]
8090    pub account_id: String,
8091}
8092/// Response types for getMarginSummary
8093#[derive(Debug, Clone)]
8094pub enum GetMarginSummaryResponse {
8095    ///200: Indicates a success request to receive margin balance values.
8096    Ok(SummaryOfAccountMarginResponse),
8097    ///400: bad request; passed input cannot pass initial validation and detected right away
8098    BadRequest,
8099    ///401: Invalid or expired access token
8100    Unauthorized,
8101    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8102     */
8103    ServiceUnavailable,
8104    ///default: Unknown response
8105    Unknown,
8106}
8107/// Request historical data for an instrument in the form of OHLC bars.
8108#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8109pub struct GetMdHistoryRequest {
8110    #[validate(nested)]
8111    pub query: GetMdHistoryRequestQuery,
8112}
8113impl GetMdHistoryRequest {
8114    /// Parse the HTTP response into the response enum.
8115    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetMdHistoryResponse> {
8116        let status = req.status();
8117        if status == http::StatusCode::OK {
8118            let data =
8119                oas3_gen_support::Diagnostics::<History200Response>::json_with_diagnostics(req)
8120                    .await?;
8121            return Ok(GetMdHistoryResponse::Ok(data));
8122        }
8123        if status == http::StatusCode::BAD_REQUEST {
8124            let _ = req.bytes().await?;
8125            return Ok(GetMdHistoryResponse::BadRequest);
8126        }
8127        if status == http::StatusCode::UNAUTHORIZED {
8128            let _ = req.bytes().await?;
8129            return Ok(GetMdHistoryResponse::Unauthorized);
8130        }
8131        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8132            let _ = req.bytes().await?;
8133            return Ok(GetMdHistoryResponse::InternalServerError);
8134        }
8135        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8136            let _ = req.bytes().await?;
8137            return Ok(GetMdHistoryResponse::ServiceUnavailable);
8138        }
8139        let _ = req.bytes().await?;
8140        return Ok(GetMdHistoryResponse::Unknown);
8141    }
8142}
8143#[serde_with::skip_serializing_none]
8144#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
8145pub struct GetMdHistoryRequestQuery {
8146    /// IB contract ID of the requested instrument.
8147    /// - Example: `265_598i32`
8148    pub conid: i32,
8149    /// A time duration away from startTime into the future to be divided into bars of the specified width. Supported Period Sizes
8150    ///   * `min` - Minutes
8151    ///   * `h` - Hour(s)
8152    ///   * `d` - Day(s)
8153    ///   * `w` - Week(s)
8154    ///   * `m` - Month(s)
8155    ///   * `y` - Year(s)
8156    /// - Example: `"6d".to_string()`
8157    #[validate(length(min = 1u64))]
8158    #[default("1d".to_string())]
8159    pub period: String,
8160    /// The width of the bars into which the interval determined by period and startTime will be divided. It is not required that bar evenly divide period; partial bars can be returned. Supported Bar Sizes
8161    ///   * `S` - Second(s)
8162    ///   * `min` - Minute(s)
8163    ///   * `h` - Hour(s)
8164    ///   * `d` - Day(s)
8165    ///   * `w` - Week(s)
8166    ///   * `m` - Month(s)
8167    /// - Example: `"5min".to_string()`
8168    #[validate(length(min = 1u64))]
8169    #[default("1min".to_string())]
8170    pub bar: String,
8171    /// Exchange (or SMART) from which data is requested.
8172    /// - Example: `Some("NASDAQ".to_string())`
8173    pub exchange: Option<String>,
8174    /// Indicates whether data outside of regular trading hours should be included in response.
8175    #[serde(rename = "outsideRth")]
8176    #[default(Some(false))]
8177    pub outside_rth: Option<bool>,
8178    /// A fixed UTC date-time reference point for the historical data request, from which the specified period extends. Format is YYYYMMDD-hh:mm:ss. If omitted, the current time is used, and direction must be omitted or 1.
8179    /// - Example: `Some("20231018-16:00:00".to_string())`
8180    #[serde(rename = "startTime")]
8181    pub start_time: Option<String>,
8182    /// Indicates whether data should begin or end at the start time.
8183    ///   * `-1` - Historical data will begin away from the start time, ending at the current time/startTime.
8184    ///   * `1` - Historical data begins at the start time, moving towards the current time. Only supported when startTime is included.
8185    #[default(Some(Default::default()))]
8186    pub direction: Option<GetMdHistoryRequestQueryDirection>,
8187    /// The type of data to be returned in the historical bars. Supported Bar Sizes
8188    ///   * `Bid_Ask` - The OHLC bid/ask values.
8189    ///   * `Last` - The OHLC trade values.
8190    ///   * `Midpoint` - The OHLC of the Bid-Ask midpoint.
8191    /// - Example: `Some("Midpoint".to_string())`
8192    #[default(Some("Last".to_string()))]
8193    pub source: Option<String>,
8194}
8195#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
8196pub enum GetMdHistoryRequestQueryDirection {
8197    #[serde(rename = "-1")]
8198    #[default]
8199    Value_1,
8200    #[serde(rename = "1")]
8201    Value1,
8202}
8203impl core::fmt::Display for GetMdHistoryRequestQueryDirection {
8204    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8205        match self {
8206            Self::Value_1 => write!(f, "-1"),
8207            Self::Value1 => write!(f, "1"),
8208        }
8209    }
8210}
8211/// Response types for getMdHistory
8212#[derive(Debug, Clone)]
8213pub enum GetMdHistoryResponse {
8214    ///200: Historical data query successfully returned data.
8215    Ok(History200Response),
8216    ///400: Invalid input format or missing required fields
8217    BadRequest,
8218    ///401: Invalid or expired access token
8219    Unauthorized,
8220    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8221     */
8222    InternalServerError,
8223    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8224     */
8225    ServiceUnavailable,
8226    ///default: Unknown response
8227    Unknown,
8228}
8229/// Get Market Data for the given conid(s). A pre-flight request must be made prior to ever receiving data. For some fields, it may take more than a few moments to receive information. See response fields for a list of available fields that can be request via fields argument. The endpoint /iserver/accounts must be called prior to /iserver/marketdata/snapshot. For derivative contracts the endpoint /iserver/secdef/search must be called first.
8230#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8231pub struct GetMdSnapshotRequest {
8232    pub query: GetMdSnapshotRequestQuery,
8233}
8234impl GetMdSnapshotRequest {
8235    /// Parse the HTTP response into the response enum.
8236    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetMdSnapshotResponse> {
8237        let status = req.status();
8238        if status == http::StatusCode::OK {
8239            let data = oas3_gen_support::Diagnostics::<IserverSnapshot>::json_with_diagnostics(req)
8240                .await?;
8241            return Ok(GetMdSnapshotResponse::Ok(data));
8242        }
8243        if status == http::StatusCode::BAD_REQUEST {
8244            let _ = req.bytes().await?;
8245            return Ok(GetMdSnapshotResponse::BadRequest);
8246        }
8247        if status == http::StatusCode::UNAUTHORIZED {
8248            let _ = req.bytes().await?;
8249            return Ok(GetMdSnapshotResponse::Unauthorized);
8250        }
8251        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8252            let _ = req.bytes().await?;
8253            return Ok(GetMdSnapshotResponse::InternalServerError);
8254        }
8255        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8256            let _ = req.bytes().await?;
8257            return Ok(GetMdSnapshotResponse::ServiceUnavailable);
8258        }
8259        let _ = req.bytes().await?;
8260        return Ok(GetMdSnapshotResponse::Unknown);
8261    }
8262}
8263#[serde_with::skip_serializing_none]
8264#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
8265pub struct GetMdSnapshotRequestQuery {
8266    /// Contract identifier for the contract of interest. May provide a comma-separated series of contract identifiers.
8267    /// - Example: `265_598i32`
8268    pub conids: i32,
8269    /// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
8270    ///   * `31` - Last Price. The last price at which the contract traded. May contain one of the following prefixes: C - Previous day's closing price. H - Trading has halted.
8271    ///   * `55` - Symbol.
8272    ///   * `58` - Text.
8273    ///   * `70` - High. Current day high price
8274    ///   * `71` - Low. Current day low price
8275    ///   * `73` - Market Value. The current market value of your position in the security. Market Value is calculated with real time market data (even when not subscribed to market data).
8276    ///   * `74` - Avg Price. The average price of the position.
8277    ///   * `75` - Unrealized PnL. Unrealized profit or loss. Unrealized PnL is calculated with real time market data (even when not subscribed to market data).
8278    ///   * `76` - Formatted position.
8279    ///   * `77` - Formatted Unrealized PnL.
8280    ///   * `78` - Daily PnL. Your profit or loss of the day since prior close. Daily PnL is calculated with real time market data (even when not subscribed to market data).
8281    ///   * `79` - Realized PnL. Realized profit or loss. Realized PnL is calculated with real time market data (even when not subscribed to market data).
8282    ///   * `80` - Unrealized PnL %. Unrealized profit or loss expressed in percentage.
8283    ///   * `82` - Change. The difference between the last price and the close on the previous trading day
8284    ///   * `83` - Change %. The difference between the last price and the close on the previous trading day in percentage.
8285    ///   * `84` - Bid Price. The highest-priced bid on the contract.
8286    ///   * `85` - Ask Size. The number of contracts or shares offered at the ask price. For US stocks
8287    ///   * `86` - Ask Price. The lowest-priced offer on the contract.
8288    ///   * `87` - Volume. Volume for the day
8289    ///   * `88` - Bid Size. The number of contracts or shares bid for at the bid price. For US stocks
8290    ///   * `201` - Right. Declares the Right of the Option, Call or Put.
8291    ///   * `6004` - Exchange.
8292    ///   * `6008` - Conid. Contract identifier from IBKR's database.
8293    ///   * `6070` - SecType. The asset class of the instrument.
8294    ///   * `6072` - Months.
8295    ///   * `6073` - Regular Expiry.
8296    ///   * `6119` - Marker for market data delivery method (similar to request id).
8297    ///   * `6457` - Underlying Conid. Use /trsrv/secdef to get more information about the security.
8298    ///   * `6508` - Service Params..
8299    ///   * `6509` - Market Data Availability. The field may contain three chars. First char defines: R = RealTime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed, i - incomplete, v - VDR Exempt (Vendor Display Rule 603c). Second char defines: P = Snapshot, p = Consolidated. Third char defines: B = Book. RealTime Data is relayed back in real time without delay, market data subscription(s) are required. Delayed - Data is relayed back 15-20 min delayed. Frozen - Last recorded data at market close.  relayed back in real time. Frozen Delayed - Last recorded data at market close, relayed back delayed. Not Subscribed - User does not have the required market data subscription(s) to relay back either real time or delayed data. Snapshot - Snapshot request is available for contract. Consolidated - Market data is aggregated across multiple exchanges or venues. Book - Top of the book data is available for contract.
8300    ///   * `7051` - Company name.
8301    ///   * `7057` - Ask Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
8302    ///   * `7058` - Last Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
8303    ///   * `7059` - Last Size. The number of unites traded at the last price
8304    ///   * `7068` - Bid Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
8305    ///   * `7084` - Implied Vol./Hist. Vol %. The ratio of the implied volatility over the historical volatility, expressed as a percentage.
8306    ///   * `7085` - Put/Call Interest. Put option open interest/call option open interest for the trading day.
8307    ///   * `7086` - Put/Call Volume. Put option volume/call option volume for the trading day.
8308    ///   * `7087` - Hist. Vol. %. 30-day real-time historical volatility.
8309    ///   * `7088` - Hist. Vol. Close %. Shows the historical volatility based on previous close price.
8310    ///   * `7089` - Opt. Volume. Option Volume
8311    ///   * `7094` - Conid + Exchange.
8312    ///   * `7184` - canBeTraded. If contract is a trade-able instrument. Returns 1(true) or 0(false).
8313    ///   * `7219` - Contract Description.
8314    ///   * `7220` - Contract Description.
8315    ///   * `7221` - Listing Exchange.
8316    ///   * `7280` - Industry. Displays the type of industry under which the underlying company can be categorized.
8317    ///   * `7281` - Category. Displays a more detailed level of description within the industry under which the underlying company can be categorized.
8318    ///   * `7282` - Average Volume. The average daily trading volume over 90 days.
8319    ///   * `7283` - Option Implied Vol. %. A prediction of how volatile an underlying will be in the future.At the market volatility estimated for a maturity thirty calendar days forward of the current trading day, and based on option prices from two consecutive expiration months. To query the Implied Vol. % of a specific strike refer to field 7633.
8320    ///   * `7284` - Historical volatility %. Deprecated
8321    ///   * `7285` - Put/Call Ratio.
8322    ///   * `7292` - Cost Basis. Your current position in this security multiplied by the average price and multiplier.
8323    ///   * `7293` - 52 Week High. The highest price for the past 52 weeks.
8324    ///   * `7294` - 52 Week Low. The lowest price for the past 52 weeks.
8325    ///   * `7295` - Open. Today's opening price.
8326    ///   * `7296` - Close. Today's closing price.
8327    ///   * `7308` - Delta. The ratio of the change in the price of the option to the corresponding change in the price of the underlying.
8328    ///   * `7309` - Gamma. The rate of change for the delta with respect to the underlying asset's price.
8329    ///   * `7310` - Theta. A measure of the rate of decline the value of an option due to the passage of time.
8330    ///   * `7311` - Vega. The amount that the price of an option changes compared to a 1% change in the volatility.
8331    ///   * `7607` - Opt. Volume Change %. Today's option volume as a percentage of the average option volume.
8332    ///   * `7633` - Implied Vol. %. The implied volatility for the specific strike of the option in percentage. To query the Option Implied Vol. % from the underlying refer to field 7283.
8333    ///   * `7635` - Mark. The mark price is
8334    ///   * `7636` - Shortable Shares. Number of shares available for shorting.
8335    ///   * `7637` - Fee Rate. Interest rate charged on borrowed shares.
8336    ///   * `7638` - Option Open Interest.
8337    ///   * `7639` - % of Mark Value. Displays the market value of the contract as a percentage of the total market value of the account. Mark Value is calculated with real time market data (even when not subscribed to market data).
8338    ///   * `7644` - Shortable. Describes the level of difficulty with which the security can be sold short.
8339    ///   * `7671` - Dividends. This value is the total of the expected dividend payments over the next twelve months per share.
8340    ///   * `7672` - Dividends TTM. This value is the total of the expected dividend payments over the last twelve months per share.
8341    ///   * `7674` - EMA(200). Exponential moving average (N=200).
8342    ///   * `7675` - EMA(100). Exponential moving average (N=100).
8343    ///   * `7676` - EMA(50). Exponential moving average (N=50).
8344    ///   * `7677` - EMA(20). Exponential moving average (N=20).
8345    ///   * `7678` - Price/EMA(200). Price to Exponential moving average (N=200) ratio -1
8346    ///   * `7679` - Price/EMA(100). Price to Exponential moving average (N=100) ratio -1
8347    ///   * `7724` - Price/EMA(50). Price to Exponential moving average (N=50) ratio -1
8348    ///   * `7681` - Price/EMA(20). Price to Exponential moving average (N=20) ratio -1
8349    ///   * `7682` - Change Since Open. The difference between the last price and the open price.
8350    ///   * `7683` - Upcoming Event. Shows the next major company event. Requires Wall Street Horizon subscription.
8351    ///   * `7684` - Upcoming Event Date. The date of the next major company event. Requires Wall Street Horizon subscription.
8352    ///   * `7685` - Upcoming Analyst Meeting. The date and time of the next scheduled analyst meeting. Requires Wall Street Horizon subscription.
8353    ///   * `7686` - Upcoming Earnings. The date and time of the next scheduled earnings/earnings call event. Requires Wall Street Horizon subscription.
8354    ///   * `7687` - Upcoming Misc Event. The date and time of the next shareholder meeting
8355    ///   * `7688` - Recent Analyst Meeting. The date and time of the most recent analyst meeting. Requires Wall Street Horizon subscription.
8356    ///   * `7689` - Recent Earnings. The date and time of the most recent earnings/earning call event. Requires Wall Street Horizon subscription.
8357    ///   * `7690` - Recent Misc Event. The date and time of the most recent shareholder meeting
8358    ///   * `7694` - Probability of Max Return. Customer implied probability of maximum potential gain.
8359    ///   * `7695` - Break Even. Break even points
8360    ///   * `7696` - SPX Delta. Beta Weighted Delta is calculated using the formula; Delta x dollar adjusted beta
8361    ///   * `7697` - Futures Open Interest. Total number of outstanding futures contracts
8362    ///   * `7698` - Last Yield. Implied yield of the bond if it is purchased at the current last price. Last yield is calculated using the Last price on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
8363    ///   * `7699` - Bid Yield. Implied yield of the bond if it is purchased at the current bid price. Bid yield is calculated using the Ask on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
8364    ///   * `7700` - Probability of Max Return. Customer implied probability of maximum potential gain.
8365    ///   * `7702` - Probability of Max Loss. Customer implied probability of maximum potential loss.
8366    ///   * `7703` - Profit Probability. Customer implied probability of any gain.
8367    ///   * `7704` - Organization Type.
8368    ///   * `7705` - Debt Class.
8369    ///   * `7706` - Ratings. Ratings issued for bond contract.
8370    ///   * `7707` - Bond State Code.
8371    ///   * `7708` - Bond Type.
8372    ///   * `7714` - Last Trading Date.
8373    ///   * `7715` - Issue Date.
8374    ///   * `7720` - Ask Yield. Implied yield of the bond if it is purchased at the current offer. Ask yield is calculated using the Bid on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
8375    ///   * `7741` - Prior Close. Yesterday's closing price
8376    ///   * `7762` - Volume Long. High precision volume for the day. For formatted volume refer to field 87.
8377    ///   * `7768` - hasTradingPermissions. if user has trading permissions for specified contract. Returns 1(true) or 0(false).
8378    ///   * `7899` - Stock Type. Determines the stock type. Includes: Common, CORP, ADR, ETF, ETN, EFN, REIT, CEF, ETMF.
8379    ///   * `7920` - Daily PnL Raw. Your profit or loss of the day since prior close. Daily PnL is calculated with real-time market data (even when not subscribed to market data).
8380    ///   * `7921` - Cost Basis Raw. Your current position in this security multiplied by the average price and and multiplier.
8381    ///   * `7943` - Rebate Rate. Fed funds or other currency-relevant Benchmark rate minus the interest rate charged on borrowed shares.
8382    pub fields: Option<MdFields>,
8383}
8384/// Response types for getMdSnapshot
8385#[derive(Debug, Clone)]
8386pub enum GetMdSnapshotResponse {
8387    ///200: Successfully requested market data
8388    Ok(IserverSnapshot),
8389    ///400: Invalid input format or missing required fields
8390    BadRequest,
8391    ///401: Invalid or expired access token
8392    Unauthorized,
8393    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8394     */
8395    InternalServerError,
8396    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8397     */
8398    ServiceUnavailable,
8399    ///default: Unknown response
8400    Unknown,
8401}
8402/// Get the preset behavior for model rebalancing.
8403#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8404pub struct GetModelPresetsRequest {
8405    pub body: ReqIDRequestBody,
8406}
8407impl GetModelPresetsRequest {
8408    /// Parse the HTTP response into the response enum.
8409    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetModelPresetsResponse> {
8410        let status = req.status();
8411        if status == http::StatusCode::OK {
8412            let data =
8413                oas3_gen_support::Diagnostics::<ModelPresetsResponse>::json_with_diagnostics(req)
8414                    .await?;
8415            return Ok(GetModelPresetsResponse::Ok(data));
8416        }
8417        if status == http::StatusCode::UNAUTHORIZED {
8418            let _ = req.bytes().await?;
8419            return Ok(GetModelPresetsResponse::Unauthorized);
8420        }
8421        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8422            let _ = req.bytes().await?;
8423            return Ok(GetModelPresetsResponse::InternalServerError);
8424        }
8425        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8426            let _ = req.bytes().await?;
8427            return Ok(GetModelPresetsResponse::ServiceUnavailable);
8428        }
8429        let _ = req.bytes().await?;
8430        return Ok(GetModelPresetsResponse::Unknown);
8431    }
8432}
8433/// Response types for getModelPresets
8434#[derive(Debug, Clone)]
8435pub enum GetModelPresetsResponse {
8436    ///200: Successfully retrieve preset details
8437    Ok(ModelPresetsResponse),
8438    ///401: Invalid or expired access token
8439    Unauthorized,
8440    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8441     */
8442    InternalServerError,
8443    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8444     */
8445    ServiceUnavailable,
8446    ///default: Unknown response
8447    Unknown,
8448}
8449/// Request a summary for a single model.
8450#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8451pub struct GetModelSummarySingleRequest {
8452    pub body: SummaryRequestBody,
8453}
8454impl GetModelSummarySingleRequest {
8455    /// Parse the HTTP response into the response enum.
8456    pub async fn parse_response(
8457        req: reqwest::Response,
8458    ) -> anyhow::Result<GetModelSummarySingleResponse> {
8459        let status = req.status();
8460        if status == http::StatusCode::OK {
8461            let data =
8462                oas3_gen_support::Diagnostics::<ModelSummaryResponse>::json_with_diagnostics(req)
8463                    .await?;
8464            return Ok(GetModelSummarySingleResponse::Ok(data));
8465        }
8466        if status == http::StatusCode::UNAUTHORIZED {
8467            let _ = req.bytes().await?;
8468            return Ok(GetModelSummarySingleResponse::Unauthorized);
8469        }
8470        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8471            let _ = req.bytes().await?;
8472            return Ok(GetModelSummarySingleResponse::InternalServerError);
8473        }
8474        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8475            let _ = req.bytes().await?;
8476            return Ok(GetModelSummarySingleResponse::ServiceUnavailable);
8477        }
8478        let _ = req.bytes().await?;
8479        return Ok(GetModelSummarySingleResponse::Unknown);
8480    }
8481}
8482/// Response types for getModelSummarySingle
8483#[derive(Debug, Clone)]
8484pub enum GetModelSummarySingleResponse {
8485    ///200: Successfully retrieve model summary.
8486    Ok(ModelSummaryResponse),
8487    ///401: Invalid or expired access token
8488    Unauthorized,
8489    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8490     */
8491    InternalServerError,
8492    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8493     */
8494    ServiceUnavailable,
8495    ///default: Unknown response
8496    Unknown,
8497}
8498/// Retrieve information about your MTA alert. Each login user only has one mobile trading assistant (MTA) alert with it's own unique tool id that cannot be changed. MTA alerts can not be created or deleted, only modified. When modified a new order Id is generated.
8499#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8500pub struct GetMtaDetailsRequest {}
8501impl GetMtaDetailsRequest {
8502    /// Parse the HTTP response into the response enum.
8503    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetMtaDetailsResponse> {
8504        let status = req.status();
8505        if status == http::StatusCode::OK {
8506            let data =
8507                oas3_gen_support::Diagnostics::<AlertDetails>::json_with_diagnostics(req).await?;
8508            return Ok(GetMtaDetailsResponse::Ok(data));
8509        }
8510        let _ = req.bytes().await?;
8511        return Ok(GetMtaDetailsResponse::Unknown);
8512    }
8513}
8514/// Response types for getMtaDetails
8515#[derive(Debug, Clone)]
8516pub enum GetMtaDetailsResponse {
8517    ///200: The alert description for the unique MTA alert on the account.
8518    Ok(AlertDetails),
8519    ///default: Unknown response
8520    Unknown,
8521}
8522/// Returns open orders and filled or cancelled orders submitted during the current brokerage session.
8523#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8524pub struct GetOpenOrdersRequest {
8525    pub query: GetOpenOrdersRequestQuery,
8526}
8527impl GetOpenOrdersRequest {
8528    /// Parse the HTTP response into the response enum.
8529    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetOpenOrdersResponse> {
8530        let status = req.status();
8531        if status == http::StatusCode::OK {
8532            let data =
8533                oas3_gen_support::Diagnostics::<LiveOrdersResponse>::json_with_diagnostics(req)
8534                    .await?;
8535            return Ok(GetOpenOrdersResponse::Ok(data));
8536        }
8537        if status == http::StatusCode::UNAUTHORIZED {
8538            let _ = req.bytes().await?;
8539            return Ok(GetOpenOrdersResponse::Unauthorized);
8540        }
8541        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8542            let _ = req.bytes().await?;
8543            return Ok(GetOpenOrdersResponse::InternalServerError);
8544        }
8545        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8546            let _ = req.bytes().await?;
8547            return Ok(GetOpenOrdersResponse::ServiceUnavailable);
8548        }
8549        let _ = req.bytes().await?;
8550        return Ok(GetOpenOrdersResponse::Unknown);
8551    }
8552}
8553#[serde_with::skip_serializing_none]
8554#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
8555pub struct GetOpenOrdersRequestQuery {
8556    /// Filter results using a comma-separated list of Order Status values. Also accepts a value to sort results by time.
8557    /// - Example: `Some("filled")`
8558    pub filters: Option<GetOpenOrdersRequestQueryFilters>,
8559    /// Instructs IB to clear cache of orders and obtain updated view from brokerage backend. Response will be an empty array.
8560    pub force: Option<bool>,
8561}
8562#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
8563pub enum GetOpenOrdersRequestQueryFilters {
8564    #[serde(rename = "inactive")]
8565    #[default]
8566    Inactive,
8567    #[serde(rename = "pending_submit")]
8568    PendingSubmit,
8569    #[serde(rename = "pre_submitted")]
8570    PreSubmitted,
8571    #[serde(rename = "submitted")]
8572    Submitted,
8573    #[serde(rename = "filled")]
8574    Filled,
8575    #[serde(rename = "pending_cancel")]
8576    PendingCancel,
8577    #[serde(rename = "cancelled")]
8578    Cancelled,
8579    #[serde(rename = "warn_state")]
8580    WarnState,
8581    #[serde(rename = "sort_by_time")]
8582    SortByTime,
8583}
8584impl core::fmt::Display for GetOpenOrdersRequestQueryFilters {
8585    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8586        match self {
8587            Self::Inactive => write!(f, "inactive"),
8588            Self::PendingSubmit => write!(f, "pending_submit"),
8589            Self::PreSubmitted => write!(f, "pre_submitted"),
8590            Self::Submitted => write!(f, "submitted"),
8591            Self::Filled => write!(f, "filled"),
8592            Self::PendingCancel => write!(f, "pending_cancel"),
8593            Self::Cancelled => write!(f, "cancelled"),
8594            Self::WarnState => write!(f, "warn_state"),
8595            Self::SortByTime => write!(f, "sort_by_time"),
8596        }
8597    }
8598}
8599/// Response types for getOpenOrders
8600#[derive(Debug, Clone)]
8601pub enum GetOpenOrdersResponse {
8602    ///200: Orders for a specific account
8603    Ok(LiveOrdersResponse),
8604    ///401: Invalid or expired access token
8605    Unauthorized,
8606    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8607     */
8608    InternalServerError,
8609    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8610     */
8611    ServiceUnavailable,
8612    ///default: Unknown response
8613    Unknown,
8614}
8615/// Retrieve the status of a single order. Only displays orders from the current brokerage session. If orders executed on a previous day or session, queries will 503 error.
8616#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8617pub struct GetOrderStatusRequest {
8618    pub path: GetOrderStatusRequestPath,
8619}
8620impl GetOrderStatusRequest {
8621    /// Parse the HTTP response into the response enum.
8622    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetOrderStatusResponse> {
8623        let status = req.status();
8624        if status == http::StatusCode::OK {
8625            let _ = req.bytes().await?;
8626            return Ok(GetOrderStatusResponse::Ok);
8627        }
8628        if status == http::StatusCode::BAD_REQUEST {
8629            let _ = req.bytes().await?;
8630            return Ok(GetOrderStatusResponse::BadRequest);
8631        }
8632        if status == http::StatusCode::UNAUTHORIZED {
8633            let _ = req.bytes().await?;
8634            return Ok(GetOrderStatusResponse::Unauthorized);
8635        }
8636        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8637            let _ = req.bytes().await?;
8638            return Ok(GetOrderStatusResponse::InternalServerError);
8639        }
8640        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8641            let _ = req.bytes().await?;
8642            return Ok(GetOrderStatusResponse::ServiceUnavailable);
8643        }
8644        let _ = req.bytes().await?;
8645        return Ok(GetOrderStatusResponse::Unknown);
8646    }
8647}
8648#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
8649pub struct GetOrderStatusRequestPath {
8650    /// The IB-assigned order ID of the desired order ticket.
8651    /// - Example: `1_799_796_559i32`
8652    pub order_id: i32,
8653}
8654/// Response types for getOrderStatus
8655#[derive(Debug, Clone)]
8656pub enum GetOrderStatusResponse {
8657    ///200: order status
8658    Ok,
8659    ///400: Invalid input format or missing required fields
8660    BadRequest,
8661    ///401: Invalid or expired access token
8662    Unauthorized,
8663    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8664     */
8665    InternalServerError,
8666    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8667     */
8668    ServiceUnavailable,
8669    ///default: Unknown response
8670    Unknown,
8671}
8672/// Get all positions in an account.
8673#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8674pub struct GetPaginatedPositionsRequest {
8675    #[validate(nested)]
8676    pub path: GetPaginatedPositionsRequestPath,
8677    pub query: GetPaginatedPositionsRequestQuery,
8678}
8679impl GetPaginatedPositionsRequest {
8680    /// Parse the HTTP response into the response enum.
8681    pub async fn parse_response(
8682        req: reqwest::Response,
8683    ) -> anyhow::Result<GetPaginatedPositionsResponse> {
8684        let status = req.status();
8685        if status == http::StatusCode::OK {
8686            let data =
8687                oas3_gen_support::Diagnostics::<Position200Response2>::json_with_diagnostics(req)
8688                    .await?;
8689            return Ok(GetPaginatedPositionsResponse::Ok(data));
8690        }
8691        if status == http::StatusCode::BAD_REQUEST {
8692            let _ = req.bytes().await?;
8693            return Ok(GetPaginatedPositionsResponse::BadRequest);
8694        }
8695        if status == http::StatusCode::UNAUTHORIZED {
8696            let _ = req.bytes().await?;
8697            return Ok(GetPaginatedPositionsResponse::Unauthorized);
8698        }
8699        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8700            let _ = req.bytes().await?;
8701            return Ok(GetPaginatedPositionsResponse::InternalServerError);
8702        }
8703        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8704            let _ = req.bytes().await?;
8705            return Ok(GetPaginatedPositionsResponse::ServiceUnavailable);
8706        }
8707        let _ = req.bytes().await?;
8708        return Ok(GetPaginatedPositionsResponse::Unknown);
8709    }
8710}
8711#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
8712pub struct GetPaginatedPositionsRequestPath {
8713    /// Account ID whose positions are requested.
8714    /// - Example: `"DU123456".to_string()`
8715    #[validate(length(min = 1u64))]
8716    pub account_id: String,
8717    /// Paginates positions response. Indexed from 0. Max 100 positions returned per page. Defaulted to 0.
8718    /// - Example: `1i32`
8719    pub page_id: i32,
8720}
8721#[serde_with::skip_serializing_none]
8722#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
8723pub struct GetPaginatedPositionsRequestQuery {
8724    /// Name of model
8725    pub model: Option<serde_json::Value>,
8726    /// sorting of result positions by specified field. Defaulted to "name" field.
8727    /// - Example: `Some("name")`
8728    pub sort: Option<serde_json::Value>,
8729    /// Sorting direction. Possible values "a" - ascending, "d" - descending. Defaulted to "a"
8730    /// - Example: `Some("a")`
8731    pub direction: Option<serde_json::Value>,
8732    /// Forcing to wait for all security definition to be received. If false, position may not have secDef portion
8733    #[serde(rename = "waitForSecDef")]
8734    pub wait_for_sec_def: Option<bool>,
8735}
8736/// Response types for getPaginatedPositions
8737#[derive(Debug, Clone)]
8738pub enum GetPaginatedPositionsResponse {
8739    ///200: positions
8740    Ok(Position200Response2),
8741    ///400: Invalid input format or missing required fields
8742    BadRequest,
8743    ///401: Invalid or expired access token
8744    Unauthorized,
8745    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8746     */
8747    InternalServerError,
8748    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8749     */
8750    ServiceUnavailable,
8751    ///default: Unknown response
8752    Unknown,
8753}
8754#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
8755pub struct GetParticipatingListResponse {
8756    #[serde(rename = "participatingBanks")]
8757    pub participating_banks: Vec<GetParticipatingListResponseParticipatingBank>,
8758    /// - Example: `"eDDA".to_string()`
8759    #[serde(rename = "type")]
8760    pub r#type: String,
8761}
8762#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
8763pub struct GetParticipatingListResponseParticipatingBank {
8764    /// - Example: `"WEDIHKHHXXX".to_string()`
8765    #[serde(rename = "BIC")]
8766    pub bic: String,
8767    /// - Example: `"390".to_string()`
8768    #[serde(rename = "clearingCode")]
8769    pub clearing_code: String,
8770    /// - Example: `"WELAB BANK LIMITED".to_string()`
8771    #[serde(rename = "institutionName")]
8772    pub institution_name: String,
8773}
8774/// Returns the performance (MTM) for the given accounts, if more than one account is passed, the result is consolidated.
8775#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8776pub struct GetPerformanceAllPeriodsRequest {
8777    pub query: GetPerformanceAllPeriodsRequestQuery,
8778    pub body: AcctIdRequestBody3,
8779}
8780impl GetPerformanceAllPeriodsRequest {
8781    /// Parse the HTTP response into the response enum.
8782    pub async fn parse_response(
8783        req: reqwest::Response,
8784    ) -> anyhow::Result<GetPerformanceAllPeriodsResponse> {
8785        let status = req.status();
8786        if status == http::StatusCode::OK {
8787            let data = oas3_gen_support::Diagnostics::<
8788                DetailedContractInformation,
8789            >::json_with_diagnostics(req)
8790                .await?;
8791            return Ok(GetPerformanceAllPeriodsResponse::Ok(data));
8792        }
8793        if status == http::StatusCode::BAD_REQUEST {
8794            let _ = req.bytes().await?;
8795            return Ok(GetPerformanceAllPeriodsResponse::BadRequest);
8796        }
8797        if status == http::StatusCode::UNAUTHORIZED {
8798            let _ = req.bytes().await?;
8799            return Ok(GetPerformanceAllPeriodsResponse::Unauthorized);
8800        }
8801        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8802            let _ = req.bytes().await?;
8803            return Ok(GetPerformanceAllPeriodsResponse::InternalServerError);
8804        }
8805        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8806            let _ = req.bytes().await?;
8807            return Ok(GetPerformanceAllPeriodsResponse::ServiceUnavailable);
8808        }
8809        let _ = req.bytes().await?;
8810        return Ok(GetPerformanceAllPeriodsResponse::Unknown);
8811    }
8812}
8813#[serde_with::skip_serializing_none]
8814#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
8815pub struct GetPerformanceAllPeriodsRequestQuery {
8816    /// only one account. If defined, accounts passed in request body ignored
8817    pub param: Option<String>,
8818}
8819/// Response types for getPerformanceAllPeriods
8820#[derive(Debug, Clone)]
8821pub enum GetPerformanceAllPeriodsResponse {
8822    ///200: An array of objects detailing contract information.
8823    Ok(DetailedContractInformation),
8824    ///400: Invalid input format or missing required fields
8825    BadRequest,
8826    ///401: Invalid or expired access token
8827    Unauthorized,
8828    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8829     */
8830    InternalServerError,
8831    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8832     */
8833    ServiceUnavailable,
8834    ///default: Unknown response
8835    Unknown,
8836}
8837/// Returns updated profit and loss values for the selected account. Initial request will return an empty array in the upnl object.
8838#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8839pub struct GetPnlRequest {}
8840impl GetPnlRequest {
8841    /// Parse the HTTP response into the response enum.
8842    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetPnlResponse> {
8843        let status = req.status();
8844        if status == http::StatusCode::OK {
8845            let data =
8846                oas3_gen_support::Diagnostics::<PnlPartitionedResponse>::json_with_diagnostics(req)
8847                    .await?;
8848            return Ok(GetPnlResponse::Ok(data));
8849        }
8850        if status == http::StatusCode::BAD_REQUEST {
8851            let _ = req.bytes().await?;
8852            return Ok(GetPnlResponse::BadRequest);
8853        }
8854        if status == http::StatusCode::UNAUTHORIZED {
8855            let _ = req.bytes().await?;
8856            return Ok(GetPnlResponse::Unauthorized);
8857        }
8858        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8859            let _ = req.bytes().await?;
8860            return Ok(GetPnlResponse::ServiceUnavailable);
8861        }
8862        let _ = req.bytes().await?;
8863        return Ok(GetPnlResponse::Unknown);
8864    }
8865}
8866/// Response types for getPnl
8867#[derive(Debug, Clone)]
8868pub enum GetPnlResponse {
8869    ///200: Refers to "updated PnL". Holds a json object of key-value paired pnl details.
8870    Ok(PnlPartitionedResponse),
8871    ///400: bad request; passed input cannot pass initial validation and detected right away
8872    BadRequest,
8873    ///401: Invalid or expired access token
8874    Unauthorized,
8875    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8876     */
8877    ServiceUnavailable,
8878    ///default: Unknown response
8879    Unknown,
8880}
8881/// Get the given account's ledger data detailing its balances by currency.
8882#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8883pub struct GetPortfolioLedgerRequest {
8884    #[validate(nested)]
8885    pub path: GetPortfolioLedgerRequestPath,
8886}
8887impl GetPortfolioLedgerRequest {
8888    /// Parse the HTTP response into the response enum.
8889    pub async fn parse_response(
8890        req: reqwest::Response,
8891    ) -> anyhow::Result<GetPortfolioLedgerResponse> {
8892        let status = req.status();
8893        if status == http::StatusCode::OK {
8894            let data = oas3_gen_support::Diagnostics::<Ledger>::json_with_diagnostics(req).await?;
8895            return Ok(GetPortfolioLedgerResponse::Ok(data));
8896        }
8897        if status == http::StatusCode::UNAUTHORIZED {
8898            let _ = req.bytes().await?;
8899            return Ok(GetPortfolioLedgerResponse::Unauthorized);
8900        }
8901        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8902            let _ = req.bytes().await?;
8903            return Ok(GetPortfolioLedgerResponse::InternalServerError);
8904        }
8905        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8906            let _ = req.bytes().await?;
8907            return Ok(GetPortfolioLedgerResponse::ServiceUnavailable);
8908        }
8909        let _ = req.bytes().await?;
8910        return Ok(GetPortfolioLedgerResponse::Unknown);
8911    }
8912}
8913#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
8914pub struct GetPortfolioLedgerRequestPath {
8915    /// Account ID whose ledger data is requested.
8916    /// - Example: `"DU123456".to_string()`
8917    #[validate(length(min = 1u64))]
8918    pub account_id: String,
8919}
8920/// Response types for getPortfolioLedger
8921#[derive(Debug, Clone)]
8922pub enum GetPortfolioLedgerResponse {
8923    ///200: ledger
8924    Ok(Ledger),
8925    ///401: Invalid or expired access token
8926    Unauthorized,
8927    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8928     */
8929    InternalServerError,
8930    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8931     */
8932    ServiceUnavailable,
8933    ///default: Unknown response
8934    Unknown,
8935}
8936/// Get a single account's attributes and capabilities.
8937#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8938pub struct GetPortfolioMetadataRequest {
8939    #[validate(nested)]
8940    pub path: GetPortfolioMetadataRequestPath,
8941}
8942impl GetPortfolioMetadataRequest {
8943    /// Parse the HTTP response into the response enum.
8944    pub async fn parse_response(
8945        req: reqwest::Response,
8946    ) -> anyhow::Result<GetPortfolioMetadataResponse> {
8947        let status = req.status();
8948        if status == http::StatusCode::OK {
8949            let data =
8950                oas3_gen_support::Diagnostics::<AccountAttributes>::json_with_diagnostics(req)
8951                    .await?;
8952            return Ok(GetPortfolioMetadataResponse::Ok(data));
8953        }
8954        if status == http::StatusCode::UNAUTHORIZED {
8955            let _ = req.bytes().await?;
8956            return Ok(GetPortfolioMetadataResponse::Unauthorized);
8957        }
8958        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
8959            let _ = req.bytes().await?;
8960            return Ok(GetPortfolioMetadataResponse::InternalServerError);
8961        }
8962        if status == http::StatusCode::SERVICE_UNAVAILABLE {
8963            let _ = req.bytes().await?;
8964            return Ok(GetPortfolioMetadataResponse::ServiceUnavailable);
8965        }
8966        let _ = req.bytes().await?;
8967        return Ok(GetPortfolioMetadataResponse::Unknown);
8968    }
8969}
8970#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
8971pub struct GetPortfolioMetadataRequestPath {
8972    /// Account ID whose attributes are requested.
8973    /// - Example: `"DU123456".to_string()`
8974    #[validate(length(min = 1u64))]
8975    pub account_id: String,
8976}
8977/// Response types for getPortfolioMetadata
8978#[derive(Debug, Clone)]
8979pub enum GetPortfolioMetadataResponse {
8980    ///200: An account's attributes
8981    Ok(AccountAttributes),
8982    ///401: Invalid or expired access token
8983    Unauthorized,
8984    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
8985     */
8986    InternalServerError,
8987    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
8988     */
8989    ServiceUnavailable,
8990    ///default: Unknown response
8991    Unknown,
8992}
8993/// Returns detailed summary of account values, by segment where appropriate.
8994#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
8995pub struct GetPortfolioSummaryRequest {
8996    #[validate(nested)]
8997    pub path: GetPortfolioSummaryRequestPath,
8998}
8999impl GetPortfolioSummaryRequest {
9000    /// Parse the HTTP response into the response enum.
9001    pub async fn parse_response(
9002        req: reqwest::Response,
9003    ) -> anyhow::Result<GetPortfolioSummaryResponse> {
9004        let status = req.status();
9005        if status == http::StatusCode::OK {
9006            let data =
9007                oas3_gen_support::Diagnostics::<PortfolioSummary>::json_with_diagnostics(req)
9008                    .await?;
9009            return Ok(GetPortfolioSummaryResponse::Ok(data));
9010        }
9011        if status == http::StatusCode::UNAUTHORIZED {
9012            let _ = req.bytes().await?;
9013            return Ok(GetPortfolioSummaryResponse::Unauthorized);
9014        }
9015        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9016            let _ = req.bytes().await?;
9017            return Ok(GetPortfolioSummaryResponse::InternalServerError);
9018        }
9019        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9020            let _ = req.bytes().await?;
9021            return Ok(GetPortfolioSummaryResponse::ServiceUnavailable);
9022        }
9023        let _ = req.bytes().await?;
9024        return Ok(GetPortfolioSummaryResponse::Unknown);
9025    }
9026}
9027#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
9028pub struct GetPortfolioSummaryRequestPath {
9029    /// accountId
9030    /// - Example: `"DU123456".to_string()`
9031    #[validate(length(min = 1u64))]
9032    pub account_id: String,
9033}
9034/// Response types for getPortfolioSummary
9035#[derive(Debug, Clone)]
9036pub enum GetPortfolioSummaryResponse {
9037    ///200: response with summary definitions
9038    Ok(PortfolioSummary),
9039    ///401: Invalid or expired access token
9040    Unauthorized,
9041    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9042     */
9043    InternalServerError,
9044    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9045     */
9046    ServiceUnavailable,
9047    ///default: Unknown response
9048    Unknown,
9049}
9050/// Get position for a given instrument in a single account.
9051#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9052pub struct GetPositionByConidRequest {
9053    #[validate(nested)]
9054    pub path: GetPositionByConidRequestPath,
9055}
9056impl GetPositionByConidRequest {
9057    /// Parse the HTTP response into the response enum.
9058    pub async fn parse_response(
9059        req: reqwest::Response,
9060    ) -> anyhow::Result<GetPositionByConidResponse> {
9061        let status = req.status();
9062        if status == http::StatusCode::OK {
9063            let data =
9064                oas3_gen_support::Diagnostics::<IndividualPositionArray>::json_with_diagnostics(
9065                    req,
9066                )
9067                .await?;
9068            return Ok(GetPositionByConidResponse::Ok(data));
9069        }
9070        if status == http::StatusCode::BAD_REQUEST {
9071            let _ = req.bytes().await?;
9072            return Ok(GetPositionByConidResponse::BadRequest);
9073        }
9074        if status == http::StatusCode::UNAUTHORIZED {
9075            let _ = req.bytes().await?;
9076            return Ok(GetPositionByConidResponse::Unauthorized);
9077        }
9078        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9079            let _ = req.bytes().await?;
9080            return Ok(GetPositionByConidResponse::InternalServerError);
9081        }
9082        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9083            let _ = req.bytes().await?;
9084            return Ok(GetPositionByConidResponse::ServiceUnavailable);
9085        }
9086        let _ = req.bytes().await?;
9087        return Ok(GetPositionByConidResponse::Unknown);
9088    }
9089}
9090#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
9091pub struct GetPositionByConidRequestPath {
9092    /// Account ID whose position in the given instrument is requested.
9093    /// - Example: `"DU123456".to_string()`
9094    #[validate(length(min = 1u64))]
9095    pub accountid: String,
9096    /// Conid of the instrument whose position in the account is requested.
9097    /// - Example: `265_598i32`
9098    pub conid: i32,
9099}
9100/// Response types for getPositionByConid
9101#[derive(Debug, Clone)]
9102pub enum GetPositionByConidResponse {
9103    ///200: Position details by conid
9104    Ok(IndividualPositionArray),
9105    ///400: Invalid input format or missing required fields
9106    BadRequest,
9107    ///401: Invalid or expired access token
9108    Unauthorized,
9109    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9110     */
9111    InternalServerError,
9112    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9113     */
9114    ServiceUnavailable,
9115    ///default: Unknown response
9116    Unknown,
9117}
9118/// Returns an xml file containing all available parameters to be sent for the Iserver scanner request.
9119#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9120pub struct GetScannerParametersRequest {}
9121impl GetScannerParametersRequest {
9122    /// Parse the HTTP response into the response enum.
9123    pub async fn parse_response(
9124        req: reqwest::Response,
9125    ) -> anyhow::Result<GetScannerParametersResponse> {
9126        let status = req.status();
9127        if status == http::StatusCode::OK {
9128            let data =
9129                oas3_gen_support::Diagnostics::<IserverScannerParams>::json_with_diagnostics(req)
9130                    .await?;
9131            return Ok(GetScannerParametersResponse::Ok(data));
9132        }
9133        if status == http::StatusCode::UNAUTHORIZED {
9134            let _ = req.bytes().await?;
9135            return Ok(GetScannerParametersResponse::Unauthorized);
9136        }
9137        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9138            let _ = req.bytes().await?;
9139            return Ok(GetScannerParametersResponse::InternalServerError);
9140        }
9141        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9142            let _ = req.bytes().await?;
9143            return Ok(GetScannerParametersResponse::ServiceUnavailable);
9144        }
9145        let _ = req.bytes().await?;
9146        return Ok(GetScannerParametersResponse::Unknown);
9147    }
9148}
9149/// Response types for getScannerParameters
9150#[derive(Debug, Clone)]
9151pub enum GetScannerParametersResponse {
9152    ///200: An array of objects detailing contract information.
9153    Ok(IserverScannerParams),
9154    ///401: Invalid or expired access token
9155    Unauthorized,
9156    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9157     */
9158    InternalServerError,
9159    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9160     */
9161    ServiceUnavailable,
9162    ///default: Unknown response
9163    Unknown,
9164}
9165/// Searches for contracts according to the filters specified in /iserver/scanner/params endpoint.
9166#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9167pub struct GetScannerResultsRequest {
9168    pub body: IserverScannerRunRequest,
9169}
9170impl GetScannerResultsRequest {
9171    /// Parse the HTTP response into the response enum.
9172    pub async fn parse_response(
9173        req: reqwest::Response,
9174    ) -> anyhow::Result<GetScannerResultsResponse> {
9175        let status = req.status();
9176        if status == http::StatusCode::OK {
9177            let data =
9178                oas3_gen_support::Diagnostics::<IserverScannerRunResponse>::json_with_diagnostics(
9179                    req,
9180                )
9181                .await?;
9182            return Ok(GetScannerResultsResponse::Ok(data));
9183        }
9184        if status == http::StatusCode::BAD_REQUEST {
9185            let _ = req.bytes().await?;
9186            return Ok(GetScannerResultsResponse::BadRequest);
9187        }
9188        if status == http::StatusCode::UNAUTHORIZED {
9189            let _ = req.bytes().await?;
9190            return Ok(GetScannerResultsResponse::Unauthorized);
9191        }
9192        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9193            let _ = req.bytes().await?;
9194            return Ok(GetScannerResultsResponse::InternalServerError);
9195        }
9196        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9197            let _ = req.bytes().await?;
9198            return Ok(GetScannerResultsResponse::ServiceUnavailable);
9199        }
9200        let _ = req.bytes().await?;
9201        return Ok(GetScannerResultsResponse::Unknown);
9202    }
9203}
9204/// Response types for getScannerResults
9205#[derive(Debug, Clone)]
9206pub enum GetScannerResultsResponse {
9207    ///200: An array of objects detailing contract information.
9208    Ok(IserverScannerRunResponse),
9209    ///400: Invalid input format or missing required fields
9210    BadRequest,
9211    ///401: Invalid or expired access token
9212    Unauthorized,
9213    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9214     */
9215    InternalServerError,
9216    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9217     */
9218    ServiceUnavailable,
9219    ///default: Unknown response
9220    Unknown,
9221}
9222/// If the gateway has not received any requests for several minutes an open session will automatically timeout. The tickle endpoint pings the server to prevent the session from ending. It is expected to call this endpoint approximately every 60 seconds to maintain the connection to the brokerage session.
9223#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9224pub struct GetSessionTokenRequest {}
9225impl GetSessionTokenRequest {
9226    /// Parse the HTTP response into the response enum.
9227    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetSessionTokenResponse> {
9228        let status = req.status();
9229        if status == http::StatusCode::OK {
9230            let data =
9231                oas3_gen_support::Diagnostics::<TickleResponse>::json_with_diagnostics(req).await?;
9232            return Ok(GetSessionTokenResponse::Ok(data));
9233        }
9234        if status == http::StatusCode::UNAUTHORIZED {
9235            let _ = req.bytes().await?;
9236            return Ok(GetSessionTokenResponse::Unauthorized);
9237        }
9238        let _ = req.bytes().await?;
9239        return Ok(GetSessionTokenResponse::Unknown);
9240    }
9241}
9242/// Response types for getSessionToken
9243#[derive(Debug, Clone)]
9244pub enum GetSessionTokenResponse {
9245    ///200: An array of objects detailing contract information.
9246    Ok(TickleResponse),
9247    ///401: Invalid or expired access token
9248    Unauthorized,
9249    ///default: Unknown response
9250    Unknown,
9251}
9252/// Validates the current session for the SSO user.
9253#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9254pub struct GetSessionValidationRequest {}
9255impl GetSessionValidationRequest {
9256    /// Parse the HTTP response into the response enum.
9257    pub async fn parse_response(
9258        req: reqwest::Response,
9259    ) -> anyhow::Result<GetSessionValidationResponse> {
9260        let status = req.status();
9261        if status == http::StatusCode::OK {
9262            let data =
9263                oas3_gen_support::Diagnostics::<SsoValidateResponse>::json_with_diagnostics(req)
9264                    .await?;
9265            return Ok(GetSessionValidationResponse::Ok(data));
9266        }
9267        if status == http::StatusCode::UNAUTHORIZED {
9268            let _ = req.bytes().await?;
9269            return Ok(GetSessionValidationResponse::Unauthorized);
9270        }
9271        let _ = req.bytes().await?;
9272        return Ok(GetSessionValidationResponse::Unknown);
9273    }
9274}
9275/// Response types for getSessionValidation
9276#[derive(Debug, Clone)]
9277pub enum GetSessionValidationResponse {
9278    ///200: An array of objects detailing contract information.
9279    Ok(SsoValidateResponse),
9280    ///401: Invalid or expired access token
9281    Unauthorized,
9282    ///default: Unknown response
9283    Unknown,
9284}
9285/// Retrieves the configuration of a single account group.  This describes the name of the allocation group, the specific accounts contained in the group, and the allocation method in use along with any relevant quantities. This endpoint is only supported for Financial Advisors and IBroker Accounts.
9286#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9287pub struct GetSingleAllocationGroupRequest {
9288    #[validate(nested)]
9289    pub body: NameRequestBody,
9290}
9291impl GetSingleAllocationGroupRequest {
9292    /// Parse the HTTP response into the response enum.
9293    pub async fn parse_response(
9294        req: reqwest::Response,
9295    ) -> anyhow::Result<GetSingleAllocationGroupResponse> {
9296        let status = req.status();
9297        if status == http::StatusCode::OK {
9298            let data = oas3_gen_support::Diagnostics::<AllocationGroup>::json_with_diagnostics(req)
9299                .await?;
9300            return Ok(GetSingleAllocationGroupResponse::Ok(data));
9301        }
9302        if status == http::StatusCode::UNAUTHORIZED {
9303            let _ = req.bytes().await?;
9304            return Ok(GetSingleAllocationGroupResponse::Unauthorized);
9305        }
9306        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9307            let _ = req.bytes().await?;
9308            return Ok(GetSingleAllocationGroupResponse::InternalServerError);
9309        }
9310        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9311            let _ = req.bytes().await?;
9312            return Ok(GetSingleAllocationGroupResponse::ServiceUnavailable);
9313        }
9314        let _ = req.bytes().await?;
9315        return Ok(GetSingleAllocationGroupResponse::Unknown);
9316    }
9317}
9318/// Response types for getSingleAllocationGroup
9319#[derive(Debug, Clone)]
9320pub enum GetSingleAllocationGroupResponse {
9321    ///200: Returns details of the allocation group.
9322    Ok(AllocationGroup),
9323    ///401: Invalid or expired access token
9324    Unauthorized,
9325    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9326     */
9327    InternalServerError,
9328    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9329     */
9330    ServiceUnavailable,
9331    ///default: Unknown response
9332    Unknown,
9333}
9334/// Returns the performance (MTM) for the given accounts, if more than one account is passed, the result is consolidated.
9335#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9336pub struct GetSinglePerformancePeriodRequest {
9337    pub body: PerformanceRequestBody,
9338}
9339impl GetSinglePerformancePeriodRequest {
9340    /// Parse the HTTP response into the response enum.
9341    pub async fn parse_response(
9342        req: reqwest::Response,
9343    ) -> anyhow::Result<GetSinglePerformancePeriodResponse> {
9344        let status = req.status();
9345        if status == http::StatusCode::OK {
9346            let data =
9347                oas3_gen_support::Diagnostics::<PerformanceResponse>::json_with_diagnostics(req)
9348                    .await?;
9349            return Ok(GetSinglePerformancePeriodResponse::Ok(data));
9350        }
9351        if status == http::StatusCode::BAD_REQUEST {
9352            let _ = req.bytes().await?;
9353            return Ok(GetSinglePerformancePeriodResponse::BadRequest);
9354        }
9355        if status == http::StatusCode::UNAUTHORIZED {
9356            let _ = req.bytes().await?;
9357            return Ok(GetSinglePerformancePeriodResponse::Unauthorized);
9358        }
9359        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9360            let _ = req.bytes().await?;
9361            return Ok(GetSinglePerformancePeriodResponse::InternalServerError);
9362        }
9363        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9364            let _ = req.bytes().await?;
9365            return Ok(GetSinglePerformancePeriodResponse::ServiceUnavailable);
9366        }
9367        let _ = req.bytes().await?;
9368        return Ok(GetSinglePerformancePeriodResponse::Unknown);
9369    }
9370}
9371/// Response types for getSinglePerformancePeriod
9372#[derive(Debug, Clone)]
9373pub enum GetSinglePerformancePeriodResponse {
9374    ///200: An array of objects detailing contract information.
9375    Ok(PerformanceResponse),
9376    ///400: Invalid input format or missing required fields
9377    BadRequest,
9378    ///401: Invalid or expired access token
9379    Unauthorized,
9380    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9381     */
9382    InternalServerError,
9383    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9384     */
9385    ServiceUnavailable,
9386    ///default: Unknown response
9387    Unknown,
9388}
9389/// Retrieve details of a single watchlist stored in the username's settings.
9390#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9391pub struct GetSpecificWatchlistRequest {
9392    #[validate(nested)]
9393    pub query: GetSpecificWatchlistRequestQuery,
9394}
9395impl GetSpecificWatchlistRequest {
9396    /// Parse the HTTP response into the response enum.
9397    pub async fn parse_response(
9398        req: reqwest::Response,
9399    ) -> anyhow::Result<GetSpecificWatchlistResponse> {
9400        let status = req.status();
9401        if status == http::StatusCode::OK {
9402            let data = oas3_gen_support::Diagnostics::<SingleWatchlist>::json_with_diagnostics(req)
9403                .await?;
9404            return Ok(GetSpecificWatchlistResponse::Ok(data));
9405        }
9406        if status == http::StatusCode::BAD_REQUEST {
9407            let _ = req.bytes().await?;
9408            return Ok(GetSpecificWatchlistResponse::BadRequest);
9409        }
9410        if status == http::StatusCode::UNAUTHORIZED {
9411            let _ = req.bytes().await?;
9412            return Ok(GetSpecificWatchlistResponse::Unauthorized);
9413        }
9414        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9415            let _ = req.bytes().await?;
9416            return Ok(GetSpecificWatchlistResponse::InternalServerError);
9417        }
9418        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9419            let _ = req.bytes().await?;
9420            return Ok(GetSpecificWatchlistResponse::ServiceUnavailable);
9421        }
9422        let _ = req.bytes().await?;
9423        return Ok(GetSpecificWatchlistResponse::Unknown);
9424    }
9425}
9426#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
9427pub struct GetSpecificWatchlistRequestQuery {
9428    /// Watchlist ID of the requested watchlist.
9429    /// - Example: `"1234".to_string()`
9430    #[validate(length(min = 1u64))]
9431    pub id: String,
9432}
9433/// Response types for getSpecificWatchlist
9434#[derive(Debug, Clone)]
9435pub enum GetSpecificWatchlistResponse {
9436    ///200: Successful deletion of specified watchlist.
9437    Ok(SingleWatchlist),
9438    ///400: Invalid input format or missing required fields
9439    BadRequest,
9440    ///401: Invalid or expired access token
9441    Unauthorized,
9442    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9443     */
9444    InternalServerError,
9445    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9446     */
9447    ServiceUnavailable,
9448    ///default: Unknown response
9449    Unknown,
9450}
9451#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
9452pub struct GetStatementsResponse {
9453    pub data: Option<ResponseData>,
9454}
9455/// Returns an object contains all stock contracts for given symbol(s)
9456#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9457pub struct GetStockBySymbolRequest {
9458    #[validate(nested)]
9459    pub query: GetStockBySymbolRequestQuery,
9460}
9461impl GetStockBySymbolRequest {
9462    /// Parse the HTTP response into the response enum.
9463    pub async fn parse_response(
9464        req: reqwest::Response,
9465    ) -> anyhow::Result<GetStockBySymbolResponse> {
9466        let status = req.status();
9467        if status == http::StatusCode::OK {
9468            let data = oas3_gen_support::Diagnostics::<Stocks>::json_with_diagnostics(req).await?;
9469            return Ok(GetStockBySymbolResponse::Ok(data));
9470        }
9471        if status == http::StatusCode::BAD_REQUEST {
9472            let _ = req.bytes().await?;
9473            return Ok(GetStockBySymbolResponse::BadRequest);
9474        }
9475        if status == http::StatusCode::UNAUTHORIZED {
9476            let _ = req.bytes().await?;
9477            return Ok(GetStockBySymbolResponse::Unauthorized);
9478        }
9479        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9480            let _ = req.bytes().await?;
9481            return Ok(GetStockBySymbolResponse::InternalServerError);
9482        }
9483        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9484            let _ = req.bytes().await?;
9485            return Ok(GetStockBySymbolResponse::ServiceUnavailable);
9486        }
9487        let _ = req.bytes().await?;
9488        return Ok(GetStockBySymbolResponse::Unknown);
9489    }
9490}
9491#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
9492pub struct GetStockBySymbolRequestQuery {
9493    /// Comma-separated list of stock symbols. Symbols must contain only capitalized letters.
9494    /// - Example: `"AAPL,IBKR".to_string()`
9495    #[validate(length(min = 1u64))]
9496    pub symbols: String,
9497}
9498/// Response types for getStockBySymbol
9499#[derive(Debug, Clone)]
9500pub enum GetStockBySymbolResponse {
9501    ///200: Successful response containing a contract's security definition.
9502    Ok(Stocks),
9503    ///400: Invalid input format or missing required fields
9504    BadRequest,
9505    ///401: Invalid or expired access token
9506    Unauthorized,
9507    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9508     */
9509    InternalServerError,
9510    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9511     */
9512    ServiceUnavailable,
9513    ///default: Unknown response
9514    Unknown,
9515}
9516/// Retrieve a list of trades, up to a maximum of 7 days prior.
9517#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9518pub struct GetTradeHistoryRequest {
9519    pub query: GetTradeHistoryRequestQuery,
9520}
9521impl GetTradeHistoryRequest {
9522    /// Parse the HTTP response into the response enum.
9523    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetTradeHistoryResponse> {
9524        let status = req.status();
9525        if status == http::StatusCode::OK {
9526            let data =
9527                oas3_gen_support::Diagnostics::<TradesResponse>::json_with_diagnostics(req).await?;
9528            return Ok(GetTradeHistoryResponse::Ok(data));
9529        }
9530        if status == http::StatusCode::UNAUTHORIZED {
9531            let _ = req.bytes().await?;
9532            return Ok(GetTradeHistoryResponse::Unauthorized);
9533        }
9534        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9535            let _ = req.bytes().await?;
9536            return Ok(GetTradeHistoryResponse::InternalServerError);
9537        }
9538        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9539            let _ = req.bytes().await?;
9540            return Ok(GetTradeHistoryResponse::ServiceUnavailable);
9541        }
9542        let _ = req.bytes().await?;
9543        return Ok(GetTradeHistoryResponse::Unknown);
9544    }
9545}
9546#[serde_with::skip_serializing_none]
9547#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
9548pub struct GetTradeHistoryRequestQuery {
9549    /// The number of prior days prior to include in response, up to a maximum of 7. If omitted, only the current day's executions will be returned.
9550    /// - Example: `Some(3i32)`
9551    pub days: Option<i32>,
9552}
9553/// Response types for getTradeHistory
9554#[derive(Debug, Clone)]
9555pub enum GetTradeHistoryResponse {
9556    ///200: trades
9557    Ok(TradesResponse),
9558    ///401: Invalid or expired access token
9559    Unauthorized,
9560    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9561     */
9562    InternalServerError,
9563    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9564     */
9565    ServiceUnavailable,
9566    ///default: Unknown response
9567    Unknown,
9568}
9569/// Returns the trading schedule up to a month for the requested contract.
9570#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9571pub struct GetTradingScheduleGetTrsrvSecdefScheduleRequest {
9572    #[validate(nested)]
9573    pub query: GetTradingScheduleGetTrsrvSecdefScheduleRequestQuery,
9574}
9575impl GetTradingScheduleGetTrsrvSecdefScheduleRequest {
9576    /// Parse the HTTP response into the response enum.
9577    pub async fn parse_response(
9578        req: reqwest::Response,
9579    ) -> anyhow::Result<GetTradingScheduleGetTrsrvSecdefScheduleResponse> {
9580        let status = req.status();
9581        if status == http::StatusCode::OK {
9582            let data = oas3_gen_support::Diagnostics::<TradingSchedule>::json_with_diagnostics(req)
9583                .await?;
9584            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::Ok(data));
9585        }
9586        if status == http::StatusCode::BAD_REQUEST {
9587            let _ = req.bytes().await?;
9588            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::BadRequest);
9589        }
9590        if status == http::StatusCode::UNAUTHORIZED {
9591            let _ = req.bytes().await?;
9592            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::Unauthorized);
9593        }
9594        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9595            let _ = req.bytes().await?;
9596            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::InternalServerError);
9597        }
9598        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9599            let _ = req.bytes().await?;
9600            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::ServiceUnavailable);
9601        }
9602        let _ = req.bytes().await?;
9603        return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::Unknown);
9604    }
9605}
9606#[serde_with::skip_serializing_none]
9607#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
9608pub struct GetTradingScheduleGetTrsrvSecdefScheduleRequestQuery {
9609    /// Specify the security type of the given contract. Valid asset classes are:
9610    ///  * `STK` - Stock
9611    ///  * `OPT` - Option
9612    ///  * `FUT` - Future
9613    ///  * `CFD` - Contract for Difference
9614    ///  * `WAR` - Warrant
9615    ///  * `SWP` - Forex
9616    ///  * `FND` - Mutual Fund
9617    ///  * `BND` - Bond
9618    ///  * `ICS` - Inter-Commodity Spread
9619    #[serde(rename = "assetClass")]
9620    pub asset_class: GetTradingScheduleGetTrsrvSecdefScheduleRequestQueryAssetClass,
9621    /// Specify the symbol for your contract.
9622    /// - Example: `"AAPL".to_string()`
9623    #[validate(length(min = 1u64))]
9624    pub symbol: String,
9625    /// Specify the primary exchange of your contract.
9626    /// - Example: `Some("NASDAQ".to_string())`
9627    pub exchange: Option<String>,
9628    /// Specify all exchanges you want to retrieve data from.
9629    /// - Example: `Some("AMEX,NASDAQ,NYSE".to_string())`
9630    #[serde(rename = "exchangeFilter")]
9631    pub exchange_filter: Option<String>,
9632}
9633/// Specify the security type of the given contract. Valid asset classes are:
9634///  * `STK` - Stock
9635///  * `OPT` - Option
9636///  * `FUT` - Future
9637///  * `CFD` - Contract for Difference
9638///  * `WAR` - Warrant
9639///  * `SWP` - Forex
9640///  * `FND` - Mutual Fund
9641///  * `BND` - Bond
9642///  * `ICS` - Inter-Commodity Spread
9643#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
9644pub enum GetTradingScheduleGetTrsrvSecdefScheduleRequestQueryAssetClass {
9645    #[serde(rename = "STK")]
9646    #[default]
9647    Stk,
9648    #[serde(rename = "OPT")]
9649    Opt,
9650    #[serde(rename = "FUT")]
9651    Fut,
9652    #[serde(rename = "CFD")]
9653    Cfd,
9654    #[serde(rename = "WAR")]
9655    War,
9656    #[serde(rename = "SWP")]
9657    Swp,
9658    #[serde(rename = "FND")]
9659    Fnd,
9660    #[serde(rename = "BND")]
9661    Bnd,
9662    #[serde(rename = "ICS")]
9663    Ics,
9664}
9665impl core::fmt::Display for GetTradingScheduleGetTrsrvSecdefScheduleRequestQueryAssetClass {
9666    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9667        match self {
9668            Self::Stk => write!(f, "STK"),
9669            Self::Opt => write!(f, "OPT"),
9670            Self::Fut => write!(f, "FUT"),
9671            Self::Cfd => write!(f, "CFD"),
9672            Self::War => write!(f, "WAR"),
9673            Self::Swp => write!(f, "SWP"),
9674            Self::Fnd => write!(f, "FND"),
9675            Self::Bnd => write!(f, "BND"),
9676            Self::Ics => write!(f, "ICS"),
9677        }
9678    }
9679}
9680/// Response types for getTradingSchedule_get_trsrv_secdef_schedule
9681#[derive(Debug, Clone)]
9682pub enum GetTradingScheduleGetTrsrvSecdefScheduleResponse {
9683    ///200: Returns the trading schedule up to a month for the requested contract.
9684    Ok(TradingSchedule),
9685    ///400: Invalid input format or missing required fields
9686    BadRequest,
9687    ///401: Invalid or expired access token
9688    Unauthorized,
9689    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9690     */
9691    InternalServerError,
9692    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9693     */
9694    ServiceUnavailable,
9695    ///default: Unknown response
9696    Unknown,
9697}
9698/// Returns the trading schedule for the 6 total days surrounding the current trading day. Non-Trading days, such as holidays, will not be returned.
9699#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9700pub struct GetTradingScheduleRequest {
9701    #[validate(nested)]
9702    pub query: GetTradingScheduleRequestQuery,
9703}
9704impl GetTradingScheduleRequest {
9705    /// Parse the HTTP response into the response enum.
9706    pub async fn parse_response(
9707        req: reqwest::Response,
9708    ) -> anyhow::Result<GetTradingScheduleResponse> {
9709        let status = req.status();
9710        if status == http::StatusCode::OK {
9711            let data =
9712                oas3_gen_support::Diagnostics::<ScheduleResponse>::json_with_diagnostics(req)
9713                    .await?;
9714            return Ok(GetTradingScheduleResponse::Ok(data));
9715        }
9716        if status == http::StatusCode::UNAUTHORIZED {
9717            let _ = req.bytes().await?;
9718            return Ok(GetTradingScheduleResponse::Unauthorized);
9719        }
9720        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9721            let _ = req.bytes().await?;
9722            return Ok(GetTradingScheduleResponse::InternalServerError);
9723        }
9724        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9725            let _ = req.bytes().await?;
9726            return Ok(GetTradingScheduleResponse::ServiceUnavailable);
9727        }
9728        let _ = req.bytes().await?;
9729        return Ok(GetTradingScheduleResponse::Unknown);
9730    }
9731}
9732#[serde_with::skip_serializing_none]
9733#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
9734pub struct GetTradingScheduleRequestQuery {
9735    /// Provide the contract identifier to retrieve the trading schedule for.
9736    #[validate(length(min = 1u64))]
9737    pub conid: String,
9738    /// Accepts the exchange to retrieve data from. Primary exchange is assumed by default.
9739    pub exchange: Option<String>,
9740}
9741/// Response types for getTradingSchedule
9742#[derive(Debug, Clone)]
9743pub enum GetTradingScheduleResponse {
9744    ///200: Returns the liquid and extended trading hours of the coming and prior trading days.
9745    Ok(ScheduleResponse),
9746    ///401: Invalid or expired access token
9747    Unauthorized,
9748    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9749     */
9750    InternalServerError,
9751    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9752     */
9753    ServiceUnavailable,
9754    ///default: Unknown response
9755    Unknown,
9756}
9757/// Transaction history for a given number of conids and accounts. Types of transactions include dividend payments, buy and sell transactions, transfers.
9758#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9759pub struct GetTransactionsRequest {
9760    pub body: TransactionRequestBody,
9761}
9762impl GetTransactionsRequest {
9763    /// Parse the HTTP response into the response enum.
9764    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetTransactionsResponse> {
9765        let status = req.status();
9766        if status == http::StatusCode::OK {
9767            let data =
9768                oas3_gen_support::Diagnostics::<TransactionsResponse>::json_with_diagnostics(req)
9769                    .await?;
9770            return Ok(GetTransactionsResponse::Ok(data));
9771        }
9772        if status == http::StatusCode::BAD_REQUEST {
9773            let _ = req.bytes().await?;
9774            return Ok(GetTransactionsResponse::BadRequest);
9775        }
9776        if status == http::StatusCode::UNAUTHORIZED {
9777            let _ = req.bytes().await?;
9778            return Ok(GetTransactionsResponse::Unauthorized);
9779        }
9780        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9781            let _ = req.bytes().await?;
9782            return Ok(GetTransactionsResponse::InternalServerError);
9783        }
9784        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9785            let _ = req.bytes().await?;
9786            return Ok(GetTransactionsResponse::ServiceUnavailable);
9787        }
9788        let _ = req.bytes().await?;
9789        return Ok(GetTransactionsResponse::Unknown);
9790    }
9791}
9792/// Response types for getTransactions
9793#[derive(Debug, Clone)]
9794pub enum GetTransactionsResponse {
9795    ///200: An array of objects detailing contract information.
9796    Ok(TransactionsResponse),
9797    ///400: Invalid input format or missing required fields
9798    BadRequest,
9799    ///401: Invalid or expired access token
9800    Unauthorized,
9801    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9802     */
9803    InternalServerError,
9804    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9805     */
9806    ServiceUnavailable,
9807    ///default: Unknown response
9808    Unknown,
9809}
9810/// Returns a list of positions for the given account. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint. This endpoint provides near-real time updates and removes caching otherwise found in the /portfolio/{accountId}/positions/{pageId} endpoint.
9811#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9812pub struct GetUncachedPositionsRequest {
9813    #[validate(nested)]
9814    pub path: GetUncachedPositionsRequestPath,
9815    pub query: GetUncachedPositionsRequestQuery,
9816}
9817impl GetUncachedPositionsRequest {
9818    /// Parse the HTTP response into the response enum.
9819    pub async fn parse_response(
9820        req: reqwest::Response,
9821    ) -> anyhow::Result<GetUncachedPositionsResponse> {
9822        let status = req.status();
9823        if status == http::StatusCode::OK {
9824            let data =
9825                oas3_gen_support::Diagnostics::<Portfolio2Positions>::json_with_diagnostics(req)
9826                    .await?;
9827            return Ok(GetUncachedPositionsResponse::Ok(data));
9828        }
9829        if status == http::StatusCode::UNAUTHORIZED {
9830            let _ = req.bytes().await?;
9831            return Ok(GetUncachedPositionsResponse::Unauthorized);
9832        }
9833        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9834            let _ = req.bytes().await?;
9835            return Ok(GetUncachedPositionsResponse::InternalServerError);
9836        }
9837        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9838            let _ = req.bytes().await?;
9839            return Ok(GetUncachedPositionsResponse::ServiceUnavailable);
9840        }
9841        let _ = req.bytes().await?;
9842        return Ok(GetUncachedPositionsResponse::Unknown);
9843    }
9844}
9845#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
9846pub struct GetUncachedPositionsRequestPath {
9847    /// accountId
9848    /// - Example: `"DU123456".to_string()`
9849    #[validate(length(min = 1u64))]
9850    pub account_id: String,
9851}
9852#[serde_with::skip_serializing_none]
9853#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
9854pub struct GetUncachedPositionsRequestQuery {
9855    /// Model code to track the account within.
9856    /// - Example: `Some("Primary_Model_Groups".to_string())`
9857    pub model: Option<String>,
9858    /// The chronologic order of orders to sort by.
9859    ///   * `a` - Display in ascending order.
9860    ///   * `d` - Display in descending order.
9861    #[default(Some(Default::default()))]
9862    pub direction: Option<GetUncachedPositionsRequestQueryDirection>,
9863}
9864/// The chronologic order of orders to sort by.
9865///   * `a` - Display in ascending order.
9866///   * `d` - Display in descending order.
9867#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
9868pub enum GetUncachedPositionsRequestQueryDirection {
9869    #[serde(rename = "a")]
9870    #[default]
9871    A,
9872    #[serde(rename = "d")]
9873    D,
9874}
9875impl core::fmt::Display for GetUncachedPositionsRequestQueryDirection {
9876    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9877        match self {
9878            Self::A => write!(f, "a"),
9879            Self::D => write!(f, "d"),
9880        }
9881    }
9882}
9883/// Response types for getUncachedPositions
9884#[derive(Debug, Clone)]
9885pub enum GetUncachedPositionsResponse {
9886    ///200: response with position details
9887    Ok(Portfolio2Positions),
9888    ///401: Invalid or expired access token
9889    Unauthorized,
9890    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9891     */
9892    InternalServerError,
9893    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9894     */
9895    ServiceUnavailable,
9896    ///default: Unknown response
9897    Unknown,
9898}
9899/// Returns the total number of unread notifications
9900#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
9901pub struct GetUnreadFyisRequest {}
9902impl GetUnreadFyisRequest {
9903    /// Parse the HTTP response into the response enum.
9904    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetUnreadFyisResponse> {
9905        let status = req.status();
9906        if status == http::StatusCode::OK {
9907            let data =
9908                oas3_gen_support::Diagnostics::<BNResponse>::json_with_diagnostics(req).await?;
9909            return Ok(GetUnreadFyisResponse::Ok(data));
9910        }
9911        if status == http::StatusCode::UNAUTHORIZED {
9912            let _ = req.bytes().await?;
9913            return Ok(GetUnreadFyisResponse::Unauthorized);
9914        }
9915        if status == http::StatusCode::LOCKED {
9916            let _ = req.bytes().await?;
9917            return Ok(GetUnreadFyisResponse::Locked);
9918        }
9919        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
9920            let _ = req.bytes().await?;
9921            return Ok(GetUnreadFyisResponse::InternalServerError);
9922        }
9923        if status == http::StatusCode::SERVICE_UNAVAILABLE {
9924            let _ = req.bytes().await?;
9925            return Ok(GetUnreadFyisResponse::ServiceUnavailable);
9926        }
9927        let _ = req.bytes().await?;
9928        return Ok(GetUnreadFyisResponse::Unknown);
9929    }
9930}
9931/// Response types for getUnreadFyis
9932#[derive(Debug, Clone)]
9933pub enum GetUnreadFyisResponse {
9934    ///200: Indicates data is being returned successfully.
9935    Ok(BNResponse),
9936    ///401: Invalid or expired access token
9937    Unauthorized,
9938    ///423: Return if called too frequently. Should not be called more than 1 time in 5 minutes
9939    Locked,
9940    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
9941     */
9942    InternalServerError,
9943    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
9944     */
9945    ServiceUnavailable,
9946    ///default: Unknown response
9947    Unknown,
9948}
9949#[serde_with::skip_serializing_none]
9950#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
9951#[serde(default)]
9952pub struct GroupRequestBody {
9953    /// An array of accounts that should be held in the allocation group and, if using a User-specified allocaiton method, the value correlated to the allocation.
9954    #[validate(nested)]
9955    pub accounts: Vec<GroupRequestBodyAccount>,
9956    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
9957    ///   * `A` - Available Equity
9958    ///   * `E` - Equal
9959    ///   * `N` - Net Liquidation Value
9960    ///
9961    /// User-specified allocation methods:
9962    ///   * `C` - Cash Quantity
9963    ///   * `P` - Percentage
9964    ///   * `R` - Ratios
9965    ///   * `S` - Shares
9966    #[default(Some(Default::default()))]
9967    pub default_method: Option<AllocationMethod>,
9968    /// Name used to refer to your allocation group. If prev_name is specified, this will become the new name of the group.
9969    /// - Example: `"Group_1_NetLiq".to_string()`
9970    #[validate(length(min = 1u64))]
9971    pub name: String,
9972    /// Can be used to rename a group. Using this field will recognize the previous name, while the "name" filed will mark the updated name.
9973    /// - Example: `Some("Group_0_NetLiq".to_string())`
9974    pub prev_name: Option<String>,
9975}
9976#[serde_with::skip_serializing_none]
9977#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
9978#[serde(default)]
9979pub struct GroupRequestBody2 {
9980    /// An array of accounts that should be held in the allocation group and, if using a User-specified allocaiton method, the value correlated to the allocation.
9981    #[validate(nested)]
9982    pub accounts: Vec<GroupRequestBodyAccount>,
9983    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
9984    ///   * `A` - Available Equity
9985    ///   * `E` - Equal
9986    ///   * `N` - Net Liquidation Value
9987    ///
9988    /// User-specified allocation methods:
9989    ///   * `C` - Cash Quantity
9990    ///   * `P` - Percentage
9991    ///   * `R` - Ratios
9992    ///   * `S` - Shares
9993    #[default(Some(Default::default()))]
9994    pub default_method: Option<AllocationMethod>,
9995    /// Name used to refer to your allocation group. If prev_name is specified, this will become the new name of the group.
9996    /// - Example: `"Group_1_NetLiq".to_string()`
9997    #[validate(length(min = 1u64))]
9998    pub name: String,
9999}
10000#[serde_with::skip_serializing_none]
10001#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
10002pub struct GroupRequestBodyAccount {
10003    /// The total distribution value for each sub-account for user-defined allocation methods.
10004    /// - Example: `Some(10i32)`
10005    pub amount: Option<i32>,
10006    /// The accountId of a given sub-account.
10007    /// - Example: `"U1234567".to_string()`
10008    #[validate(length(min = 1u64))]
10009    pub name: String,
10010}
10011#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10012#[serde(untagged)]
10013pub enum History200Response {
10014    /// Object containing the requested historical data and related metadata.
10015    #[default]
10016    BidAsk(IserverHistoryBidAskResponse),
10017    /// Object containing the requested historical data and related metadata.
10018    Last(IserverHistoryLastResponse),
10019    /// Object containing the requested historical data and related metadata.
10020    Midpoint(IserverHistoryMidpointResponse),
10021}
10022impl History200Response {
10023    /// Object containing the requested historical data and related metadata.
10024    pub fn bid_ask() -> Self {
10025        Self::BidAsk(IserverHistoryBidAskResponse::default())
10026    }
10027    /// Object containing the requested historical data and related metadata.
10028    pub fn last() -> Self {
10029        Self::Last(IserverHistoryLastResponse::default())
10030    }
10031    /// Object containing the requested historical data and related metadata.
10032    pub fn midpoint() -> Self {
10033        Self::Midpoint(IserverHistoryMidpointResponse::default())
10034    }
10035}
10036#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10037pub struct IndividualComboPosition {
10038    /// IB accountId of an account with a position in the requested conid.
10039    #[serde(rename = "acctId")]
10040    pub acct_id: Option<String>,
10041    /// Asset class of the requested instrument.
10042    #[serde(rename = "assetClass")]
10043    pub asset_class: Option<String>,
10044    /// The account's average cost for its position.
10045    #[serde(rename = "avgCost")]
10046    pub avg_cost: Option<f64>,
10047    /// The account's average price for its position.
10048    #[serde(rename = "avgPrice")]
10049    pub avg_price: Option<f64>,
10050    #[serde(rename = "conExchMap")]
10051    pub con_exch_map: Option<Vec<serde_json::Value>>,
10052    /// IB contract ID for the instrument.
10053    pub conid: Option<i32>,
10054    /// Human-readable description of the instrument.
10055    #[serde(rename = "contractDesc")]
10056    pub contract_desc: Option<String>,
10057    /// Currency in which the instrument trades.
10058    pub currency: Option<String>,
10059    pub exchs: Option<serde_json::Value>,
10060    /// Style of exercise for options.
10061    #[serde(rename = "exerciseStyle")]
10062    pub exercise_style: Option<String>,
10063    /// Expiration of instrument, if applicable.
10064    pub expiry: Option<String>,
10065    /// Current market price of the instrument, in the instrument's currency.
10066    #[serde(rename = "mktPrice")]
10067    pub mkt_price: Option<f64>,
10068    /// Current market value of the account's position in the instrument, in the instrument's currency.
10069    #[serde(rename = "mktValue")]
10070    pub mkt_value: Option<f64>,
10071    /// Instrument's multiplier, if applicable.
10072    pub multiplier: Option<f64>,
10073    /// Size of position in units of instrument.
10074    pub position: Option<f64>,
10075    /// The right of an options contract, if applicable.
10076    #[serde(rename = "putOrCall")]
10077    pub put_or_call: Option<IndividualComboPositionPutOrCall>,
10078    /// Realized PnL for the instrument in the instrument's currency.
10079    #[serde(rename = "realizedPnl")]
10080    pub realized_pnl: Option<f64>,
10081    /// Strike price, if applicable. Returned as string.
10082    pub strike: Option<String>,
10083    /// Contract ID of underlying instrument, if applicable.
10084    #[serde(rename = "undConid")]
10085    pub und_conid: Option<i32>,
10086    /// Unrealized PnL for the instrument in the account.
10087    #[serde(rename = "unrealizedPnl")]
10088    pub unrealized_pnl: Option<f64>,
10089}
10090/// The right of an options contract, if applicable.
10091#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
10092pub enum IndividualComboPositionPutOrCall {
10093    #[default]
10094    P,
10095    C,
10096    None,
10097}
10098impl core::fmt::Display for IndividualComboPositionPutOrCall {
10099    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10100        match self {
10101            Self::P => write!(f, "P"),
10102            Self::C => write!(f, "C"),
10103            Self::None => write!(f, "None"),
10104        }
10105    }
10106}
10107#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10108pub struct IndividualIRABene {
10109    #[serde(rename = "dateOfBirth")]
10110    pub date_of_birth: Option<String>,
10111    #[serde(rename = "firstName")]
10112    pub first_name: Option<String>,
10113    pub identification: Option<std::collections::HashMap<String, String>>,
10114    #[serde(rename = "lastName")]
10115    pub last_name: Option<String>,
10116    pub location: Option<std::collections::HashMap<String, String>>,
10117    pub ownership: Option<i32>,
10118    #[serde(rename = "perStripes")]
10119    pub per_stripes: Option<String>,
10120    pub relationship: Option<String>,
10121    #[serde(rename = "type")]
10122    pub r#type: Option<String>,
10123}
10124/// A specific account's position in the requested conid.
10125#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10126pub struct IndividualPosition {
10127    /// IB accountId of an account with a position in the requested conid.
10128    #[serde(rename = "acctId")]
10129    pub acct_id: Option<String>,
10130    /// Comma separated all exchanges on which the instrument trades.
10131    #[serde(rename = "allExchanges")]
10132    pub all_exchanges: Option<String>,
10133    /// Asset class of the requested instrument.
10134    #[serde(rename = "assetClass")]
10135    pub asset_class: Option<String>,
10136    /// The account's average cost for its position.
10137    #[serde(rename = "avgCost")]
10138    pub avg_cost: Option<f64>,
10139    /// The account's average price for its position.
10140    #[serde(rename = "avgPrice")]
10141    pub avg_price: Option<f64>,
10142    /// Average cost in the account's base currency.
10143    #[serde(rename = "baseAvgCost")]
10144    pub base_avg_cost: Option<f64>,
10145    /// Average price in the account's base currency.
10146    #[serde(rename = "baseAvgPrice")]
10147    pub base_avg_price: Option<f64>,
10148    /// Market price of instrument in the account's base currency.
10149    #[serde(rename = "baseMktPrice")]
10150    pub base_mkt_price: Option<f64>,
10151    /// Market value of the position in the account's base currency.
10152    #[serde(rename = "baseMktValue")]
10153    pub base_mkt_value: Option<f64>,
10154    /// Realized PnL for the instrument in the account's base currency.
10155    #[serde(rename = "baseRealizedPnl")]
10156    pub base_realized_pnl: Option<f64>,
10157    /// Unrealized PnL for the instrument in the account's base currency.
10158    #[serde(rename = "baseUnrealizedPnl")]
10159    pub base_unrealized_pnl: Option<f64>,
10160    /// Chinese name of the instrument.
10161    #[serde(rename = "chineseName")]
10162    pub chinese_name: Option<String>,
10163    #[serde(rename = "conExchMap")]
10164    pub con_exch_map: Option<Vec<serde_json::Value>>,
10165    /// IB contract ID for the instrument.
10166    pub conid: Option<i32>,
10167    /// Human-readable description of the instrument.
10168    #[serde(rename = "contractDesc")]
10169    pub contract_desc: Option<String>,
10170    /// Country in which the instrument is issued.
10171    #[serde(rename = "countryCode")]
10172    pub country_code: Option<String>,
10173    /// Currency in which the instrument trades.
10174    pub currency: Option<String>,
10175    /// Object defining minimum increments used in displaying market data for the instrument.
10176    #[serde(rename = "displayRule")]
10177    pub display_rule: Option<IndividualPositionDisplayRule>,
10178    pub exchs: Option<serde_json::Value>,
10179    /// Style of exercise for options.
10180    #[serde(rename = "exerciseStyle")]
10181    pub exercise_style: Option<String>,
10182    /// Expiration of instrument, if applicable.
10183    pub expiry: Option<String>,
10184    /// Full display name of the instrument.
10185    #[serde(rename = "fullName")]
10186    pub full_name: Option<String>,
10187    /// Industry sub-categorization of the instrument.
10188    pub group: Option<String>,
10189    /// Indicates whether instrument has options contracts available for trading at IB.
10190    #[serde(rename = "hasOptions")]
10191    pub has_options: Option<bool>,
10192    /// Array containing increment rules used when pricing orders for the instrument.
10193    #[serde(rename = "incrementRules")]
10194    pub increment_rules: Option<Vec<IndividualPositionIncrementRule>>,
10195    /// Indicates whether the instrument is an Event Contract.
10196    #[serde(rename = "isEventContract")]
10197    pub is_event_contract: Option<bool>,
10198    /// Indicates whether the instrument is issued in the US.
10199    #[serde(rename = "isUS")]
10200    pub is_us: Option<bool>,
10201    /// Last day of trading in the instrument, if applicable. Formatted `YYYYMMDD`.
10202    #[serde(rename = "lastTradingDay")]
10203    pub last_trading_day: Option<String>,
10204    /// The exchange on which the instrument is listed, or the primary exchange recognized by IB for the instrument.
10205    #[serde(rename = "listingExchange")]
10206    pub listing_exchange: Option<String>,
10207    /// Current market price of the instrument, in the instrument's currency.
10208    #[serde(rename = "mktPrice")]
10209    pub mkt_price: Option<f64>,
10210    /// Current market value of the account's position in the instrument, in the instrument's currency.
10211    #[serde(rename = "mktValue")]
10212    pub mkt_value: Option<f64>,
10213    /// Name of the model portfolio in which the account is invested that contributes this position.
10214    pub model: Option<String>,
10215    /// Instrument's multiplier, if applicable.
10216    pub multiplier: Option<f64>,
10217    /// Formal name of the entity or asset to which the instrument relates.
10218    pub name: Option<String>,
10219    /// Maximum number of accounts that can be returned in a single request.
10220    #[serde(rename = "pageSize")]
10221    pub page_size: Option<i32>,
10222    /// Size of position in units of instrument.
10223    pub position: Option<f64>,
10224    /// The right of an options contract, if applicable.
10225    #[serde(rename = "putOrCall")]
10226    pub put_or_call: Option<IndividualPositionPutOrCall>,
10227    /// Realized PnL for the instrument in the instrument's currency.
10228    #[serde(rename = "realizedPnl")]
10229    pub realized_pnl: Option<f64>,
10230    /// Industry sector categorization of the instrument.
10231    pub sector: Option<String>,
10232    /// Industry sub-categorization of the instrument.
10233    #[serde(rename = "sectorGroup")]
10234    pub sector_group: Option<String>,
10235    /// Strike price, if applicable. Returned as string.
10236    pub strike: Option<String>,
10237    /// Symbol associated with the instrument.
10238    pub ticker: Option<String>,
10239    /// Time taken to retrieve position data in milliseconds.
10240    pub time: Option<i32>,
10241    /// Description of instrument, used to differentiate classes, if applicable.
10242    #[serde(rename = "type")]
10243    pub r#type: Option<String>,
10244    /// Contract ID of underlying instrument, if applicable.
10245    #[serde(rename = "undConid")]
10246    pub und_conid: Option<i32>,
10247    /// Unrealized PnL for the instrument in the account.
10248    #[serde(rename = "unrealizedPnl")]
10249    pub unrealized_pnl: Option<f64>,
10250}
10251pub type IndividualPositionArray = Vec<IndividualPosition>;
10252/// Object defining minimum increments used in displaying market data for the instrument.
10253#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10254pub struct IndividualPositionDisplayRule {
10255    /// Array containing objects corresponding to display rule increments.
10256    #[serde(rename = "displayRuleStep")]
10257    pub display_rule_step: Option<Vec<IndividualPositionDisplayRuleDisplayRuleStep>>,
10258    /// Magnifier applied to pricing, if applicable.
10259    pub magnification: Option<i32>,
10260}
10261/// A single display rule increment.
10262#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10263pub struct IndividualPositionDisplayRuleDisplayRuleStep {
10264    /// Number of decimal digits to display.
10265    #[serde(rename = "decimalDigits")]
10266    pub decimal_digits: Option<i32>,
10267    /// Lower edge from which the display rule is effective.
10268    #[serde(rename = "lowerEdge")]
10269    pub lower_edge: Option<f64>,
10270    /// Number of integer digits to display.
10271    #[serde(rename = "wholeDigits")]
10272    pub whole_digits: Option<i32>,
10273}
10274/// Objects describing a single increment rule.
10275#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10276pub struct IndividualPositionIncrementRule {
10277    /// The pricing increment.
10278    pub increment: Option<f64>,
10279    /// Lower edge from which the price increment rule is effective.
10280    #[serde(rename = "lowerEdge")]
10281    pub lower_edge: Option<f64>,
10282}
10283/// The right of an options contract, if applicable.
10284#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
10285pub enum IndividualPositionPutOrCall {
10286    #[default]
10287    P,
10288    C,
10289}
10290impl core::fmt::Display for IndividualPositionPutOrCall {
10291    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10292        match self {
10293            Self::P => write!(f, "P"),
10294            Self::C => write!(f, "C"),
10295        }
10296    }
10297}
10298/// After retrieving the access token and subsequent Live Session Token, customers can initialize their brokerage session with the ssodh/init endpoint.
10299#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
10300pub struct InitializeSessionRequest {
10301    pub body: BrokerageSessionInitRequest,
10302}
10303impl InitializeSessionRequest {
10304    /// Parse the HTTP response into the response enum.
10305    pub async fn parse_response(
10306        req: reqwest::Response,
10307    ) -> anyhow::Result<InitializeSessionResponse> {
10308        let status = req.status();
10309        if status == http::StatusCode::OK {
10310            let data =
10311                oas3_gen_support::Diagnostics::<BrokerageSessionStatus>::json_with_diagnostics(req)
10312                    .await?;
10313            return Ok(InitializeSessionResponse::Ok(data));
10314        }
10315        if status == http::StatusCode::UNAUTHORIZED {
10316            let _ = req.bytes().await?;
10317            return Ok(InitializeSessionResponse::Unauthorized);
10318        }
10319        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
10320            let _ = req.bytes().await?;
10321            return Ok(InitializeSessionResponse::InternalServerError);
10322        }
10323        if status == http::StatusCode::SERVICE_UNAVAILABLE {
10324            let _ = req.bytes().await?;
10325            return Ok(InitializeSessionResponse::ServiceUnavailable);
10326        }
10327        let _ = req.bytes().await?;
10328        return Ok(InitializeSessionResponse::Unknown);
10329    }
10330}
10331/// Response types for initializeSession
10332#[derive(Debug, Clone)]
10333pub enum InitializeSessionResponse {
10334    ///200: An array of objects detailing contract information.
10335    Ok(BrokerageSessionStatus),
10336    ///401: Invalid or expired access token
10337    Unauthorized,
10338    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
10339     */
10340    InternalServerError,
10341    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
10342     */
10343    ServiceUnavailable,
10344    ///default: Unknown response
10345    Unknown,
10346}
10347#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10348#[serde(untagged)]
10349pub enum Instruction200Response {
10350    #[default]
10351    InstructionPolling(InstructionPollingResponse),
10352    Instruction(InstructionResponse),
10353    QueryRecentInstruction(QueryRecentInstructionResponse),
10354    DepositFundsPolling(DepositFundsPollingResponse),
10355    QueryIRAContributions(QueryIRAContributionsResponse),
10356}
10357#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
10358pub enum InstructionDirection {
10359    #[serde(rename = "IN")]
10360    #[default]
10361    In,
10362    #[serde(rename = "OUT")]
10363    Out,
10364}
10365impl core::fmt::Display for InstructionDirection {
10366    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10367        match self {
10368            Self::In => write!(f, "IN"),
10369            Self::Out => write!(f, "OUT"),
10370        }
10371    }
10372}
10373#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10374pub struct InstructionPollingResponse {
10375    #[serde(rename = "instructionResult")]
10376    pub instruction_result: Option<PollingInstructionResult>,
10377    /// - Example: `-1988905739.0`
10378    #[serde(rename = "instructionSetId")]
10379    pub instruction_set_id: f64,
10380    /// - Example: `202.0`
10381    pub status: f64,
10382}
10383#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
10384pub struct InstructionRequestBody {
10385    pub instruction: InstructionRequestBodyInstruction,
10386    #[serde(rename = "instructionType")]
10387    pub instruction_type: InstructionRequestBodyInstructionType,
10388}
10389#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
10390#[serde(untagged)]
10391pub enum InstructionRequestBodyInstruction {
10392    #[default]
10393    TraditionalBankInstructionVerification(TraditionalBankInstructionVerification),
10394    AchInstruction(AchInstruction),
10395    DeleteBankInstruction(DeleteBankInstruction),
10396    PredefinedDestinationInstruction(PredefinedDestinationInstruction),
10397    EddaInstruction(EddaInstruction),
10398}
10399#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
10400pub enum InstructionRequestBodyInstructionType {
10401    #[serde(rename = "ACH_INSTRUCTION")]
10402    #[default]
10403    AchInstruction,
10404    #[serde(rename = "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")]
10405    TraditionalBankInstructionVerification,
10406    #[serde(rename = "DELETE_BANK_INSTRUCTION")]
10407    DeleteBankInstruction,
10408    #[serde(rename = "PREDEFINED_DESTINATION_INSTRUCTION")]
10409    PredefinedDestinationInstruction,
10410    #[serde(rename = "EDDA_INSTRUCTION")]
10411    EddaInstruction,
10412}
10413impl core::fmt::Display for InstructionRequestBodyInstructionType {
10414    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10415        match self {
10416            Self::AchInstruction => write!(f, "ACH_INSTRUCTION"),
10417            Self::TraditionalBankInstructionVerification => {
10418                write!(f, "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")
10419            }
10420            Self::DeleteBankInstruction => write!(f, "DELETE_BANK_INSTRUCTION"),
10421            Self::PredefinedDestinationInstruction => {
10422                write!(f, "PREDEFINED_DESTINATION_INSTRUCTION")
10423            }
10424            Self::EddaInstruction => write!(f, "EDDA_INSTRUCTION"),
10425        }
10426    }
10427}
10428#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10429pub struct InstructionResponse {
10430    #[serde(rename = "instructionResult")]
10431    pub instruction_result: Option<InstructionResult>,
10432    /// - Example: `-1988905739.0`
10433    #[serde(rename = "instructionSetId")]
10434    pub instruction_set_id: f64,
10435    /// - Example: `202.0`
10436    pub status: f64,
10437}
10438#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10439pub struct InstructionResult {
10440    /// - Example: `1012983.0`
10441    #[serde(rename = "clientInstructionId")]
10442    pub client_instruction_id: f64,
10443    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
10444    pub description: Option<String>,
10445    /// - Example: `Some(23456745.0)`
10446    #[serde(rename = "ibReferenceId")]
10447    pub ib_reference_id: Option<f64>,
10448    /// - Example: `45123654.0`
10449    #[serde(rename = "instructionId")]
10450    pub instruction_id: f64,
10451    /// - Example: `"PENDING"`
10452    #[serde(rename = "instructionStatus")]
10453    pub instruction_status: InstructionResultInstructionStatus,
10454    /// - Example: `"INTERNAL_CASH_TRANSFER"`
10455    #[serde(rename = "instructionType")]
10456    pub instruction_type: InstructionResultInstructionType,
10457}
10458#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
10459pub enum InstructionResultInstructionStatus {
10460    #[serde(rename = "PENDING")]
10461    #[default]
10462    Pending,
10463    #[serde(rename = "PROCESSED")]
10464    Processed,
10465    #[serde(rename = "REJECTED")]
10466    Rejected,
10467    #[serde(rename = "PENDING_VERIFICATION")]
10468    PendingVerification,
10469}
10470impl core::fmt::Display for InstructionResultInstructionStatus {
10471    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10472        match self {
10473            Self::Pending => write!(f, "PENDING"),
10474            Self::Processed => write!(f, "PROCESSED"),
10475            Self::Rejected => write!(f, "REJECTED"),
10476            Self::PendingVerification => write!(f, "PENDING_VERIFICATION"),
10477        }
10478    }
10479}
10480#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
10481pub enum InstructionResultInstructionType {
10482    #[serde(rename = "ACH_INSTRUCTION")]
10483    #[default]
10484    AchInstruction,
10485    #[serde(rename = "CANCEL_INSTRUCTION")]
10486    CancelInstruction,
10487    #[serde(rename = "COMPLEX_ASSET_TRANSFER")]
10488    ComplexAssetTransfer,
10489    #[serde(rename = "DELETE_BANK_INSTRUCTION")]
10490    DeleteBankInstruction,
10491    #[serde(rename = "DEPOSIT")]
10492    Deposit,
10493    #[serde(rename = "DWAC")]
10494    Dwac,
10495    #[serde(rename = "EXTERNAL_POSITION_TRANSFER")]
10496    ExternalPositionTransfer,
10497    #[serde(rename = "FOP")]
10498    Fop,
10499    #[serde(rename = "QUERY_RECENT_INSTRUCTIONS")]
10500    QueryRecentInstructions,
10501    #[serde(rename = "QUERY_WITHDRAWABLE_FUNDS")]
10502    QueryWithdrawableFunds,
10503    #[serde(rename = "INTERNAL_POSITION_TRANSFER")]
10504    InternalPositionTransfer,
10505    #[serde(rename = "INTERNAL_CASH_TRANSFER")]
10506    InternalCashTransfer,
10507    #[serde(rename = "MICRO_AMOUNT")]
10508    MicroAmount,
10509    #[serde(rename = "PREDEFINED_DESTINATION_INSTRUCTION")]
10510    PredefinedDestinationInstruction,
10511    #[serde(rename = "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")]
10512    TraditionalBankInstructionVerification,
10513    #[serde(rename = "WITHDRAWAL")]
10514    Withdrawal,
10515    #[serde(rename = "QUERY_IRA_CONTRIBUTIONS")]
10516    QueryIraContributions,
10517    #[serde(rename = "EDDA_INSTRUCTION")]
10518    EddaInstruction,
10519    #[serde(rename = "QUERY_RECENT_RECURRING_EVENTS")]
10520    QueryRecentRecurringEvents,
10521    #[serde(rename = "QUERY_RECURRING_INSTRUCTIONS")]
10522    QueryRecurringInstructions,
10523    #[serde(rename = "QUERY_ACCOUNT_BALANCES")]
10524    QueryAccountBalances,
10525    #[serde(rename = "QUERY_BANK_INSTRUCTION")]
10526    QueryBankInstruction,
10527    #[serde(rename = "QUERY_WITHDRAWABLE_CASH_EQUITY")]
10528    QueryWithdrawableCashEquity,
10529}
10530impl core::fmt::Display for InstructionResultInstructionType {
10531    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10532        match self {
10533            Self::AchInstruction => write!(f, "ACH_INSTRUCTION"),
10534            Self::CancelInstruction => write!(f, "CANCEL_INSTRUCTION"),
10535            Self::ComplexAssetTransfer => write!(f, "COMPLEX_ASSET_TRANSFER"),
10536            Self::DeleteBankInstruction => write!(f, "DELETE_BANK_INSTRUCTION"),
10537            Self::Deposit => write!(f, "DEPOSIT"),
10538            Self::Dwac => write!(f, "DWAC"),
10539            Self::ExternalPositionTransfer => write!(f, "EXTERNAL_POSITION_TRANSFER"),
10540            Self::Fop => write!(f, "FOP"),
10541            Self::QueryRecentInstructions => write!(f, "QUERY_RECENT_INSTRUCTIONS"),
10542            Self::QueryWithdrawableFunds => write!(f, "QUERY_WITHDRAWABLE_FUNDS"),
10543            Self::InternalPositionTransfer => write!(f, "INTERNAL_POSITION_TRANSFER"),
10544            Self::InternalCashTransfer => write!(f, "INTERNAL_CASH_TRANSFER"),
10545            Self::MicroAmount => write!(f, "MICRO_AMOUNT"),
10546            Self::PredefinedDestinationInstruction => {
10547                write!(f, "PREDEFINED_DESTINATION_INSTRUCTION")
10548            }
10549            Self::TraditionalBankInstructionVerification => {
10550                write!(f, "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")
10551            }
10552            Self::Withdrawal => write!(f, "WITHDRAWAL"),
10553            Self::QueryIraContributions => write!(f, "QUERY_IRA_CONTRIBUTIONS"),
10554            Self::EddaInstruction => write!(f, "EDDA_INSTRUCTION"),
10555            Self::QueryRecentRecurringEvents => {
10556                write!(f, "QUERY_RECENT_RECURRING_EVENTS")
10557            }
10558            Self::QueryRecurringInstructions => write!(f, "QUERY_RECURRING_INSTRUCTIONS"),
10559            Self::QueryAccountBalances => write!(f, "QUERY_ACCOUNT_BALANCES"),
10560            Self::QueryBankInstruction => write!(f, "QUERY_BANK_INSTRUCTION"),
10561            Self::QueryWithdrawableCashEquity => {
10562                write!(f, "QUERY_WITHDRAWABLE_CASH_EQUITY")
10563            }
10564        }
10565    }
10566}
10567#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
10568#[serde(default)]
10569pub struct InternalAssetTransfersBulkRequestBody {
10570    #[serde(rename = "instructionType")]
10571    #[default("INTERNAL_POSITION_TRANSFER".to_string())]
10572    pub instruction_type: String,
10573    pub instructions: Vec<serde_json::Value>,
10574}
10575#[serde_with::skip_serializing_none]
10576#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
10577pub struct InternalCashTransferInstruction {
10578    /// - Example: `123.0`
10579    pub amount: f64,
10580    /// - Example: `1012983.0`
10581    #[serde(rename = "clientInstructionId")]
10582    pub client_instruction_id: f64,
10583    /// - Example: `Some("Note".to_string())`
10584    #[serde(rename = "clientNote")]
10585    #[validate(length(min = 1u64, max = 64u64))]
10586    pub client_note: Option<String>,
10587    /// - Example: `"GBP".to_string()`
10588    #[validate(length(min = 1u64, max = 3u64))]
10589    pub currency: String,
10590    #[serde(rename = "dateTimeToOccur")]
10591    pub date_time_to_occur: Option<chrono::DateTime<chrono::Utc>>,
10592    /// - Example: `"U46377".to_string()`
10593    #[serde(rename = "sourceAccountId")]
10594    #[validate(length(min = 1u64, max = 32u64))]
10595    pub source_account_id: String,
10596    /// - Example: `"U15667".to_string()`
10597    #[serde(rename = "targetAccountId")]
10598    #[validate(length(min = 1u64, max = 32u64))]
10599    pub target_account_id: String,
10600}
10601#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
10602#[serde(default)]
10603pub struct InternalCashTransfersBulkRequestBody {
10604    #[serde(rename = "instructionType")]
10605    #[default("INTERNAL_CASH_TRANSFER".to_string())]
10606    pub instruction_type: String,
10607    pub instructions: Vec<serde_json::Value>,
10608}
10609#[serde_with::skip_serializing_none]
10610#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
10611pub struct InternalPositionTransferInstruction {
10612    /// - Example: `1012983.0`
10613    #[serde(rename = "clientInstructionId")]
10614    pub client_instruction_id: f64,
10615    /// If settleDate is provided then tradeDate is also required
10616    /// - Example: `Some("2025-02-25".to_string())`
10617    #[serde(rename = "settleDate")]
10618    pub settle_date: Option<String>,
10619    /// - Example: `"U46377".to_string()`
10620    #[serde(rename = "sourceAccountId")]
10621    #[validate(length(min = 1u64))]
10622    pub source_account_id: String,
10623    /// - Example: `"U463756".to_string()`
10624    #[serde(rename = "targetAccountId")]
10625    #[validate(length(min = 1u64))]
10626    pub target_account_id: String,
10627    /// If tradeDate is provided then settleDate is also required
10628    /// - Example: `Some("2025-02-17".to_string())`
10629    #[serde(rename = "tradeDate")]
10630    pub trade_date: Option<String>,
10631    #[serde(rename = "tradingInstrument")]
10632    pub trading_instrument: TradingInstrument,
10633    /// If transferPrice is provided then tradeDate and settleDate are also required
10634    /// - Example: `Some(123.0)`
10635    /// Validation: Must be a multiple of 1e-9
10636    #[serde(rename = "transferPrice")]
10637    pub transfer_price: Option<f64>,
10638    /// - Example: `100.0`
10639    #[serde(rename = "transferQuantity")]
10640    pub transfer_quantity: f64,
10641}
10642/// Instructs IB to discard cached portfolio positions for a given account, so that the next request for positions delivers freshly obtained data.
10643#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
10644pub struct InvalidatePositionCacheRequest {
10645    #[validate(nested)]
10646    pub path: InvalidatePositionCacheRequestPath,
10647}
10648impl InvalidatePositionCacheRequest {
10649    /// Parse the HTTP response into the response enum.
10650    pub async fn parse_response(
10651        req: reqwest::Response,
10652    ) -> anyhow::Result<InvalidatePositionCacheResponse> {
10653        let status = req.status();
10654        if status == http::StatusCode::OK {
10655            let data = oas3_gen_support::Diagnostics::<MessageResponse>::json_with_diagnostics(req)
10656                .await?;
10657            return Ok(InvalidatePositionCacheResponse::Ok(data));
10658        }
10659        if status == http::StatusCode::BAD_REQUEST {
10660            let _ = req.bytes().await?;
10661            return Ok(InvalidatePositionCacheResponse::BadRequest);
10662        }
10663        if status == http::StatusCode::UNAUTHORIZED {
10664            let _ = req.bytes().await?;
10665            return Ok(InvalidatePositionCacheResponse::Unauthorized);
10666        }
10667        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
10668            let _ = req.bytes().await?;
10669            return Ok(InvalidatePositionCacheResponse::InternalServerError);
10670        }
10671        if status == http::StatusCode::SERVICE_UNAVAILABLE {
10672            let _ = req.bytes().await?;
10673            return Ok(InvalidatePositionCacheResponse::ServiceUnavailable);
10674        }
10675        let _ = req.bytes().await?;
10676        return Ok(InvalidatePositionCacheResponse::Unknown);
10677    }
10678}
10679#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
10680pub struct InvalidatePositionCacheRequestPath {
10681    /// Account ID whose cached portfolio positions will be discarded.
10682    /// - Example: `"DU123456".to_string()`
10683    #[validate(length(min = 1u64))]
10684    pub account_id: String,
10685}
10686/// Response types for invalidatePositionCache
10687#[derive(Debug, Clone)]
10688pub enum InvalidatePositionCacheResponse {
10689    ///200: status of invalidation
10690    Ok(MessageResponse),
10691    ///400: Invalid input format or missing required fields
10692    BadRequest,
10693    ///401: Invalid or expired access token
10694    Unauthorized,
10695    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
10696     */
10697    InternalServerError,
10698    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
10699     */
10700    ServiceUnavailable,
10701    ///default: Unknown response
10702    Unknown,
10703}
10704#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10705pub struct InvestDivest200Response {
10706    /// Request identifier to uniquely track a request.
10707    /// - Example: `Some("540607".to_string())`
10708    #[serde(rename = "reqID")]
10709    pub req_id: Option<String>,
10710    /// Describes if the model is in polling mode.
10711    #[serde(rename = "subscriptionStatus")]
10712    pub subscription_status: Option<i32>,
10713}
10714#[serde_with::skip_serializing_none]
10715#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
10716pub struct InvestDivestRequestBody {
10717    /// Collection of accounts to invest in a model.
10718    #[serde(rename = "accountList")]
10719    pub account_list: Option<Vec<InvestDivestRequestBodyAccountList>>,
10720    /// Define the model to invest accounts into.
10721    pub model: Option<String>,
10722    /// Request identifier to uniquely track a request.
10723    #[serde(rename = "reqID")]
10724    pub req_id: Option<i32>,
10725}
10726#[serde_with::skip_serializing_none]
10727#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
10728pub struct InvestDivestRequestBodyAccountList {
10729    /// Account identifier to invest.
10730    pub account: Option<String>,
10731    /// Amount of cash to invest in the model from the account.
10732    #[serde(rename = "amtToInvest")]
10733    pub amt_to_invest: Option<f64>,
10734}
10735/// Object containing the requested historical data and related metadata.
10736#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10737#[serde(default)]
10738pub struct IserverHistoryBidAskResponse {
10739    /// The client-specified bar width, represented in seconds.
10740    #[serde(rename = "barLength")]
10741    pub bar_length: Option<i32>,
10742    /// Internal use. UTC datetime string used to center Client Portal charts. Format YYYYMMDD-hh:mm:ss.
10743    #[serde(rename = "chartPanStartTime")]
10744    pub chart_pan_start_time: Option<String>,
10745    /// Array containing OHLC bars for the requested period.
10746    pub data: Option<Vec<SingleHistoricalBarBidAsk>>,
10747    /// Indicates how the period is applied in relation to the startTime. Value will always be -1, indicating that the period extends from the startTime forward into the future.
10748    #[default(Some(-1i32))]
10749    pub direction: Option<i32>,
10750    /// Internal use. Delivers highest price value in total interval. Used for chart scaling. A string constructed as 'highestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
10751    pub high: Option<String>,
10752    /// Internal use. Delivers lowest price value in total interval. Used for chart scaling. A string constructed as 'lowestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
10753    pub low: Option<String>,
10754    /// A three-character string reflecting the nature of available data. R = Realtime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed. P = Snapshot, p = Consolidated. B = Top of book.
10755    #[serde(rename = "mdAvailability")]
10756    pub md_availability: Option<String>,
10757    /// Internal use. Reflects the version of the response schema used.
10758    #[serde(rename = "messageVersion")]
10759    pub message_version: Option<i32>,
10760    /// Number of milliseconds taken to satisfy this historical data request.
10761    #[serde(rename = "mktDataDelay")]
10762    pub mkt_data_delay: Option<i32>,
10763    /// Indicates whether instrument is capable of negative pricing.
10764    #[serde(rename = "negativeCapable")]
10765    pub negative_capable: Option<bool>,
10766    /// Indicates whether data from outside regular trading hours is included in the response.
10767    #[serde(rename = "outsideRth")]
10768    pub outside_rth: Option<bool>,
10769    /// Count of the number of bars returned in the data array.
10770    pub points: Option<i32>,
10771    /// Internal use. Governs application of pricing display rule.
10772    #[serde(rename = "priceDisplayRule")]
10773    pub price_display_rule: Option<i32>,
10774    /// Internal use. Governs rendering of displayed pricing.
10775    #[serde(rename = "priceDisplayValue")]
10776    pub price_display_value: Option<String>,
10777    /// Internal use. Used to scale Client Portal chart Y-axis.
10778    #[serde(rename = "priceFactor")]
10779    pub price_factor: Option<i32>,
10780    /// Internal use. Identifier of the request.
10781    #[serde(rename = "serverId")]
10782    pub server_id: Option<String>,
10783    /// UTC date and time of the start (chronologically earlier) of the complete period in format YYYYMMDD-hh:mm:ss.
10784    #[serde(rename = "startTime")]
10785    pub start_time: Option<String>,
10786    /// Symbol of the request instrument.
10787    pub symbol: Option<String>,
10788    /// Description or company name of the instrument.
10789    pub text: Option<String>,
10790    /// The client-specified period value.
10791    #[serde(rename = "timePeriod")]
10792    pub time_period: Option<String>,
10793    /// Length of instrument's trading day in seconds.
10794    #[serde(rename = "tradingDayDuration")]
10795    pub trading_day_duration: Option<i32>,
10796    /// Internal time in flight to serve the request.
10797    #[serde(rename = "travelTime")]
10798    pub travel_time: Option<i32>,
10799    /// Internal use. Used to scale volume histograms.
10800    #[serde(rename = "volumeFactor")]
10801    pub volume_factor: Option<i32>,
10802}
10803/// Object containing the requested historical data and related metadata.
10804#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10805#[serde(default)]
10806pub struct IserverHistoryLastResponse {
10807    /// The client-specified bar width, represented in seconds.
10808    #[serde(rename = "barLength")]
10809    pub bar_length: Option<i32>,
10810    /// Internal use. UTC datetime string used to center Client Portal charts. Format YYYYMMDD-hh:mm:ss.
10811    #[serde(rename = "chartPanStartTime")]
10812    pub chart_pan_start_time: Option<String>,
10813    /// Array containing OHLC bars for the requested period.
10814    pub data: Option<Vec<SingleHistoricalBarLast>>,
10815    /// Indicates how the period is applied in relation to the startTime. Value will always be -1, indicating that the period extends from the startTime forward into the future.
10816    #[default(Some(-1i32))]
10817    pub direction: Option<i32>,
10818    /// Internal use. Delivers highest price value in total interval. Used for chart scaling. A string constructed as 'highestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
10819    pub high: Option<String>,
10820    /// Internal use. Delivers lowest price value in total interval. Used for chart scaling. A string constructed as 'lowestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
10821    pub low: Option<String>,
10822    /// A three-character string reflecting the nature of available data. R = Realtime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed. P = Snapshot, p = Consolidated. B = Top of book.
10823    #[serde(rename = "mdAvailability")]
10824    pub md_availability: Option<String>,
10825    /// Internal use. Reflects the version of the response schema used.
10826    #[serde(rename = "messageVersion")]
10827    pub message_version: Option<i32>,
10828    /// Number of milliseconds taken to satisfy this historical data request.
10829    #[serde(rename = "mktDataDelay")]
10830    pub mkt_data_delay: Option<i32>,
10831    /// Indicates whether instrument is capable of negative pricing.
10832    #[serde(rename = "negativeCapable")]
10833    pub negative_capable: Option<bool>,
10834    /// Indicates whether data from outside regular trading hours is included in the response.
10835    #[serde(rename = "outsideRth")]
10836    pub outside_rth: Option<bool>,
10837    /// Count of the number of bars returned in the data array.
10838    pub points: Option<i32>,
10839    /// Internal use. Governs application of pricing display rule.
10840    #[serde(rename = "priceDisplayRule")]
10841    pub price_display_rule: Option<i32>,
10842    /// Internal use. Governs rendering of displayed pricing.
10843    #[serde(rename = "priceDisplayValue")]
10844    pub price_display_value: Option<String>,
10845    /// Internal use. Used to scale Client Portal chart Y-axis.
10846    #[serde(rename = "priceFactor")]
10847    pub price_factor: Option<i32>,
10848    /// Internal use. Identifier of the request.
10849    #[serde(rename = "serverId")]
10850    pub server_id: Option<String>,
10851    /// UTC date and time of the start (chronologically earlier) of the complete period in format YYYYMMDD-hh:mm:ss.
10852    #[serde(rename = "startTime")]
10853    pub start_time: Option<String>,
10854    /// Symbol of the request instrument.
10855    pub symbol: Option<String>,
10856    /// Description or company name of the instrument.
10857    pub text: Option<String>,
10858    /// The client-specified period value.
10859    #[serde(rename = "timePeriod")]
10860    pub time_period: Option<String>,
10861    /// Length of instrument's trading day in seconds.
10862    #[serde(rename = "tradingDayDuration")]
10863    pub trading_day_duration: Option<i32>,
10864    /// Internal time in flight to serve the request.
10865    #[serde(rename = "travelTime")]
10866    pub travel_time: Option<i32>,
10867    /// Internal use. Used to scale volume histograms.
10868    #[serde(rename = "volumeFactor")]
10869    pub volume_factor: Option<i32>,
10870}
10871/// Object containing the requested historical data and related metadata.
10872#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10873#[serde(default)]
10874pub struct IserverHistoryMidpointResponse {
10875    /// The client-specified bar width, represented in seconds.
10876    #[serde(rename = "barLength")]
10877    pub bar_length: Option<i32>,
10878    /// Internal use. UTC datetime string used to center Client Portal charts. Format YYYYMMDD-hh:mm:ss.
10879    #[serde(rename = "chartPanStartTime")]
10880    pub chart_pan_start_time: Option<String>,
10881    /// Array containing OHLC bars for the requested period.
10882    pub data: Option<Vec<SingleHistoricalBarMidpoint>>,
10883    /// Indicates how the period is applied in relation to the startTime. Value will always be -1, indicating that the period extends from the startTime forward into the future.
10884    #[default(Some(-1i32))]
10885    pub direction: Option<i32>,
10886    /// Internal use. Delivers highest price value in total interval. Used for chart scaling. A string constructed as 'highestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
10887    pub high: Option<String>,
10888    /// Internal use. Delivers lowest price value in total interval. Used for chart scaling. A string constructed as 'lowestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
10889    pub low: Option<String>,
10890    /// A three-character string reflecting the nature of available data. R = Realtime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed. P = Snapshot, p = Consolidated. B = Top of book.
10891    #[serde(rename = "mdAvailability")]
10892    pub md_availability: Option<String>,
10893    /// Internal use. Reflects the version of the response schema used.
10894    #[serde(rename = "messageVersion")]
10895    pub message_version: Option<i32>,
10896    /// Number of milliseconds taken to satisfy this historical data request.
10897    #[serde(rename = "mktDataDelay")]
10898    pub mkt_data_delay: Option<i32>,
10899    /// Indicates whether instrument is capable of negative pricing.
10900    #[serde(rename = "negativeCapable")]
10901    pub negative_capable: Option<bool>,
10902    /// Indicates whether data from outside regular trading hours is included in the response.
10903    #[serde(rename = "outsideRth")]
10904    pub outside_rth: Option<bool>,
10905    /// Count of the number of bars returned in the data array.
10906    pub points: Option<i32>,
10907    /// Internal use. Governs application of pricing display rule.
10908    #[serde(rename = "priceDisplayRule")]
10909    pub price_display_rule: Option<i32>,
10910    /// Internal use. Governs rendering of displayed pricing.
10911    #[serde(rename = "priceDisplayValue")]
10912    pub price_display_value: Option<String>,
10913    /// Internal use. Used to scale Client Portal chart Y-axis.
10914    #[serde(rename = "priceFactor")]
10915    pub price_factor: Option<i32>,
10916    /// Internal use. Identifier of the request.
10917    #[serde(rename = "serverId")]
10918    pub server_id: Option<String>,
10919    /// UTC date and time of the start (chronologically earlier) of the complete period in format YYYYMMDD-hh:mm:ss.
10920    #[serde(rename = "startTime")]
10921    pub start_time: Option<String>,
10922    /// Symbol of the request instrument.
10923    pub symbol: Option<String>,
10924    /// Description or company name of the instrument.
10925    pub text: Option<String>,
10926    /// The client-specified period value.
10927    #[serde(rename = "timePeriod")]
10928    pub time_period: Option<String>,
10929    /// Length of instrument's trading day in seconds.
10930    #[serde(rename = "tradingDayDuration")]
10931    pub trading_day_duration: Option<i32>,
10932    /// Internal time in flight to serve the request.
10933    #[serde(rename = "travelTime")]
10934    pub travel_time: Option<i32>,
10935    /// Internal use. Used to scale volume histograms.
10936    #[serde(rename = "volumeFactor")]
10937    pub volume_factor: Option<i32>,
10938}
10939#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10940pub struct IserverScannerParams {
10941    pub filter_list: Option<Vec<IserverScannerParamsFilterList>>,
10942    /// Contains all values relevant to the scanner "instrument" request field.
10943    pub instrument_list: Option<Vec<IserverScannerParamsInstrumentList>>,
10944    /// Contains all values relevant to the location field of the market scanner request.
10945    pub location_tree: Option<Vec<IserverScannerParamsLocationTree>>,
10946    /// Contains all values used as the scanner "type" in the request.
10947    pub scan_type_list: Option<Vec<IserverScannerParamsScanTypeList>>,
10948}
10949#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10950pub struct IserverScannerParamsFilterList {
10951    /// Value used for the market scanner request.
10952    pub code: Option<String>,
10953    /// combo values when type equals to combo
10954    pub combo_values: Option<Vec<IserverScannerParamsFilterListComboValue>>,
10955    /// Returns the human-readable identifier for the filter.
10956    pub display_name: Option<String>,
10957    /// Returns the group of filters the request is affiliated with.
10958    pub group: Option<String>,
10959    /// Returns the type of value to be used in the request. This can indicate a range based value, or if it should be a single value.
10960    #[serde(rename = "type")]
10961    pub r#type: Option<String>,
10962}
10963#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10964pub struct IserverScannerParamsFilterListComboValue {
10965    pub default: Option<bool>,
10966    pub vendor: Option<serde_json::Value>,
10967}
10968#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10969pub struct IserverScannerParamsInstrumentList {
10970    /// Human readable representation of the instrument type.
10971    pub display_name: Option<String>,
10972    /// Returns an array of all filters uniquely avaliable to that instrument type.
10973    pub filters: Option<Vec<serde_json::Value>>,
10974    /// Value used for the market scanner request.
10975    #[serde(rename = "type")]
10976    pub r#type: Option<String>,
10977}
10978#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10979pub struct IserverScannerParamsLocationTree {
10980    /// Returns the overarching instrument type to designate the location.
10981    pub display_name: Option<String>,
10982    pub locations: Option<Vec<IserverScannerParamsLocationTreeLocation>>,
10983    /// Returns the code value of the market scanner instrument type value.
10984    #[serde(rename = "type")]
10985    pub r#type: Option<String>,
10986}
10987#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10988pub struct IserverScannerParamsLocationTreeLocation {
10989    /// Returns the human-readable value of the market scanner's location value.
10990    pub display_name: Option<String>,
10991    pub locations: Option<Vec<IserverScannerParamsLocationTreeLocationLocation>>,
10992    /// Returns the code value of the market scanner location value.
10993    #[serde(rename = "type")]
10994    pub r#type: Option<String>,
10995}
10996#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
10997pub struct IserverScannerParamsLocationTreeLocationLocation {
10998    pub display_name: Option<String>,
10999    #[serde(rename = "type")]
11000    pub r#type: Option<String>,
11001}
11002#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11003pub struct IserverScannerParamsScanTypeList {
11004    /// Value used for the market scanner request.
11005    pub code: Option<String>,
11006    /// Human readable name for the scanner "type"
11007    pub display_name: Option<String>,
11008    /// Returns all instruments the scanner type can be used with.
11009    pub instruments: Option<Vec<serde_json::Value>>,
11010}
11011#[serde_with::skip_serializing_none]
11012#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
11013pub struct IserverScannerRunRequest {
11014    /// Contains any additional filters that should apply to response.
11015    pub filter: Option<Vec<IserverScannerRunRequestFilter>>,
11016    /// Instrument type as the target of the market scanner request. Found in the "instrument_list" section of the /iserver/scanner/params response.
11017    pub instrument: Option<String>,
11018    /// Location value the market scanner is searching through. Based on the "location_tree" section of the /iserver/scanner/params response.
11019    pub location: Option<String>,
11020    /// Scanner value the market scanner is sorted by. Based on the "scan_type_list" section of the /iserver/scanner/params response.
11021    #[serde(rename = "type")]
11022    pub r#type: Option<String>,
11023}
11024#[serde_with::skip_serializing_none]
11025#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
11026pub struct IserverScannerRunRequestFilter {
11027    /// Code value of the filter. Based on the "code" value within the "filter_list" section of the /iserver/scanner/params response.
11028    pub code: Option<String>,
11029    /// Value corresponding to the input for "code".
11030    pub value: Option<IserverScannerRunRequestFilterValue>,
11031}
11032/// Value corresponding to the input for "code".
11033#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
11034#[serde(untagged)]
11035pub enum IserverScannerRunRequestFilterValue {
11036    #[default]
11037    String(String),
11038    Integer(i32),
11039    Boolean(bool),
11040    Number(f64),
11041}
11042#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11043pub struct IserverScannerRunResponse {
11044    /// Contains contracts related to the market scanner request.
11045    pub contracts: Option<Vec<IserverScannerRunResponseContract>>,
11046    /// Internal Use Only
11047    pub scan_data_column_name: Option<String>,
11048}
11049#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11050pub struct IserverScannerRunResponseContract {
11051    /// Internal Use Only
11052    pub available_chart_periods: Option<String>,
11053    /// Always returned for the first contract.
11054    pub column_name: Option<String>,
11055    /// Returns the company long name.
11056    pub company_name: Option<String>,
11057    /// Returns the contract ID of the contract.
11058    pub con_id: Option<i32>,
11059    /// Returns the contract ID of the contract.
11060    pub conidex: Option<String>,
11061    /// For derivatives like Futures, the local symbol of the contract will be returned.
11062    pub contract_description_1: Option<String>,
11063    /// Returns the primary listing exchange of the contract.
11064    pub listing_exchange: Option<String>,
11065    /// Returns the security type of the contract.
11066    pub sec_type: Option<String>,
11067    /// Contract's index in relation to the market scanner type's sorting priority.
11068    pub server_id: Option<String>,
11069    /// Returns the contract's ticker symbol.
11070    pub symbol: Option<String>,
11071}
11072/// Returns an object for each conId requested.
11073pub type IserverSnapshot = Vec<IserverSnapshotKind>;
11074#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11075#[serde(untagged)]
11076pub enum IserverSnapshotKind {
11077    #[default]
11078    Variant0(serde_json::Value),
11079}
11080/// Contains objects reflecting all currencies in which the account's positions trade.
11081#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11082pub struct Ledger {
11083    /// Additional properties not defined in the schema.
11084    #[serde(flatten)]
11085    pub additional_properties: std::collections::HashMap<String, serde_json::Value>,
11086}
11087#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11088pub struct LiveOrdersResponse {
11089    /// Array of orders that are currently working, or were filled/cancelled in the current brokerage session.
11090    pub orders: Option<Vec<LiveOrdersResponseOrder>>,
11091    /// Whether the response is a snapshot.
11092    pub snapshot: Option<bool>,
11093}
11094/// Object representing one order.
11095#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11096pub struct LiveOrdersResponseOrder {
11097    /// IB account ID to which the order was placed.
11098    pub account: Option<String>,
11099    /// IB account ID to which the order was placed.
11100    pub acct: Option<String>,
11101    /// Average price of fills against the order, if any.
11102    #[serde(rename = "avgPrice")]
11103    pub avg_price: Option<String>,
11104    /// Internal use. IB's UI background color in hex.
11105    #[serde(rename = "bgColor")]
11106    pub bg_color: Option<String>,
11107    /// Currency of the order ticket's Cash Quantity, if applicable.
11108    #[serde(rename = "cashCcy")]
11109    pub cash_ccy: Option<String>,
11110    /// Name of business associated with instrument, or otherwise description of instrument.
11111    #[serde(rename = "companyName")]
11112    pub company_name: Option<String>,
11113    /// Contract ID of the order's instrument.
11114    pub conid: Option<String>,
11115    /// Contract ID and routing destination in format 123456@EXCHANGE.
11116    pub conidex: Option<String>,
11117    /// Descriptive text, or additional details that specific the instrument.
11118    pub description1: Option<String>,
11119    /// Only present for derivatives. Shows Expiry, Strike, Right, And Exchange information.
11120    pub description2: Option<String>,
11121    /// Routing destination of the order ticket.
11122    pub exchange: Option<String>,
11123    /// Internal use. IB's UI foreground color in hex.
11124    #[serde(rename = "fgColor")]
11125    pub fg_color: Option<String>,
11126    /// Quantity filled in units of the instrument.
11127    #[serde(rename = "filledQuantity")]
11128    pub filled_quantity: Option<String>,
11129    /// Indicates whether the order ticket is an Event Trading order.
11130    #[serde(rename = "isEventTrading")]
11131    pub is_event_trading: Option<AlertActivationRequestAlertActive>,
11132    /// Time of last execution against the order in format YYMMDDhhmmss.
11133    #[serde(rename = "lastExecutionTime")]
11134    pub last_execution_time: Option<String>,
11135    /// Unix timestamp of the last execution against the order.
11136    #[serde(rename = "lastExecutionTime_r")]
11137    pub last_execution_time_r: Option<String>,
11138    /// Exchange on which the instrument is listed.
11139    #[serde(rename = "listingExchange")]
11140    pub listing_exchange: Option<String>,
11141    /// Human-readable shorthand rendering of the order ticket.
11142    #[serde(rename = "orderDesc")]
11143    pub order_desc: Option<String>,
11144    /// IB-assigned order identifier.
11145    #[serde(rename = "orderId")]
11146    pub order_id: Option<i32>,
11147    /// Order type of a working order ticket.
11148    #[serde(rename = "orderType")]
11149    pub order_type: Option<String>,
11150    /// Only present for Cancelled orders. Provides the reason for order to have been cancelled or rejected by the system.
11151    pub order_cancellation_by_system_reason: Option<String>,
11152    /// IB internal order status.
11153    pub order_ccp_status: Option<String>,
11154    /// Order type of a filled order.
11155    #[serde(rename = "origOrderType")]
11156    pub orig_order_type: Option<String>,
11157    /// Price of the order, if applicable to the order type.
11158    pub price: Option<String>,
11159    /// Quantity remaining to be filled in units of the instrument.
11160    #[serde(rename = "remainingQuantity")]
11161    pub remaining_quantity: Option<String>,
11162    /// Asset class of the instrument.
11163    #[serde(rename = "secType")]
11164    pub sec_type: Option<String>,
11165    /// Side of the order.
11166    pub side: Option<String>,
11167    /// Human-readable shorthand rendering of the filled and total quantities of the order.
11168    #[serde(rename = "sizeAndFills")]
11169    pub size_and_fills: Option<String>,
11170    /// Status of the order ticket.
11171    pub status: Option<OrderStatusOrderStatus>,
11172    /// Indicates whether the order is supported by IB's Tax Optimization tool.
11173    #[serde(rename = "supportsTaxOpt")]
11174    pub supports_tax_opt: Option<AlertActivationRequestAlertActive>,
11175    /// Tax Optimizer id, identifies set of tax lots selected, for gains and losses management.
11176    #[serde(rename = "taxOptimizerId")]
11177    pub tax_optimizer_id: Option<String>,
11178    /// Symbol or base product code of the instrument.
11179    pub ticker: Option<String>,
11180    /// Time of force of the order.
11181    #[serde(rename = "timeInForce")]
11182    pub time_in_force: Option<String>,
11183    /// Total size of a cash quantity order.
11184    #[serde(rename = "totalCashSize")]
11185    pub total_cash_size: Option<String>,
11186    /// Total size of an order in the instrument's units.
11187    #[serde(rename = "totalSize")]
11188    pub total_size: Option<String>,
11189}
11190#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11191pub struct LiveSessionToken200Response {
11192    /// Diffie-Hellman challenge value used to compute live session token locally by client.
11193    pub diffie_hellman_challenge: Option<String>,
11194    /// Unix timestamp in milliseconds of time of live session token computation by IB. Live session tokens are valid for 24 hours from this time.
11195    pub live_session_token_expiration: Option<i32>,
11196    /// Signature value used to validate successful client-side computation of live session token.
11197    pub live_session_token_signature: Option<String>,
11198}
11199#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11200pub struct LoginMessage {
11201    #[serde(rename = "contentId")]
11202    pub content_id: Option<i32>,
11203    pub description: Option<String>,
11204    pub id: Option<i32>,
11205    #[serde(rename = "messageType")]
11206    pub message_type: Option<String>,
11207    #[serde(rename = "recordDate")]
11208    pub record_date: Option<chrono::DateTime<chrono::Utc>>,
11209    pub state: Option<String>,
11210    pub tasks: Option<Vec<i32>>,
11211    pub username: Option<String>,
11212}
11213#[serde_with::skip_serializing_none]
11214#[derive(
11215    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
11216)]
11217pub struct LoginMessageRequest {
11218    #[serde(rename = "endDate")]
11219    pub end_date: chrono::NaiveDate,
11220    #[validate(range(min = 1i32, max = 1_000i32))]
11221    pub limit: Option<i32>,
11222    #[validate(range(min = 0i32))]
11223    pub offset: Option<i32>,
11224    #[serde(rename = "startDate")]
11225    pub start_date: chrono::NaiveDate,
11226    pub status: Option<RequestStatus>,
11227    #[serde(rename = "type")]
11228    pub r#type: Option<String>,
11229}
11230#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11231pub struct LoginMessageResponse {
11232    #[serde(rename = "accountId")]
11233    pub account_id: Option<String>,
11234    #[serde(rename = "clearingStatus")]
11235    pub clearing_status: Option<String>,
11236    #[serde(rename = "clearingStatusDescription")]
11237    pub clearing_status_description: Option<String>,
11238    #[serde(rename = "loginMessagePresent")]
11239    pub login_message_present: Option<bool>,
11240    #[serde(rename = "loginMessages")]
11241    pub login_messages: Option<Vec<LoginMessage>>,
11242}
11243/// Logs the user out of the gateway session. Any further activity requires re-authentication. Discard client-side cookies upon logout.
11244#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
11245pub struct LogoutRequest {}
11246impl LogoutRequest {
11247    /// Parse the HTTP response into the response enum.
11248    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<LogoutResponse> {
11249        let status = req.status();
11250        if status == http::StatusCode::OK {
11251            let data = oas3_gen_support::Diagnostics::<StatusResponse4>::json_with_diagnostics(req)
11252                .await?;
11253            return Ok(LogoutResponse::Ok(data));
11254        }
11255        if status == http::StatusCode::UNAUTHORIZED {
11256            let _ = req.bytes().await?;
11257            return Ok(LogoutResponse::Unauthorized);
11258        }
11259        let _ = req.bytes().await?;
11260        return Ok(LogoutResponse::Unknown);
11261    }
11262}
11263/// Response types for logout
11264#[derive(Debug, Clone)]
11265pub enum LogoutResponse {
11266    ///200: An array of objects detailing contract information.
11267    Ok(StatusResponse4),
11268    ///401: Invalid or expired access token
11269    Unauthorized,
11270    ///default: Unknown response
11271    Unknown,
11272}
11273/// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
11274///   * `31` - Last Price. The last price at which the contract traded. May contain one of the following prefixes: C - Previous day's closing price. H - Trading has halted.
11275///   * `55` - Symbol.
11276///   * `58` - Text.
11277///   * `70` - High. Current day high price
11278///   * `71` - Low. Current day low price
11279///   * `73` - Market Value. The current market value of your position in the security. Market Value is calculated with real time market data (even when not subscribed to market data).
11280///   * `74` - Avg Price. The average price of the position.
11281///   * `75` - Unrealized PnL. Unrealized profit or loss. Unrealized PnL is calculated with real time market data (even when not subscribed to market data).
11282///   * `76` - Formatted position.
11283///   * `77` - Formatted Unrealized PnL.
11284///   * `78` - Daily PnL. Your profit or loss of the day since prior close. Daily PnL is calculated with real time market data (even when not subscribed to market data).
11285///   * `79` - Realized PnL. Realized profit or loss. Realized PnL is calculated with real time market data (even when not subscribed to market data).
11286///   * `80` - Unrealized PnL %. Unrealized profit or loss expressed in percentage.
11287///   * `82` - Change. The difference between the last price and the close on the previous trading day
11288///   * `83` - Change %. The difference between the last price and the close on the previous trading day in percentage.
11289///   * `84` - Bid Price. The highest-priced bid on the contract.
11290///   * `85` - Ask Size. The number of contracts or shares offered at the ask price. For US stocks
11291///   * `86` - Ask Price. The lowest-priced offer on the contract.
11292///   * `87` - Volume. Volume for the day
11293///   * `88` - Bid Size. The number of contracts or shares bid for at the bid price. For US stocks
11294///   * `201` - Right. Declares the Right of the Option, Call or Put.
11295///   * `6004` - Exchange.
11296///   * `6008` - Conid. Contract identifier from IBKR's database.
11297///   * `6070` - SecType. The asset class of the instrument.
11298///   * `6072` - Months.
11299///   * `6073` - Regular Expiry.
11300///   * `6119` - Marker for market data delivery method (similar to request id).
11301///   * `6457` - Underlying Conid. Use /trsrv/secdef to get more information about the security.
11302///   * `6508` - Service Params..
11303///   * `6509` - Market Data Availability. The field may contain three chars. First char defines: R = RealTime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed, i - incomplete, v - VDR Exempt (Vendor Display Rule 603c). Second char defines: P = Snapshot, p = Consolidated. Third char defines: B = Book. RealTime Data is relayed back in real time without delay, market data subscription(s) are required. Delayed - Data is relayed back 15-20 min delayed. Frozen - Last recorded data at market close.  relayed back in real time. Frozen Delayed - Last recorded data at market close, relayed back delayed. Not Subscribed - User does not have the required market data subscription(s) to relay back either real time or delayed data. Snapshot - Snapshot request is available for contract. Consolidated - Market data is aggregated across multiple exchanges or venues. Book - Top of the book data is available for contract.
11304///   * `7051` - Company name.
11305///   * `7057` - Ask Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
11306///   * `7058` - Last Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
11307///   * `7059` - Last Size. The number of unites traded at the last price
11308///   * `7068` - Bid Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
11309///   * `7084` - Implied Vol./Hist. Vol %. The ratio of the implied volatility over the historical volatility, expressed as a percentage.
11310///   * `7085` - Put/Call Interest. Put option open interest/call option open interest for the trading day.
11311///   * `7086` - Put/Call Volume. Put option volume/call option volume for the trading day.
11312///   * `7087` - Hist. Vol. %. 30-day real-time historical volatility.
11313///   * `7088` - Hist. Vol. Close %. Shows the historical volatility based on previous close price.
11314///   * `7089` - Opt. Volume. Option Volume
11315///   * `7094` - Conid + Exchange.
11316///   * `7184` - canBeTraded. If contract is a trade-able instrument. Returns 1(true) or 0(false).
11317///   * `7219` - Contract Description.
11318///   * `7220` - Contract Description.
11319///   * `7221` - Listing Exchange.
11320///   * `7280` - Industry. Displays the type of industry under which the underlying company can be categorized.
11321///   * `7281` - Category. Displays a more detailed level of description within the industry under which the underlying company can be categorized.
11322///   * `7282` - Average Volume. The average daily trading volume over 90 days.
11323///   * `7283` - Option Implied Vol. %. A prediction of how volatile an underlying will be in the future.At the market volatility estimated for a maturity thirty calendar days forward of the current trading day, and based on option prices from two consecutive expiration months. To query the Implied Vol. % of a specific strike refer to field 7633.
11324///   * `7284` - Historical volatility %. Deprecated
11325///   * `7285` - Put/Call Ratio.
11326///   * `7292` - Cost Basis. Your current position in this security multiplied by the average price and multiplier.
11327///   * `7293` - 52 Week High. The highest price for the past 52 weeks.
11328///   * `7294` - 52 Week Low. The lowest price for the past 52 weeks.
11329///   * `7295` - Open. Today's opening price.
11330///   * `7296` - Close. Today's closing price.
11331///   * `7308` - Delta. The ratio of the change in the price of the option to the corresponding change in the price of the underlying.
11332///   * `7309` - Gamma. The rate of change for the delta with respect to the underlying asset's price.
11333///   * `7310` - Theta. A measure of the rate of decline the value of an option due to the passage of time.
11334///   * `7311` - Vega. The amount that the price of an option changes compared to a 1% change in the volatility.
11335///   * `7607` - Opt. Volume Change %. Today's option volume as a percentage of the average option volume.
11336///   * `7633` - Implied Vol. %. The implied volatility for the specific strike of the option in percentage. To query the Option Implied Vol. % from the underlying refer to field 7283.
11337///   * `7635` - Mark. The mark price is
11338///   * `7636` - Shortable Shares. Number of shares available for shorting.
11339///   * `7637` - Fee Rate. Interest rate charged on borrowed shares.
11340///   * `7638` - Option Open Interest.
11341///   * `7639` - % of Mark Value. Displays the market value of the contract as a percentage of the total market value of the account. Mark Value is calculated with real time market data (even when not subscribed to market data).
11342///   * `7644` - Shortable. Describes the level of difficulty with which the security can be sold short.
11343///   * `7671` - Dividends. This value is the total of the expected dividend payments over the next twelve months per share.
11344///   * `7672` - Dividends TTM. This value is the total of the expected dividend payments over the last twelve months per share.
11345///   * `7674` - EMA(200). Exponential moving average (N=200).
11346///   * `7675` - EMA(100). Exponential moving average (N=100).
11347///   * `7676` - EMA(50). Exponential moving average (N=50).
11348///   * `7677` - EMA(20). Exponential moving average (N=20).
11349///   * `7678` - Price/EMA(200). Price to Exponential moving average (N=200) ratio -1
11350///   * `7679` - Price/EMA(100). Price to Exponential moving average (N=100) ratio -1
11351///   * `7724` - Price/EMA(50). Price to Exponential moving average (N=50) ratio -1
11352///   * `7681` - Price/EMA(20). Price to Exponential moving average (N=20) ratio -1
11353///   * `7682` - Change Since Open. The difference between the last price and the open price.
11354///   * `7683` - Upcoming Event. Shows the next major company event. Requires Wall Street Horizon subscription.
11355///   * `7684` - Upcoming Event Date. The date of the next major company event. Requires Wall Street Horizon subscription.
11356///   * `7685` - Upcoming Analyst Meeting. The date and time of the next scheduled analyst meeting. Requires Wall Street Horizon subscription.
11357///   * `7686` - Upcoming Earnings. The date and time of the next scheduled earnings/earnings call event. Requires Wall Street Horizon subscription.
11358///   * `7687` - Upcoming Misc Event. The date and time of the next shareholder meeting
11359///   * `7688` - Recent Analyst Meeting. The date and time of the most recent analyst meeting. Requires Wall Street Horizon subscription.
11360///   * `7689` - Recent Earnings. The date and time of the most recent earnings/earning call event. Requires Wall Street Horizon subscription.
11361///   * `7690` - Recent Misc Event. The date and time of the most recent shareholder meeting
11362///   * `7694` - Probability of Max Return. Customer implied probability of maximum potential gain.
11363///   * `7695` - Break Even. Break even points
11364///   * `7696` - SPX Delta. Beta Weighted Delta is calculated using the formula; Delta x dollar adjusted beta
11365///   * `7697` - Futures Open Interest. Total number of outstanding futures contracts
11366///   * `7698` - Last Yield. Implied yield of the bond if it is purchased at the current last price. Last yield is calculated using the Last price on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
11367///   * `7699` - Bid Yield. Implied yield of the bond if it is purchased at the current bid price. Bid yield is calculated using the Ask on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
11368///   * `7700` - Probability of Max Return. Customer implied probability of maximum potential gain.
11369///   * `7702` - Probability of Max Loss. Customer implied probability of maximum potential loss.
11370///   * `7703` - Profit Probability. Customer implied probability of any gain.
11371///   * `7704` - Organization Type.
11372///   * `7705` - Debt Class.
11373///   * `7706` - Ratings. Ratings issued for bond contract.
11374///   * `7707` - Bond State Code.
11375///   * `7708` - Bond Type.
11376///   * `7714` - Last Trading Date.
11377///   * `7715` - Issue Date.
11378///   * `7720` - Ask Yield. Implied yield of the bond if it is purchased at the current offer. Ask yield is calculated using the Bid on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
11379///   * `7741` - Prior Close. Yesterday's closing price
11380///   * `7762` - Volume Long. High precision volume for the day. For formatted volume refer to field 87.
11381///   * `7768` - hasTradingPermissions. if user has trading permissions for specified contract. Returns 1(true) or 0(false).
11382///   * `7899` - Stock Type. Determines the stock type. Includes: Common, CORP, ADR, ETF, ETN, EFN, REIT, CEF, ETMF.
11383///   * `7920` - Daily PnL Raw. Your profit or loss of the day since prior close. Daily PnL is calculated with real-time market data (even when not subscribed to market data).
11384///   * `7921` - Cost Basis Raw. Your current position in this security multiplied by the average price and and multiplier.
11385///   * `7943` - Rebate Rate. Fed funds or other currency-relevant Benchmark rate minus the interest rate charged on borrowed shares.
11386#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
11387pub enum MdFields {
11388    #[serde(rename = "31")]
11389    #[default]
11390    T31,
11391    #[serde(rename = "55")]
11392    T55,
11393    #[serde(rename = "58")]
11394    T58,
11395    #[serde(rename = "70")]
11396    T70,
11397    #[serde(rename = "71")]
11398    T71,
11399    #[serde(rename = "73")]
11400    T73,
11401    #[serde(rename = "74")]
11402    T74,
11403    #[serde(rename = "75")]
11404    T75,
11405    #[serde(rename = "76")]
11406    T76,
11407    #[serde(rename = "77")]
11408    T77,
11409    #[serde(rename = "78")]
11410    T78,
11411    #[serde(rename = "79")]
11412    T79,
11413    #[serde(rename = "80")]
11414    T80,
11415    #[serde(rename = "82")]
11416    T82,
11417    #[serde(rename = "83")]
11418    T83,
11419    #[serde(rename = "84")]
11420    T84,
11421    #[serde(rename = "85")]
11422    T85,
11423    #[serde(rename = "86")]
11424    T86,
11425    #[serde(rename = "87")]
11426    T87,
11427    #[serde(rename = "88")]
11428    T88,
11429    #[serde(rename = "6004")]
11430    T6004,
11431    #[serde(rename = "6008")]
11432    T6008,
11433    #[serde(rename = "6070")]
11434    T6070,
11435    #[serde(rename = "6072")]
11436    T6072,
11437    #[serde(rename = "6073")]
11438    T6073,
11439    #[serde(rename = "6119")]
11440    T6119,
11441    #[serde(rename = "6457")]
11442    T6457,
11443    #[serde(rename = "6508")]
11444    T6508,
11445    #[serde(rename = "6509")]
11446    T6509,
11447    #[serde(rename = "7051")]
11448    T7051,
11449    #[serde(rename = "7057")]
11450    T7057,
11451    #[serde(rename = "7058")]
11452    T7058,
11453    #[serde(rename = "7059")]
11454    T7059,
11455    #[serde(rename = "7068")]
11456    T7068,
11457    #[serde(rename = "7084")]
11458    T7084,
11459    #[serde(rename = "7085")]
11460    T7085,
11461    #[serde(rename = "7086")]
11462    T7086,
11463    #[serde(rename = "7087")]
11464    T7087,
11465    #[serde(rename = "7088")]
11466    T7088,
11467    #[serde(rename = "7089")]
11468    T7089,
11469    #[serde(rename = "7094")]
11470    T7094,
11471    #[serde(rename = "7184")]
11472    T7184,
11473    #[serde(rename = "7219")]
11474    T7219,
11475    #[serde(rename = "7220")]
11476    T7220,
11477    #[serde(rename = "7221")]
11478    T7221,
11479    #[serde(rename = "7280")]
11480    T7280,
11481    #[serde(rename = "7281")]
11482    T7281,
11483    #[serde(rename = "7282")]
11484    T7282,
11485    #[serde(rename = "7283")]
11486    T7283,
11487    #[serde(rename = "7284")]
11488    T7284,
11489    #[serde(rename = "7285")]
11490    T7285,
11491    #[serde(rename = "7292")]
11492    T7292,
11493    #[serde(rename = "7293")]
11494    T7293,
11495    #[serde(rename = "7294")]
11496    T7294,
11497    #[serde(rename = "7295")]
11498    T7295,
11499    #[serde(rename = "7296")]
11500    T7296,
11501    #[serde(rename = "7308")]
11502    T7308,
11503    #[serde(rename = "7309")]
11504    T7309,
11505    #[serde(rename = "7310")]
11506    T7310,
11507    #[serde(rename = "7311")]
11508    T7311,
11509    #[serde(rename = "7607")]
11510    T7607,
11511    #[serde(rename = "7633")]
11512    T7633,
11513    #[serde(rename = "7635")]
11514    T7635,
11515    #[serde(rename = "7636")]
11516    T7636,
11517    #[serde(rename = "7637")]
11518    T7637,
11519    #[serde(rename = "7638")]
11520    T7638,
11521    #[serde(rename = "7639")]
11522    T7639,
11523    #[serde(rename = "7644")]
11524    T7644,
11525    #[serde(rename = "7671")]
11526    T7671,
11527    #[serde(rename = "7672")]
11528    T7672,
11529    #[serde(rename = "7674")]
11530    T7674,
11531    #[serde(rename = "7675")]
11532    T7675,
11533    #[serde(rename = "7676")]
11534    T7676,
11535    #[serde(rename = "7677")]
11536    T7677,
11537    #[serde(rename = "7678")]
11538    T7678,
11539    #[serde(rename = "7679")]
11540    T7679,
11541    #[serde(rename = "7724")]
11542    T7724,
11543    #[serde(rename = "7681")]
11544    T7681,
11545    #[serde(rename = "7682")]
11546    T7682,
11547    #[serde(rename = "7683")]
11548    T7683,
11549    #[serde(rename = "7684")]
11550    T7684,
11551    #[serde(rename = "7685")]
11552    T7685,
11553    #[serde(rename = "7686")]
11554    T7686,
11555    #[serde(rename = "7687")]
11556    T7687,
11557    #[serde(rename = "7688")]
11558    T7688,
11559    #[serde(rename = "7689")]
11560    T7689,
11561    #[serde(rename = "7690")]
11562    T7690,
11563    #[serde(rename = "7694")]
11564    T7694,
11565    #[serde(rename = "7695")]
11566    T7695,
11567    #[serde(rename = "7696")]
11568    T7696,
11569    #[serde(rename = "7697")]
11570    T7697,
11571    #[serde(rename = "7698")]
11572    T7698,
11573    #[serde(rename = "7699")]
11574    T7699,
11575    #[serde(rename = "7700")]
11576    T7700,
11577    #[serde(rename = "7702")]
11578    T7702,
11579    #[serde(rename = "7703")]
11580    T7703,
11581    #[serde(rename = "7704")]
11582    T7704,
11583    #[serde(rename = "7705")]
11584    T7705,
11585    #[serde(rename = "7706")]
11586    T7706,
11587    #[serde(rename = "7707")]
11588    T7707,
11589    #[serde(rename = "7708")]
11590    T7708,
11591    #[serde(rename = "7714")]
11592    T7714,
11593    #[serde(rename = "7715")]
11594    T7715,
11595    #[serde(rename = "7720")]
11596    T7720,
11597    #[serde(rename = "7741")]
11598    T7741,
11599    #[serde(rename = "7762")]
11600    T7762,
11601    #[serde(rename = "7768")]
11602    T7768,
11603    #[serde(rename = "7920")]
11604    T7920,
11605    #[serde(rename = "7921")]
11606    T7921,
11607    #[serde(rename = "7943")]
11608    T7943,
11609}
11610impl core::fmt::Display for MdFields {
11611    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11612        match self {
11613            Self::T31 => write!(f, "31"),
11614            Self::T55 => write!(f, "55"),
11615            Self::T58 => write!(f, "58"),
11616            Self::T70 => write!(f, "70"),
11617            Self::T71 => write!(f, "71"),
11618            Self::T73 => write!(f, "73"),
11619            Self::T74 => write!(f, "74"),
11620            Self::T75 => write!(f, "75"),
11621            Self::T76 => write!(f, "76"),
11622            Self::T77 => write!(f, "77"),
11623            Self::T78 => write!(f, "78"),
11624            Self::T79 => write!(f, "79"),
11625            Self::T80 => write!(f, "80"),
11626            Self::T82 => write!(f, "82"),
11627            Self::T83 => write!(f, "83"),
11628            Self::T84 => write!(f, "84"),
11629            Self::T85 => write!(f, "85"),
11630            Self::T86 => write!(f, "86"),
11631            Self::T87 => write!(f, "87"),
11632            Self::T88 => write!(f, "88"),
11633            Self::T6004 => write!(f, "6004"),
11634            Self::T6008 => write!(f, "6008"),
11635            Self::T6070 => write!(f, "6070"),
11636            Self::T6072 => write!(f, "6072"),
11637            Self::T6073 => write!(f, "6073"),
11638            Self::T6119 => write!(f, "6119"),
11639            Self::T6457 => write!(f, "6457"),
11640            Self::T6508 => write!(f, "6508"),
11641            Self::T6509 => write!(f, "6509"),
11642            Self::T7051 => write!(f, "7051"),
11643            Self::T7057 => write!(f, "7057"),
11644            Self::T7058 => write!(f, "7058"),
11645            Self::T7059 => write!(f, "7059"),
11646            Self::T7068 => write!(f, "7068"),
11647            Self::T7084 => write!(f, "7084"),
11648            Self::T7085 => write!(f, "7085"),
11649            Self::T7086 => write!(f, "7086"),
11650            Self::T7087 => write!(f, "7087"),
11651            Self::T7088 => write!(f, "7088"),
11652            Self::T7089 => write!(f, "7089"),
11653            Self::T7094 => write!(f, "7094"),
11654            Self::T7184 => write!(f, "7184"),
11655            Self::T7219 => write!(f, "7219"),
11656            Self::T7220 => write!(f, "7220"),
11657            Self::T7221 => write!(f, "7221"),
11658            Self::T7280 => write!(f, "7280"),
11659            Self::T7281 => write!(f, "7281"),
11660            Self::T7282 => write!(f, "7282"),
11661            Self::T7283 => write!(f, "7283"),
11662            Self::T7284 => write!(f, "7284"),
11663            Self::T7285 => write!(f, "7285"),
11664            Self::T7292 => write!(f, "7292"),
11665            Self::T7293 => write!(f, "7293"),
11666            Self::T7294 => write!(f, "7294"),
11667            Self::T7295 => write!(f, "7295"),
11668            Self::T7296 => write!(f, "7296"),
11669            Self::T7308 => write!(f, "7308"),
11670            Self::T7309 => write!(f, "7309"),
11671            Self::T7310 => write!(f, "7310"),
11672            Self::T7311 => write!(f, "7311"),
11673            Self::T7607 => write!(f, "7607"),
11674            Self::T7633 => write!(f, "7633"),
11675            Self::T7635 => write!(f, "7635"),
11676            Self::T7636 => write!(f, "7636"),
11677            Self::T7637 => write!(f, "7637"),
11678            Self::T7638 => write!(f, "7638"),
11679            Self::T7639 => write!(f, "7639"),
11680            Self::T7644 => write!(f, "7644"),
11681            Self::T7671 => write!(f, "7671"),
11682            Self::T7672 => write!(f, "7672"),
11683            Self::T7674 => write!(f, "7674"),
11684            Self::T7675 => write!(f, "7675"),
11685            Self::T7676 => write!(f, "7676"),
11686            Self::T7677 => write!(f, "7677"),
11687            Self::T7678 => write!(f, "7678"),
11688            Self::T7679 => write!(f, "7679"),
11689            Self::T7724 => write!(f, "7724"),
11690            Self::T7681 => write!(f, "7681"),
11691            Self::T7682 => write!(f, "7682"),
11692            Self::T7683 => write!(f, "7683"),
11693            Self::T7684 => write!(f, "7684"),
11694            Self::T7685 => write!(f, "7685"),
11695            Self::T7686 => write!(f, "7686"),
11696            Self::T7687 => write!(f, "7687"),
11697            Self::T7688 => write!(f, "7688"),
11698            Self::T7689 => write!(f, "7689"),
11699            Self::T7690 => write!(f, "7690"),
11700            Self::T7694 => write!(f, "7694"),
11701            Self::T7695 => write!(f, "7695"),
11702            Self::T7696 => write!(f, "7696"),
11703            Self::T7697 => write!(f, "7697"),
11704            Self::T7698 => write!(f, "7698"),
11705            Self::T7699 => write!(f, "7699"),
11706            Self::T7700 => write!(f, "7700"),
11707            Self::T7702 => write!(f, "7702"),
11708            Self::T7703 => write!(f, "7703"),
11709            Self::T7704 => write!(f, "7704"),
11710            Self::T7705 => write!(f, "7705"),
11711            Self::T7706 => write!(f, "7706"),
11712            Self::T7707 => write!(f, "7707"),
11713            Self::T7708 => write!(f, "7708"),
11714            Self::T7714 => write!(f, "7714"),
11715            Self::T7715 => write!(f, "7715"),
11716            Self::T7720 => write!(f, "7720"),
11717            Self::T7741 => write!(f, "7741"),
11718            Self::T7762 => write!(f, "7762"),
11719            Self::T7768 => write!(f, "7768"),
11720            Self::T7920 => write!(f, "7920"),
11721            Self::T7921 => write!(f, "7921"),
11722            Self::T7943 => write!(f, "7943"),
11723        }
11724    }
11725}
11726#[serde_with::skip_serializing_none]
11727#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
11728pub struct MessageIdRequestBody {
11729    /// Array of order reply messageId identifier strings to be suppressed.
11730    #[serde(rename = "messageIds")]
11731    pub message_ids: Option<Vec<MessageIdRequestBodyMessageId>>,
11732}
11733/// A warning message to be pre-approved.
11734///   * `o163` - The following order exceeds the price percentage limit
11735///   * `o354` - """You are submitting an order without market data. We strongly recommend against this as it may result in erroneous and unexpected trades. Are you sure you want to submit this order?"""
11736///   * `o382` - The following value exceeds the tick size limit
11737///   * `o383` - """The following order \""BUY 650 AAPL NASDAQ.NMS\"" size exceeds the Size Limit of 500.
11738/// Are you sure you want to submit this order?"""
11739///   * `o403` - """This order will most likely trigger and fill immediately.
11740/// Are you sure you want to submit this order?"""
11741///   * `o451` - """The following order \""BUY 650 AAPL NASDAQ.NMS\"" value estimate of 124,995.00 USD exceeds
11742/// the Total Value Limit of 100,000 USD.
11743/// Are you sure you want to submit this order?"""
11744///   * `o2136` - Mixed allocation order warning
11745///   * `o2137` - Cross side order warning
11746///   * `o2165` - Warns that instrument does not support trading in fractions outside regular trading hours
11747///   * `o10082` - Called Bond warning
11748///   * `o10138` - The following order size modification exceeds the size modification limit.
11749///   * `o10151` - Warns about risks with Market Orders
11750///   * `o10152` - Warns about risks associated with stop orders once they become active
11751///   * `o10153` - <h4>Confirm Mandatory Cap Price</h4>To avoid trading at a price that is not consistent with a fair and orderly market, IB may set a cap (for a buy order) or sell order). THIS MAY CAUSE AN ORDER THAT WOULD OTHERWISE BE MARKETABLE TO NOT BE TRADED.
11752///   * `o10164` - """Traders are responsible for understanding cash quantity details, which are provided on a best efforts basis only."""
11753///   * `o10223` - """<h4>Cash Quantity Order Confirmation</h4>Orders that express size using a monetary value (cash quantity) are provided on a non-guaranteed basis. The system simulates the order by cancelling it once the specified amount is spent (for buy orders) or collected (for sell orders). In addition to the monetary value, the order uses a maximum size that is calculated using the Cash Quantity Estimate Factor, which you can modify in Presets."""
11754///   * `o10288` - Warns about risks associated with market orders for Crypto
11755///   * `o10331` - """You are about to submit a stop order. Please be aware of the various stop order types available and the risks associated with each one.
11756/// Are you sure you want to submit this order?"""
11757///   * `o10332` - OSL Digital Securities LTD Crypto Order Warning
11758///   * `o10333` - Option Exercise at the Money warning
11759///   * `o10334` - Warns that order will be placed into current omnibus account instead of currently selected global account.
11760///   * `o10335` - Serves internal Rapid Entry window.
11761///   * `o10336` - This security has limited liquidity. If you choose to trade this security, there is a heightened risk that you may not be able to close your position at the time you wish, at a price you wish, and/or without incurring a loss. Confirm that you understand the risks of trading illiquid securities.
11762///   * `Are you sure you want to submit this order?
11763///   * `p6` - This order will be distributed over multiple accounts. We strongly suggest you familiarize yourself with our allocation facilities before submitting orders.
11764///   * `p12` - "If your order is not immediately executable, our systems may, depending on market conditions, reject your order if its limit price is more than the allowed amount away from the reference price at that time. If this happens, you will not receive a fill. This is a control designed to ensure that we comply with our regulatory obligations to avoid submitting disruptive orders to the marketplace.\
11765/// Use the Price Management Algo?"
11766#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
11767pub enum MessageIdRequestBodyMessageId {
11768    #[serde(rename = "o163")]
11769    #[default]
11770    O163,
11771    #[serde(rename = "o354")]
11772    O354,
11773    #[serde(rename = "o382")]
11774    O382,
11775    #[serde(rename = "o383")]
11776    O383,
11777    #[serde(rename = "o403")]
11778    O403,
11779    #[serde(rename = "o451")]
11780    O451,
11781    #[serde(rename = "o2136")]
11782    O2136,
11783    #[serde(rename = "o2137")]
11784    O2137,
11785    #[serde(rename = "o2165")]
11786    O2165,
11787    #[serde(rename = "o10082")]
11788    O10082,
11789    #[serde(rename = "o10138")]
11790    O10138,
11791    #[serde(rename = "o10151")]
11792    O10151,
11793    #[serde(rename = "o10152")]
11794    O10152,
11795    #[serde(rename = "o10153")]
11796    O10153,
11797    #[serde(rename = "o10164")]
11798    O10164,
11799    #[serde(rename = "o10223")]
11800    O10223,
11801    #[serde(rename = "o10288")]
11802    O10288,
11803    #[serde(rename = "o10331")]
11804    O10331,
11805    #[serde(rename = "o10332")]
11806    O10332,
11807    #[serde(rename = "o10333")]
11808    O10333,
11809    #[serde(rename = "o10334")]
11810    O10334,
11811    #[serde(rename = "o10335")]
11812    O10335,
11813    #[serde(rename = "o10336")]
11814    O10336,
11815    #[serde(rename = "p6")]
11816    P6,
11817    #[serde(rename = "p12")]
11818    P12,
11819}
11820impl core::fmt::Display for MessageIdRequestBodyMessageId {
11821    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11822        match self {
11823            Self::O163 => write!(f, "o163"),
11824            Self::O354 => write!(f, "o354"),
11825            Self::O382 => write!(f, "o382"),
11826            Self::O383 => write!(f, "o383"),
11827            Self::O403 => write!(f, "o403"),
11828            Self::O451 => write!(f, "o451"),
11829            Self::O2136 => write!(f, "o2136"),
11830            Self::O2137 => write!(f, "o2137"),
11831            Self::O2165 => write!(f, "o2165"),
11832            Self::O10082 => write!(f, "o10082"),
11833            Self::O10138 => write!(f, "o10138"),
11834            Self::O10151 => write!(f, "o10151"),
11835            Self::O10152 => write!(f, "o10152"),
11836            Self::O10153 => write!(f, "o10153"),
11837            Self::O10164 => write!(f, "o10164"),
11838            Self::O10223 => write!(f, "o10223"),
11839            Self::O10288 => write!(f, "o10288"),
11840            Self::O10331 => write!(f, "o10331"),
11841            Self::O10332 => write!(f, "o10332"),
11842            Self::O10333 => write!(f, "o10333"),
11843            Self::O10334 => write!(f, "o10334"),
11844            Self::O10335 => write!(f, "o10335"),
11845            Self::O10336 => write!(f, "o10336"),
11846            Self::P6 => write!(f, "p6"),
11847            Self::P12 => write!(f, "p12"),
11848        }
11849    }
11850}
11851#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11852pub struct MessageResponse {
11853    /// Indicates success or failure of request to discard cached positions.
11854    pub message: Option<String>,
11855}
11856#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11857pub struct ModelListResponse {
11858    /// Base currency of the established model.
11859    #[serde(rename = "baseCcy")]
11860    pub base_ccy: Option<String>,
11861    /// Advisor account responsible for the model.
11862    #[serde(rename = "masterAccount")]
11863    pub master_account: Option<String>,
11864    /// List of all models held under the masterAccount.
11865    pub models: Option<Vec<ModelListResponseItem>>,
11866    /// Request identifier to uniquely track a request.
11867    /// - Example: `Some(540_607i32)`
11868    #[serde(rename = "reqID")]
11869    pub req_id: Option<i32>,
11870    /// Describes if the model is in polling mode.
11871    #[serde(rename = "subscriptionStatus")]
11872    pub subscription_status: Option<i32>,
11873}
11874#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11875pub struct ModelListResponseItem {
11876    /// Used internally for client portal designation. Should be ignored.
11877    pub bootstrapped: Option<bool>,
11878    /// Used internally for client portal. Should be ignored.
11879    #[serde(rename = "customIndex")]
11880    pub custom_index: Option<bool>,
11881    /// Personal description of model to read in IBKR GUI elements.
11882    pub desc: Option<String>,
11883    /// Determine if investing and rebalancing should be handled statically or dynamically. * `true` - Static models will always use the original targets. * `false` - Dynamic models will adjust allocation in response to market movements.
11884    #[serde(rename = "isStatic")]
11885    pub is_static: Option<bool>,
11886    /// Notes if the Actual allocation has become misalligned with the Target.
11887    pub mismatch: Option<bool>,
11888    /// Name of the model.
11889    pub model: Option<String>,
11890    /// Market value of the model.
11891    pub nlv: Option<f64>,
11892    /// Lists the number of accounts held within the model.
11893    #[serde(rename = "numAccounts")]
11894    pub num_accounts: Option<i32>,
11895}
11896#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11897pub struct ModelPositionResponse {
11898    /// An object representing each currency held in the model.
11899    pub cash: Option<Vec<ModelPositionResponseCash>>,
11900    /// Notes if the Actual allocation has become misalligned with the Target.
11901    pub mismatched: Option<bool>,
11902    /// Name of the model.
11903    pub model: Option<String>,
11904    /// Market value of the model.
11905    pub nlv: Option<f64>,
11906    /// List of object containing each equity in the model.
11907    #[serde(rename = "positionList")]
11908    pub position_list: Option<Vec<ModelPositionResponsePositionList>>,
11909    /// Epoch timestamp when the position was retrieved.
11910    #[serde(rename = "positionTs")]
11911    pub position_ts: Option<i64>,
11912    /// Request identifier to uniquely track a request.
11913    #[serde(rename = "reqID")]
11914    pub req_id: Option<i32>,
11915    /// Describes if the model contains only stocks.
11916    #[serde(rename = "stkOnly")]
11917    pub stk_only: Option<bool>,
11918    /// Describes if the model is in polling mode.
11919    #[serde(rename = "subscriptionStatus")]
11920    pub subscription_status: Option<i32>,
11921    /// Diplayed total liquidation value of the model.
11922    #[serde(rename = "totalDlv")]
11923    pub total_dlv: Option<f64>,
11924    /// Market value of the entire position.
11925    #[serde(rename = "totalMv")]
11926    pub total_mv: Option<f64>,
11927}
11928#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11929pub struct ModelPositionResponseCash {
11930    /// Actual percent of the model held in the postion.
11931    pub actual: Option<f64>,
11932    /// Currency symbol.
11933    pub ccy: Option<String>,
11934    /// Exchange rate of the account base currency to the model base currency.
11935    #[serde(rename = "exchangeRate")]
11936    pub exchange_rate: Option<f64>,
11937    /// Describes the percentage of imbalance of the actual allocation from the model.
11938    #[serde(rename = "instrumentImbalance")]
11939    pub instrument_imbalance: Option<f64>,
11940    /// Market value of the position.
11941    pub mv: Option<f64>,
11942    /// Target percentage of the model to hold in the position.
11943    pub target: Option<f64>,
11944}
11945#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
11946pub struct ModelPositionResponsePositionList {
11947    /// Actual percent of the model held in the postion.
11948    pub actual: Option<f64>,
11949    /// Maximum accepted tolerance above the target.
11950    #[serde(rename = "actualRangeMax")]
11951    pub actual_range_max: Option<f64>,
11952    /// Minimum accepted tolerance below the target.
11953    #[serde(rename = "actualRangeMin")]
11954    pub actual_range_min: Option<f64>,
11955    /// Currency symbol.
11956    pub ccy: Option<String>,
11957    /// Contract identifier for the instrument.
11958    pub conid: Option<f64>,
11959    /// Displayed liquidation value.
11960    pub dlv: Option<f64>,
11961    /// Used internally for client portal. Should be ignored.
11962    #[serde(rename = "exchangeRate")]
11963    pub exchange_rate: Option<f64>,
11964    /// Used internally for client portal. Should be ignored.
11965    pub flags: Option<i32>,
11966    /// Symbol of the position.
11967    pub instrument: Option<String>,
11968    /// Describes the percentage of imbalance of the actual allocation from the model.
11969    #[serde(rename = "instrumentImbalance")]
11970    pub instrument_imbalance: Option<f64>,
11971    /// Used internally for client portal. Should be ignored.
11972    #[serde(rename = "mismatchType")]
11973    pub mismatch_type: Option<f64>,
11974    /// Market Value.
11975    pub mv: Option<f64>,
11976    /// The total size of the position held in the model.
11977    pub position: Option<f64>,
11978    /// The desired allocation percentage of the position in the model.
11979    pub target: Option<f64>,
11980}
11981#[serde_with::skip_serializing_none]
11982#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
11983pub struct ModelPresetsResponse {
11984    /// Avoid negative offsetting cash in Independent
11985    #[serde(rename = "avoidNegativeCashInIndependent")]
11986    pub avoid_negative_cash_in_independent: Option<bool>,
11987    /// Close out the full position while divesting.
11988    #[serde(rename = "closeDivestIndependentPosition")]
11989    pub close_divest_independent_position: Option<bool>,
11990    /// Use the maximum avialble funds to increase long positions.
11991    #[serde(rename = "fullyInvestExistingLongPositions")]
11992    pub fully_invest_existing_long_positions: Option<bool>,
11993    /// Keep model open for fully divested accounts.
11994    #[serde(rename = "keepModelOpen")]
11995    pub keep_model_open: Option<bool>,
11996    /// Transfer positions to Independent instead of liquidating.
11997    #[serde(rename = "preferCrossWithIndependent")]
11998    pub prefer_cross_with_independent: Option<bool>,
11999    /// Transfer positions from Independent structure when possible.
12000    #[serde(rename = "preferTransferFromIndependent")]
12001    pub prefer_transfer_from_independent: Option<bool>,
12002    /// Request identifier to uniquely track a request.
12003    #[serde(rename = "reqID")]
12004    pub req_id: Option<i32>,
12005    /// Determine if allocation quantities should be handled by lot size.
12006    #[serde(rename = "roundAllocationQuantityToExchangeBoardLot")]
12007    pub round_allocation_quantity_to_exchange_board_lot: Option<bool>,
12008    /// Describes if the model is in polling mode.
12009    #[serde(rename = "subscriptionStatus")]
12010    pub subscription_status: Option<i32>,
12011    /// Use non-base balances when available.
12012    #[serde(rename = "useNonBaseCcy")]
12013    pub use_non_base_ccy: Option<bool>,
12014    /// Designate of tolerance ranges should be used for rebalancing.
12015    #[serde(rename = "useToleranceRange")]
12016    pub use_tolerance_range: Option<bool>,
12017}
12018#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12019pub struct ModelSummaryResponse {
12020    /// Used internally for client portal designation. Should be ignored.
12021    pub bootstrapped: Option<bool>,
12022    /// Used internally for client portal. Should be ignored.
12023    #[serde(rename = "customIndex")]
12024    pub custom_index: Option<bool>,
12025    /// Personal description of model to read in IBKR GUI elements.
12026    pub desc: Option<String>,
12027    /// Determine if investing and rebalancing should be handled statically or dynamically. * `true` - Static models will always use the original targets. * `false` - Dynamic models will adjust allocation in response to market movements.
12028    #[serde(rename = "isStatic")]
12029    pub is_static: Option<bool>,
12030    /// Notes if the Actual allocation has become misalligned with the Target.
12031    pub mismatch: Option<bool>,
12032    /// Name of the model.
12033    pub model: Option<String>,
12034    /// Net Liquidation of the model.
12035    pub nlv: Option<f64>,
12036    /// Lists the number of accounts held within the model.
12037    #[serde(rename = "numAccounts")]
12038    pub num_accounts: Option<i32>,
12039    /// Request identifier to uniquely track a request.
12040    /// - Example: `Some(540_609i32)`
12041    #[serde(rename = "reqID")]
12042    pub req_id: Option<i32>,
12043    /// Describes if the model is in polling mode.
12044    #[serde(rename = "subscriptionStatus")]
12045    pub subscription_status: Option<i32>,
12046}
12047/// Modify an existing allocation group.
12048#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12049pub struct ModifyAllocationGroupRequest {
12050    #[validate(nested)]
12051    pub body: GroupRequestBody,
12052}
12053impl ModifyAllocationGroupRequest {
12054    /// Parse the HTTP response into the response enum.
12055    pub async fn parse_response(
12056        req: reqwest::Response,
12057    ) -> anyhow::Result<CreateAllocationGroupResponse> {
12058        let status = req.status();
12059        if status == http::StatusCode::OK {
12060            let data = oas3_gen_support::Diagnostics::<SuccessResponse>::json_with_diagnostics(req)
12061                .await?;
12062            return Ok(CreateAllocationGroupResponse::Ok(data));
12063        }
12064        if status == http::StatusCode::UNAUTHORIZED {
12065            let _ = req.bytes().await?;
12066            return Ok(CreateAllocationGroupResponse::Unauthorized);
12067        }
12068        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12069            let _ = req.bytes().await?;
12070            return Ok(CreateAllocationGroupResponse::InternalServerError);
12071        }
12072        if status == http::StatusCode::SERVICE_UNAVAILABLE {
12073            let _ = req.bytes().await?;
12074            return Ok(CreateAllocationGroupResponse::ServiceUnavailable);
12075        }
12076        let _ = req.bytes().await?;
12077        return Ok(CreateAllocationGroupResponse::Unknown);
12078    }
12079}
12080/// Choose whether a particular device is enabled or disabled.
12081#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12082pub struct ModifyFyiDeliveryRequest {
12083    pub body: FyiEnableDeviceOption,
12084}
12085impl ModifyFyiDeliveryRequest {
12086    /// Parse the HTTP response into the response enum.
12087    pub async fn parse_response(
12088        req: reqwest::Response,
12089    ) -> anyhow::Result<ModifyFyiDeliveryResponse> {
12090        let status = req.status();
12091        if status == http::StatusCode::OK {
12092            let data = oas3_gen_support::Diagnostics::<FyiVT>::json_with_diagnostics(req).await?;
12093            return Ok(ModifyFyiDeliveryResponse::Ok(data));
12094        }
12095        if status == http::StatusCode::BAD_REQUEST {
12096            let _ = req.bytes().await?;
12097            return Ok(ModifyFyiDeliveryResponse::BadRequest);
12098        }
12099        if status == http::StatusCode::UNAUTHORIZED {
12100            let _ = req.bytes().await?;
12101            return Ok(ModifyFyiDeliveryResponse::Unauthorized);
12102        }
12103        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12104            let _ = req.bytes().await?;
12105            return Ok(ModifyFyiDeliveryResponse::InternalServerError);
12106        }
12107        if status == http::StatusCode::SERVICE_UNAVAILABLE {
12108            let _ = req.bytes().await?;
12109            return Ok(ModifyFyiDeliveryResponse::ServiceUnavailable);
12110        }
12111        let _ = req.bytes().await?;
12112        return Ok(ModifyFyiDeliveryResponse::Unknown);
12113    }
12114}
12115/// Response types for modifyFyiDelivery
12116#[derive(Debug, Clone)]
12117pub enum ModifyFyiDeliveryResponse {
12118    ///200: Successfully retrieve preset details
12119    Ok(FyiVT),
12120    ///400: Invalid input format or missing required fields
12121    BadRequest,
12122    ///401: Invalid or expired access token
12123    Unauthorized,
12124    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
12125     */
12126    InternalServerError,
12127    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
12128     */
12129    ServiceUnavailable,
12130    ///default: Unknown response
12131    Unknown,
12132}
12133/// Enable or disable your account's primary email to receive notifications.
12134#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12135pub struct ModifyFyiEmailsRequest {
12136    pub query: ModifyFyiEmailsRequestQuery,
12137}
12138impl ModifyFyiEmailsRequest {
12139    /// Parse the HTTP response into the response enum.
12140    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ModifyFyiEmailsResponse> {
12141        let status = req.status();
12142        if status == http::StatusCode::OK {
12143            let data = oas3_gen_support::Diagnostics::<FyiVT>::json_with_diagnostics(req).await?;
12144            return Ok(ModifyFyiEmailsResponse::Ok(data));
12145        }
12146        if status == http::StatusCode::UNAUTHORIZED {
12147            let _ = req.bytes().await?;
12148            return Ok(ModifyFyiEmailsResponse::Unauthorized);
12149        }
12150        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12151            let _ = req.bytes().await?;
12152            return Ok(ModifyFyiEmailsResponse::InternalServerError);
12153        }
12154        if status == http::StatusCode::SERVICE_UNAVAILABLE {
12155            let _ = req.bytes().await?;
12156            return Ok(ModifyFyiEmailsResponse::ServiceUnavailable);
12157        }
12158        let _ = req.bytes().await?;
12159        return Ok(ModifyFyiEmailsResponse::Unknown);
12160    }
12161}
12162#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
12163pub struct ModifyFyiEmailsRequestQuery {
12164    /// Enable or disable your email. Value format: true: Enable; false: Disable
12165    pub enabled: serde_json::Value,
12166}
12167/// Response types for modifyFyiEmails
12168#[derive(Debug, Clone)]
12169pub enum ModifyFyiEmailsResponse {
12170    ///200: Successfully enabled or disabled your email notifications.
12171    Ok(FyiVT),
12172    ///401: Invalid or expired access token
12173    Unauthorized,
12174    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
12175     */
12176    InternalServerError,
12177    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
12178     */
12179    ServiceUnavailable,
12180    ///default: Unknown response
12181    Unknown,
12182}
12183/// Enable or disable group of notifications by the specific typecode.
12184#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12185pub struct ModifyFyiNotificationRequest {
12186    pub path: ModifyFyiNotificationRequestPath,
12187    pub body: EnabledRequestBody,
12188}
12189impl ModifyFyiNotificationRequest {
12190    /// Parse the HTTP response into the response enum.
12191    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ModifyFyiEmailsResponse> {
12192        let status = req.status();
12193        if status == http::StatusCode::OK {
12194            let data = oas3_gen_support::Diagnostics::<FyiVT>::json_with_diagnostics(req).await?;
12195            return Ok(ModifyFyiEmailsResponse::Ok(data));
12196        }
12197        if status == http::StatusCode::UNAUTHORIZED {
12198            let _ = req.bytes().await?;
12199            return Ok(ModifyFyiEmailsResponse::Unauthorized);
12200        }
12201        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12202            let _ = req.bytes().await?;
12203            return Ok(ModifyFyiEmailsResponse::InternalServerError);
12204        }
12205        if status == http::StatusCode::SERVICE_UNAVAILABLE {
12206            let _ = req.bytes().await?;
12207            return Ok(ModifyFyiEmailsResponse::ServiceUnavailable);
12208        }
12209        let _ = req.bytes().await?;
12210        return Ok(ModifyFyiEmailsResponse::Unknown);
12211    }
12212}
12213#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
12214pub struct ModifyFyiNotificationRequestPath {
12215    /// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
12216    ///   * `BA` - Borrow Availability
12217    ///   * `CA` - Comparable Algo
12218    ///   * `DA` - Dividends Advisory
12219    ///   * `EA` - Upcoming Earnings
12220    ///   * `MF` - Mutual Fund Advisory
12221    ///   * `OE` - Option Expiration
12222    ///   * `PR` - Portfolio Builder Rebalance
12223    ///   * `SE` - Suspend Order on Economic Event
12224    ///   * `SG` - Short Term Gain turning Long Term
12225    ///   * `SM` - System Messages
12226    ///   * `T2` - Assignment Realizing Long-Term Gains
12227    ///   * `TO` - Takeover
12228    ///   * `UA` - User Alert
12229    ///   * `M8` - M871 Trades
12230    ///   * `PS` - Platform Use Suggestions
12231    ///   * `DL` - Unexercised Option Loss Prevention Reminder
12232    ///   * `PT` - Position Transfer
12233    ///   * `CB` - Missing Cost Basis
12234    ///   * `MS` - Milestones
12235    ///   * `TD` - MiFID || 10% Deprecation Notice
12236    ///   * `ST` - Save Taxes
12237    ///   * `TI` - Trade Idea
12238    ///   * `CT` - Cash Transfer
12239    pub typecode: Typecodes,
12240}
12241/// Modify an existing, unfilled order.
12242#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12243pub struct ModifyOpenOrderRequest {
12244    #[validate(nested)]
12245    pub path: ModifyOpenOrderRequestPath,
12246    #[validate(nested)]
12247    pub body: SingleOrderSubmissionRequest,
12248}
12249impl ModifyOpenOrderRequest {
12250    /// Parse the HTTP response into the response enum.
12251    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ModifyOpenOrderResponse> {
12252        let status = req.status();
12253        if status == http::StatusCode::OK {
12254            let data =
12255                oas3_gen_support::Diagnostics::<Order200Response>::json_with_diagnostics(req)
12256                    .await?;
12257            return Ok(ModifyOpenOrderResponse::Ok(data));
12258        }
12259        if status == http::StatusCode::BAD_REQUEST {
12260            let _ = req.bytes().await?;
12261            return Ok(ModifyOpenOrderResponse::BadRequest);
12262        }
12263        if status == http::StatusCode::UNAUTHORIZED {
12264            let _ = req.bytes().await?;
12265            return Ok(ModifyOpenOrderResponse::Unauthorized);
12266        }
12267        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12268            let _ = req.bytes().await?;
12269            return Ok(ModifyOpenOrderResponse::InternalServerError);
12270        }
12271        if status == http::StatusCode::SERVICE_UNAVAILABLE {
12272            let _ = req.bytes().await?;
12273            return Ok(ModifyOpenOrderResponse::ServiceUnavailable);
12274        }
12275        let _ = req.bytes().await?;
12276        return Ok(ModifyOpenOrderResponse::Unknown);
12277    }
12278}
12279#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
12280pub struct ModifyOpenOrderRequestPath {
12281    /// The account to which the order will clear.
12282    /// - Example: `"DU123456".to_string()`
12283    #[validate(length(min = 1u64))]
12284    pub account_id: String,
12285    /// The IB-assigned order ID of the desired order ticket.
12286    /// - Example: `1_799_796_559i32`
12287    pub order_id: i32,
12288}
12289/// Response types for modifyOpenOrder
12290#[derive(Debug, Clone)]
12291pub enum ModifyOpenOrderResponse {
12292    ///200: Status of submission
12293    Ok(Order200Response),
12294    ///400: Invalid input format or missing required fields
12295    BadRequest,
12296    ///401: Invalid or expired access token
12297    Unauthorized,
12298    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
12299     */
12300    InternalServerError,
12301    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
12302     */
12303    ServiceUnavailable,
12304    ///default: Unknown response
12305    Unknown,
12306}
12307#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
12308pub struct NameRequestBody {
12309    /// Name of an existing allocation group.
12310    /// - Example: `"Group_1_NetLiq".to_string()`
12311    #[validate(length(min = 1u64))]
12312    pub name: String,
12313}
12314#[serde_with::skip_serializing_none]
12315#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
12316pub struct NonDisclosedDetail {
12317    /// - Example: `Some("320043".to_string())`
12318    #[serde(rename = "buyerSellBic")]
12319    #[validate(length(min = 0u64, max = 64u64))]
12320    pub buyer_sell_bic: Option<String>,
12321    /// - Example: `Some("123456".to_string())`
12322    #[serde(rename = "memberAccountId")]
12323    #[validate(length(min = 0u64, max = 64u64))]
12324    pub member_account_id: Option<String>,
12325    /// - Example: `Some("DTCYUS33XXX".to_string())`
12326    #[serde(rename = "psetBic")]
12327    #[validate(length(min = 0u64, max = 64u64))]
12328    pub pset_bic: Option<String>,
12329    /// - Example: `Some("CH100164".to_string())`
12330    #[serde(rename = "reagDeagBic")]
12331    #[validate(length(min = 0u64, max = 64u64))]
12332    pub reag_deag_bic: Option<String>,
12333    /// - Example: `Some("123456".to_string())`
12334    #[serde(rename = "safeKeepingAccountId")]
12335    #[validate(length(min = 0u64, max = 64u64))]
12336    pub safe_keeping_account_id: Option<String>,
12337    /// - Example: `"2023-07-18".to_string()`
12338    #[serde(rename = "settleDate")]
12339    #[validate(length(min = 1u64))]
12340    pub settle_date: String,
12341    /// - Example: `"2023-07-08".to_string()`
12342    #[serde(rename = "tradeDate")]
12343    #[validate(length(min = 1u64))]
12344    pub trade_date: String,
12345}
12346#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12347pub struct NotificationReadAcknowledge {
12348    /// Returns details about the notification read status.
12349    #[serde(rename = "P")]
12350    pub p: Option<NotificationReadAcknowledgeP>,
12351    /// Returns the time in ms to complete the edit.
12352    #[serde(rename = "T")]
12353    pub t: Option<i32>,
12354    /// Returns 1 to state message was acknowledged.
12355    #[serde(rename = "V")]
12356    pub v: Option<i32>,
12357}
12358/// Returns details about the notification read status.
12359#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12360pub struct NotificationReadAcknowledgeP {
12361    /// Returns the ID for the notification.
12362    #[serde(rename = "ID")]
12363    pub id: Option<String>,
12364    /// Returns if the message was read (1) or unread (0).
12365    #[serde(rename = "R")]
12366    pub r: Option<i32>,
12367}
12368#[serde_with::skip_serializing_none]
12369#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
12370pub struct NotificationRequestBody {
12371    /// IB-assigned order identifier obtained from the ntf websocket message that delivered the server prompt.
12372    /// - Example: `Some(987_654_321i32)`
12373    #[serde(rename = "orderId")]
12374    pub order_id: Option<i32>,
12375    /// IB-assigned request identifier obtained from the ntf websocket message that delivered the server prompt.
12376    /// - Example: `Some("12345".to_string())`
12377    #[serde(rename = "reqId")]
12378    pub req_id: Option<String>,
12379    /// The selected value from the "options" array delivered in the server prompt ntf websocket message.
12380    /// - Example: `Some("Yes".to_string())`
12381    pub text: Option<String>,
12382}
12383pub type Notifications = Vec<NotificationsNotification>;
12384#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12385pub struct NotificationsNotification {
12386    /// Notification date as an epoch string.
12387    #[serde(rename = "D")]
12388    pub d: Option<String>,
12389    /// FYI code, we can use it to find whether the disclaimer is accepted or not in settings
12390    #[serde(rename = "FC")]
12391    pub fc: Option<String>,
12392    /// HT
12393    /// - Example: `Some(0i32)`
12394    #[serde(rename = "HT")]
12395    pub ht: Option<i32>,
12396    /// Unique way to reference the notification.
12397    #[serde(rename = "ID")]
12398    pub id: Option<String>,
12399    /// Content of notification.
12400    #[serde(rename = "MD")]
12401    pub md: Option<String>,
12402    /// Title of notification.
12403    #[serde(rename = "MS")]
12404    pub ms: Option<String>,
12405    /// Return if the notification was read or not. Value Format: 0: Disabled; 1: Enabled.
12406    #[serde(rename = "R")]
12407    pub r: Option<String>,
12408}
12409#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12410pub struct OauthTokenResponse {
12411    /// Temporary OAuth access token. 20 character hex value.
12412    pub oauth_token: Option<String>,
12413}
12414#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12415#[serde(untagged)]
12416pub enum Order200Response {
12417    /// A successful submission of one or more order tickets.
12418    #[default]
12419    OrderSubmitSuccess(OrderSubmitSuccess),
12420    /// Indicates that the order reply message or submission was not accepted.
12421    OrderSubmitError(OrderSubmitError),
12422    /// An array containing objects that each deliver the order reply messages emitted against one order ticket in the submission request's array.  Indicies of the order reply message objects in this array correspond to the indicies of the order tickets in the submission request's array.
12423    OrderReplyMessage(OrderReplyMessage),
12424    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
12425    AdvancedOrderReject(AdvancedOrderReject),
12426}
12427impl Order200Response {
12428    /// Indicates that the order reply message or submission was not accepted.
12429    pub fn order_submit_error(error: Option<String>) -> Self {
12430        Self::OrderSubmitError(OrderSubmitError {
12431            error,
12432            ..Default::default()
12433        })
12434    }
12435    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
12436    pub fn advanced_order_reject() -> Self {
12437        Self::AdvancedOrderReject(AdvancedOrderReject::default())
12438    }
12439}
12440#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12441#[serde(untagged)]
12442pub enum Order200Response2 {
12443    /// Acknowledges IB's acceptance of the request to cancel the order. Does not report whether the cancellation can or will ultimately be enacted.
12444    #[default]
12445    CancelSuccess(OrderCancelSuccess),
12446    /// Indicates that the order reply message or submission was not accepted.
12447    SubmitError(OrderSubmitError),
12448}
12449impl Order200Response2 {
12450    /// Acknowledges IB's acceptance of the request to cancel the order. Does not report whether the cancellation can or will ultimately be enacted.
12451    pub fn cancel_success() -> Self {
12452        Self::CancelSuccess(OrderCancelSuccess::default())
12453    }
12454    /// Indicates that the order reply message or submission was not accepted.
12455    pub fn submit_error(error: Option<String>) -> Self {
12456        Self::SubmitError(OrderSubmitError {
12457            error,
12458            ..Default::default()
12459        })
12460    }
12461}
12462#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12463#[serde(untagged)]
12464pub enum Order200Response3 {
12465    /// A successful submission of one or more order tickets.
12466    #[default]
12467    OrderSubmitSuccess(OrderSubmitSuccess),
12468    /// An array containing objects that each deliver the order reply messages emitted against one order ticket in the submission request's array.  Indicies of the order reply message objects in this array correspond to the indicies of the order tickets in the submission request's array.
12469    OrderReplyMessage(OrderReplyMessage),
12470    /// Indicates that the order reply message or submission was not accepted.
12471    OrderSubmitError(OrderSubmitError),
12472    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
12473    AdvancedOrderReject(AdvancedOrderReject),
12474}
12475impl Order200Response3 {
12476    /// Indicates that the order reply message or submission was not accepted.
12477    pub fn order_submit_error(error: Option<String>) -> Self {
12478        Self::OrderSubmitError(OrderSubmitError {
12479            error,
12480            ..Default::default()
12481        })
12482    }
12483    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
12484    pub fn advanced_order_reject() -> Self {
12485        Self::AdvancedOrderReject(AdvancedOrderReject::default())
12486    }
12487}
12488/// Acknowledges IB's acceptance of the request to cancel the order. Does not report whether the cancellation can or will ultimately be enacted.
12489#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12490#[serde(default)]
12491pub struct OrderCancelSuccess {
12492    /// IB account to which the order was originally set to clear.
12493    pub account: Option<String>,
12494    /// IB contract ID of the order ticket's instrument.
12495    pub conid: Option<String>,
12496    /// Indicates success with value 'Request was submitted'
12497    #[default(Some("Request was submitted".to_string()))]
12498    pub msg: Option<String>,
12499    /// IB order ID of the order ticket requested for cancellation.
12500    pub order_id: Option<String>,
12501}
12502/// Projected costs and changes to margin and equity values in the account, if the order ticket were executed in full.
12503#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12504pub struct OrderPreview {
12505    /// Describes the projected costs associated with the order ticket.
12506    pub amount: Option<OrderPreviewAmount>,
12507    /// Describes the projected change to the account's equity.
12508    pub equity: Option<OrderPreviewEquity>,
12509    /// Human-readable text of an error message, if applicable. Otherwise null.
12510    pub error: Option<String>,
12511    /// Describes the projected change to initial margin.
12512    pub initial: Option<OrderPreviewInitial>,
12513    /// Describes the projected change to maintenance margin.
12514    pub maintenance: Option<OrderPreviewMaintenance>,
12515    /// Describes the projected change to the account's position in the instrument.
12516    pub position: Option<OrderPreviewPosition>,
12517    /// Human-readable text of warning message, if applicable. Otherwise null.
12518    pub warn: Option<String>,
12519}
12520/// Describes the projected costs associated with the order ticket.
12521#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12522pub struct OrderPreviewAmount {
12523    /// Projected cost of the order, current reference price times total quantity.
12524    pub amount: Option<String>,
12525    /// Projected commissions and fees associated with the order.
12526    pub commission: Option<String>,
12527    /// Sum of projected cost and commission values for the order.
12528    pub total: Option<String>,
12529}
12530/// Describes the projected change to the account's equity.
12531#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12532pub struct OrderPreviewEquity {
12533    /// Projected equity after execution of the order.
12534    pub after: Option<String>,
12535    /// Difference between current and projected equity values.
12536    pub change: Option<String>,
12537    /// Current equity.
12538    pub current: Option<String>,
12539}
12540/// Describes the projected change to initial margin.
12541#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12542pub struct OrderPreviewInitial {
12543    /// Projected initial margin after execution of the order.
12544    pub after: Option<String>,
12545    /// Difference between current and projected initial margin values.
12546    pub change: Option<String>,
12547    /// Current initial margin.
12548    pub current: Option<String>,
12549}
12550/// Describes the projected change to maintenance margin.
12551#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12552pub struct OrderPreviewMaintenance {
12553    /// Projected maintenance margin after execution of the order.
12554    pub after: Option<String>,
12555    /// Difference between current and projected maintenance margin values.
12556    pub change: Option<String>,
12557    /// Current maintenance margin.
12558    pub current: Option<String>,
12559}
12560/// Describes the projected change to the account's position in the instrument.
12561#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12562pub struct OrderPreviewPosition {
12563    /// Projected position size after execution of the order.
12564    pub after: Option<String>,
12565    /// Difference between current and projected position sizes.
12566    pub change: Option<String>,
12567    /// Current position in the instrument.
12568    pub current: Option<String>,
12569}
12570/// An array containing objects that each deliver the order reply messages emitted against one order ticket in the submission request's array.  Indicies of the order reply message objects in this array correspond to the indicies of the order tickets in the submission request's array.
12571pub type OrderReplyMessage = Vec<OrderReplyMessageOrderReplyMessage>;
12572/// An object containing order reply messages emitted against a single order ticket.
12573#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12574pub struct OrderReplyMessageOrderReplyMessage {
12575    /// The replyId UUID of the order ticket's emitted order reply messages, used to confirm them and proceed. Use the POST /iserver/reply/{replyId} endpoint to confirm an order reply message.
12576    pub id: Option<String>,
12577    /// Internal use. Always delivers value 'false'.
12578    #[serde(rename = "isSuppressed")]
12579    pub is_suppressed: Option<bool>,
12580    /// An array containing the human-readable text of all order reply messages emitted for the order ticket.
12581    pub message: Option<Vec<String>>,
12582    /// An array containing identifiers that categorize the types of order reply messages that have been emitted.  Elements of this array are ordered so that indicies match the corresponding human-readable text strings in the 'message' array. A messageId can typically be passed in the POST /iserver/questions/suppress endpoint to auto-accept a given warning message.
12583    #[serde(rename = "messageIds")]
12584    pub message_ids: Option<Vec<String>>,
12585}
12586/// Indicates that the order reply ID does not exist.
12587#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12588pub struct OrderReplyNotFound {
12589    /// Message indicating that order reply id was not found.
12590    pub error: Option<String>,
12591}
12592/// Object containing information about the status of an order ticket.
12593#[serde_with::skip_serializing_none]
12594#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
12595pub struct OrderStatus {
12596    /// The account receiving executions against this order ticket.
12597    pub account: Option<String>,
12598    /// Indicates that an alert is active for the order ticket.
12599    pub alert_active: Option<AlertActivationRequestAlertActive>,
12600    /// Indicates whether an identical order on the opposite side can be placed.
12601    pub allowed_duplicate_opposite: Option<bool>,
12602    /// Internal use. Indicates chart periods available for the instrument.
12603    pub available_chart_periods: Option<String>,
12604    /// Average price of fills against the order, if any.
12605    pub average_price: Option<String>,
12606    /// Internal use. IB's UI background color in hex.
12607    #[serde(rename = "bgColor")]
12608    pub bg_color: Option<String>,
12609    /// Indicates whether the order ticket can be cancelled.
12610    pub cannot_cancel_order: Option<bool>,
12611    /// Indicates if the order ticket is hedged, and if so, in what way. 0 = No hedge, A = Attached child hedge order, B = Beta/portfolio hedge
12612    pub child_order_type: Option<OrderStatusChildOrderType>,
12613    /// Name of the company or asset associated with the instrument.
12614    pub company_name: Option<String>,
12615    /// Contract ID of the order's instrument.
12616    pub conid: Option<i32>,
12617    /// Contract ID and routing destination in format 123456@EXCHANGE.
12618    pub conidex: Option<String>,
12619    /// Human-readable description of the order's instrument.
12620    pub contract_description_1: Option<String>,
12621    /// Cumulative filled quantity of the instrument against the order ticket.
12622    pub cum_fill: Option<String>,
12623    /// The currency in which the instrument trades and executions are conducted.
12624    pub currency: Option<String>,
12625    /// Indicates whether the order ticket can be deactivated.
12626    pub deactivate_order: Option<bool>,
12627    /// Indicates which fields of the order ticket can be modified currently.
12628    pub editable_fields: Option<String>,
12629    /// Internal use. A string describing an active Client Portal exit strategy, or the result of its execution.
12630    pub exit_strategy_chart_description: Option<String>,
12631    /// Internal use. The UI-displayed price associated with a Client Portal exist strategy.
12632    pub exit_strategy_display_price: Option<String>,
12633    /// Internal use. Indicates the availability of Client Portal exit strategy tool for the order.
12634    pub exit_strategy_tool_availability: Option<String>,
12635    /// Internal use. IB's UI foreground color in hex.
12636    #[serde(rename = "fgColor")]
12637    pub fg_color: Option<String>,
12638    /// Primary listing exchange of the order ticket's instrument.
12639    pub listing_exchange: Option<String>,
12640    /// Internal use only.
12641    pub option_acct: Option<String>,
12642    /// IB internal order status.
12643    pub order_ccp_status: Option<String>,
12644    /// The IB account to which the order ticket clears.
12645    pub order_clearing_account: Option<String>,
12646    /// Human-readable description of the status or current result of the order ticket, meant for UI presentation.
12647    pub order_description: Option<String>,
12648    /// Human-readable description of the status or current result of the order ticket, meant for UI presentation. Includes instrument name.
12649    pub order_description_with_contract: Option<String>,
12650    /// The IB-assigned order identifier of the order, as provided in the request path.
12651    pub order_id: Option<i32>,
12652    /// Indicates whether the order ticket can be modified.
12653    pub order_not_editable: Option<bool>,
12654    /// Status of the order ticket.
12655    pub order_status: Option<OrderStatusOrderStatus>,
12656    /// Human-readable rendering of the order's status meant for presentation in UI.
12657    pub order_status_description: Option<String>,
12658    /// Time of the order's submission in format YYMMDDhhmmss.
12659    pub order_time: Option<String>,
12660    /// The order's  IB order type.
12661    pub order_type: Option<String>,
12662    /// Internal use only. IB-assigned identifier for the status request.
12663    pub request_id: Option<String>,
12664    /// IB asset class identifier.
12665    pub sec_type: Option<OrderStatusSecType>,
12666    /// IB-assigned meta-identifier used to associate rejected and resubmitted orders following Server Prompts.
12667    pub server_id: Option<String>,
12668    /// Side of the order ticket.
12669    pub side: Option<Side>,
12670    /// Remaining unfilled size of the order ticket. Will reflect 0.0 if order is filled in full, cancelled, or otherwise resolved and no longer working.
12671    pub size: Option<String>,
12672    /// A string reflecting the cumulative fills and total size of the order.
12673    pub size_and_fills: Option<String>,
12674    /// Internal use only.
12675    pub sub_type: Option<String>,
12676    /// Symbol of the order ticket's instrument.
12677    pub symbol: Option<String>,
12678    /// Time in force of the order ticket.
12679    pub tif: Option<OrderStatusTif>,
12680    /// The total size of the order ticket.
12681    pub total_size: Option<String>,
12682}
12683/// Indicates if the order ticket is hedged, and if so, in what way. 0 = No hedge, A = Attached child hedge order, B = Beta/portfolio hedge
12684#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
12685pub enum OrderStatusChildOrderType {
12686    #[serde(rename = "0")]
12687    #[default]
12688    T0,
12689    A,
12690    B,
12691}
12692impl core::fmt::Display for OrderStatusChildOrderType {
12693    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12694        match self {
12695            Self::T0 => write!(f, "0"),
12696            Self::A => write!(f, "A"),
12697            Self::B => write!(f, "B"),
12698        }
12699    }
12700}
12701/// Status of the order ticket.
12702#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
12703pub enum OrderStatusOrderStatus {
12704    #[default]
12705    Inactive,
12706    PendingSubmit,
12707    PreSubmitted,
12708    Submitted,
12709    Filled,
12710    PendingCancel,
12711    Cancelled,
12712    WarnState,
12713}
12714impl core::fmt::Display for OrderStatusOrderStatus {
12715    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12716        match self {
12717            Self::Inactive => write!(f, "Inactive"),
12718            Self::PendingSubmit => write!(f, "PendingSubmit"),
12719            Self::PreSubmitted => write!(f, "PreSubmitted"),
12720            Self::Submitted => write!(f, "Submitted"),
12721            Self::Filled => write!(f, "Filled"),
12722            Self::PendingCancel => write!(f, "PendingCancel"),
12723            Self::Cancelled => write!(f, "Cancelled"),
12724            Self::WarnState => write!(f, "WarnState"),
12725        }
12726    }
12727}
12728/// IB asset class identifier.
12729#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
12730pub enum OrderStatusSecType {
12731    #[serde(rename = "STK")]
12732    #[default]
12733    Stk,
12734    #[serde(rename = "OPT")]
12735    Opt,
12736    #[serde(rename = "FUT")]
12737    Fut,
12738    #[serde(rename = "FOP")]
12739    Fop,
12740    #[serde(rename = "CASH")]
12741    Cash,
12742    #[serde(rename = "CRYPTO")]
12743    Crypto,
12744    #[serde(rename = "BOND")]
12745    Bond,
12746    #[serde(rename = "WAR")]
12747    War,
12748    #[serde(rename = "FUND")]
12749    Fund,
12750}
12751impl core::fmt::Display for OrderStatusSecType {
12752    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12753        match self {
12754            Self::Stk => write!(f, "STK"),
12755            Self::Opt => write!(f, "OPT"),
12756            Self::Fut => write!(f, "FUT"),
12757            Self::Fop => write!(f, "FOP"),
12758            Self::Cash => write!(f, "CASH"),
12759            Self::Crypto => write!(f, "CRYPTO"),
12760            Self::Bond => write!(f, "BOND"),
12761            Self::War => write!(f, "WAR"),
12762            Self::Fund => write!(f, "FUND"),
12763        }
12764    }
12765}
12766/// Time in force of the order ticket.
12767#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
12768pub enum OrderStatusTif {
12769    #[serde(rename = "DAY")]
12770    #[default]
12771    Day,
12772    #[serde(rename = "IOC")]
12773    Ioc,
12774    #[serde(rename = "GTC")]
12775    Gtc,
12776    #[serde(rename = "OPG")]
12777    Opg,
12778    #[serde(rename = "PAX")]
12779    Pax,
12780}
12781impl core::fmt::Display for OrderStatusTif {
12782    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12783        match self {
12784            Self::Day => write!(f, "DAY"),
12785            Self::Ioc => write!(f, "IOC"),
12786            Self::Gtc => write!(f, "GTC"),
12787            Self::Opg => write!(f, "OPG"),
12788            Self::Pax => write!(f, "PAX"),
12789        }
12790    }
12791}
12792/// Indicates that the order reply message or submission was not accepted.
12793#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12794pub struct OrderSubmitError {
12795    /// Message indicating that order submission was not successful.
12796    pub error: Option<String>,
12797}
12798/// A successful submission of one or more order tickets.
12799pub type OrderSubmitSuccess = Vec<OrderSubmitSuccessOrderSubmitSuccess>;
12800/// Result of successful submission of one order ticket.
12801#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
12802pub struct OrderSubmitSuccessOrderSubmitSuccess {
12803    /// Internal use only.
12804    pub encrypt_message: Option<String>,
12805    /// The order ID assigned to your order ticket by IB. Contains only numerals.
12806    pub order_id: Option<String>,
12807    /// Status describing where the order stands in its lifecycle.
12808    pub order_status: Option<String>,
12809}
12810#[serde_with::skip_serializing_none]
12811#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
12812pub struct OrdersSubmissionRequest {
12813    /// Array of order tickets objects. Only one order ticket object may be submitted per request, unless constructing a bracket.
12814    #[validate(nested)]
12815    pub orders: Option<Vec<SingleOrderSubmissionRequest>>,
12816}
12817/// Query status of account by accountId<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
12818#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12819pub struct PatchGwApiV1AccountsAccountidStatusRequest {
12820    #[validate(nested)]
12821    pub path: PatchGwApiV1AccountsAccountidStatusRequestPath,
12822    pub body: AccountRequestBody,
12823}
12824impl PatchGwApiV1AccountsAccountidStatusRequest {
12825    /// Parse the HTTP response into the response enum.
12826    pub async fn parse_response(
12827        req: reqwest::Response,
12828    ) -> anyhow::Result<GetGwApiV1AccountsAccountidStatusResponse> {
12829        let status = req.status();
12830        if status == http::StatusCode::OK {
12831            let data =
12832                oas3_gen_support::Diagnostics::<AccountStatusResponse>::json_with_diagnostics(req)
12833                    .await?;
12834            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Ok(data));
12835        }
12836        if status == http::StatusCode::BAD_REQUEST {
12837            let _ = req.bytes().await?;
12838            return Ok(GetGwApiV1AccountsAccountidStatusResponse::BadRequest);
12839        }
12840        if status == http::StatusCode::UNAUTHORIZED {
12841            let _ = req.bytes().await?;
12842            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Unauthorized);
12843        }
12844        if status == http::StatusCode::FORBIDDEN {
12845            let _ = req.bytes().await?;
12846            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Forbidden);
12847        }
12848        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
12849            let _ = req.bytes().await?;
12850            return Ok(GetGwApiV1AccountsAccountidStatusResponse::UnsupportedMediaType);
12851        }
12852        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12853            let _ = req.bytes().await?;
12854            return Ok(GetGwApiV1AccountsAccountidStatusResponse::InternalServerError);
12855        }
12856        let _ = req.bytes().await?;
12857        return Ok(GetGwApiV1AccountsAccountidStatusResponse::Unknown);
12858    }
12859}
12860#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
12861pub struct PatchGwApiV1AccountsAccountidStatusRequestPath {
12862    #[validate(length(min = 1u64))]
12863    pub account_id: String,
12864}
12865/// Task status can be updated from this api<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
12866#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12867pub struct PatchGwApiV1AccountsAccountidTasksRequest {
12868    #[validate(nested)]
12869    pub path: PatchGwApiV1AccountsAccountidTasksRequestPath,
12870    pub body: AccountRequestBody,
12871}
12872impl PatchGwApiV1AccountsAccountidTasksRequest {
12873    /// Parse the HTTP response into the response enum.
12874    pub async fn parse_response(
12875        req: reqwest::Response,
12876    ) -> anyhow::Result<PostGwApiV1AccountsAccountidTasksResponse> {
12877        let status = req.status();
12878        if status == http::StatusCode::OK {
12879            let data =
12880                oas3_gen_support::Diagnostics::<Task200Response2>::json_with_diagnostics(req)
12881                    .await?;
12882            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Ok(data));
12883        }
12884        if status == http::StatusCode::BAD_REQUEST {
12885            let _ = req.bytes().await?;
12886            return Ok(PostGwApiV1AccountsAccountidTasksResponse::BadRequest);
12887        }
12888        if status == http::StatusCode::UNAUTHORIZED {
12889            let _ = req.bytes().await?;
12890            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Unauthorized);
12891        }
12892        if status == http::StatusCode::FORBIDDEN {
12893            let _ = req.bytes().await?;
12894            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Forbidden);
12895        }
12896        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
12897            let _ = req.bytes().await?;
12898            return Ok(PostGwApiV1AccountsAccountidTasksResponse::UnsupportedMediaType);
12899        }
12900        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12901            let _ = req.bytes().await?;
12902            return Ok(PostGwApiV1AccountsAccountidTasksResponse::InternalServerError);
12903        }
12904        let _ = req.bytes().await?;
12905        return Ok(PostGwApiV1AccountsAccountidTasksResponse::Unknown);
12906    }
12907}
12908#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
12909pub struct PatchGwApiV1AccountsAccountidTasksRequestPath {
12910    #[validate(length(min = 1u64))]
12911    pub account_id: String,
12912}
12913/// Update information for an existing accountId<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
12914#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12915pub struct PatchGwApiV1AccountsRequest {
12916    pub body: AccountRequestBody,
12917}
12918impl PatchGwApiV1AccountsRequest {
12919    /// Parse the HTTP response into the response enum.
12920    pub async fn parse_response(
12921        req: reqwest::Response,
12922    ) -> anyhow::Result<PostGwApiV1AccountsResponse> {
12923        let status = req.status();
12924        if status == http::StatusCode::OK {
12925            let data =
12926                oas3_gen_support::Diagnostics::<StatusResponse>::json_with_diagnostics(req).await?;
12927            return Ok(PostGwApiV1AccountsResponse::Ok(data));
12928        }
12929        if status == http::StatusCode::BAD_REQUEST {
12930            let _ = req.bytes().await?;
12931            return Ok(PostGwApiV1AccountsResponse::BadRequest);
12932        }
12933        if status == http::StatusCode::UNAUTHORIZED {
12934            let _ = req.bytes().await?;
12935            return Ok(PostGwApiV1AccountsResponse::Unauthorized);
12936        }
12937        if status == http::StatusCode::FORBIDDEN {
12938            let _ = req.bytes().await?;
12939            return Ok(PostGwApiV1AccountsResponse::Forbidden);
12940        }
12941        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
12942            let _ = req.bytes().await?;
12943            return Ok(PostGwApiV1AccountsResponse::UnsupportedMediaType);
12944        }
12945        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12946            let _ = req.bytes().await?;
12947            return Ok(PostGwApiV1AccountsResponse::InternalServerError);
12948        }
12949        let _ = req.bytes().await?;
12950        return Ok(PostGwApiV1AccountsResponse::Unknown);
12951    }
12952}
12953/// This api will be used to update the status of am request<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `Signed JWT`
12954#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
12955pub struct PatchGwApiV1RequestsRequestidStatusRequest {
12956    pub path: PatchGwApiV1RequestsRequestidStatusRequestPath,
12957    pub body: AccountRequestBody,
12958}
12959impl PatchGwApiV1RequestsRequestidStatusRequest {
12960    /// Parse the HTTP response into the response enum.
12961    pub async fn parse_response(
12962        req: reqwest::Response,
12963    ) -> anyhow::Result<PatchGwApiV1RequestsRequestidStatusResponse> {
12964        let status = req.status();
12965        if status == http::StatusCode::OK {
12966            let data =
12967                oas3_gen_support::Diagnostics::<AmRequestStatusResponse>::json_with_diagnostics(
12968                    req,
12969                )
12970                .await?;
12971            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::Ok(data));
12972        }
12973        if status == http::StatusCode::BAD_REQUEST {
12974            let _ = req.bytes().await?;
12975            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::BadRequest);
12976        }
12977        if status == http::StatusCode::UNAUTHORIZED {
12978            let _ = req.bytes().await?;
12979            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::Unauthorized);
12980        }
12981        if status == http::StatusCode::FORBIDDEN {
12982            let _ = req.bytes().await?;
12983            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::Forbidden);
12984        }
12985        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
12986            let _ = req.bytes().await?;
12987            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::UnsupportedMediaType);
12988        }
12989        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
12990            let _ = req.bytes().await?;
12991            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::InternalServerError);
12992        }
12993        let _ = req.bytes().await?;
12994        return Ok(PatchGwApiV1RequestsRequestidStatusResponse::Unknown);
12995    }
12996}
12997#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
12998pub struct PatchGwApiV1RequestsRequestidStatusRequestPath {
12999    pub request_id: i32,
13000}
13001/// Response types for patch_gw_api_v1_requests_requestid_status
13002#[derive(Debug, Clone)]
13003pub enum PatchGwApiV1RequestsRequestidStatusResponse {
13004    ///200: This api will be used to update the status of am request
13005    Ok(AmRequestStatusResponse),
13006    ///400: Returns error description representing bad request
13007    BadRequest,
13008    ///401: Returns error description representing access issue
13009    Unauthorized,
13010    ///403: Returns error description representing access issue
13011    Forbidden,
13012    ///415: Unsupported Media Type
13013    UnsupportedMediaType,
13014    ///500: Returns error description representing internal server error
13015    InternalServerError,
13016    ///default: Unknown response
13017    Unknown,
13018}
13019#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13020pub struct PendingTask {
13021    pub action: Option<String>,
13022    #[serde(rename = "au10tixCreatedDate")]
13023    pub au10tix_created_date: Option<chrono::DateTime<chrono::Utc>>,
13024    #[serde(rename = "au10tixExpiryDate")]
13025    pub au10tix_expiry_date: Option<chrono::DateTime<chrono::Utc>>,
13026    #[serde(rename = "documentRejectReason")]
13027    pub document_reject_reason: Option<Vec<String>>,
13028    #[serde(rename = "entityId")]
13029    pub entity_id: Option<i32>,
13030    #[serde(rename = "externalId")]
13031    pub external_id: Option<String>,
13032    #[serde(rename = "formName")]
13033    pub form_name: Option<String>,
13034    #[serde(rename = "formNumber")]
13035    pub form_number: Option<i32>,
13036    #[serde(rename = "onlineTask")]
13037    pub online_task: Option<bool>,
13038    #[serde(rename = "questionIds")]
13039    pub question_ids: Option<Vec<i32>>,
13040    #[serde(rename = "requiredForApproval")]
13041    pub required_for_approval: Option<bool>,
13042    #[serde(rename = "requiredForTrading")]
13043    pub required_for_trading: Option<bool>,
13044    #[serde(rename = "startDate")]
13045    pub start_date: Option<chrono::DateTime<chrono::Utc>>,
13046    pub state: Option<String>,
13047    #[serde(rename = "taskNumber")]
13048    pub task_number: Option<i32>,
13049    pub url: Option<String>,
13050}
13051#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13052pub struct PendingTasksResponse {
13053    #[serde(rename = "accountId")]
13054    pub account_id: Option<String>,
13055    pub description: Option<String>,
13056    pub error: Option<Box<ErrorResponse>>,
13057    #[serde(rename = "errorDescription")]
13058    pub error_description: Option<String>,
13059    #[serde(rename = "hasError")]
13060    pub has_error: Option<bool>,
13061    #[serde(rename = "pendingTaskPresent")]
13062    pub pending_task_present: Option<bool>,
13063    #[serde(rename = "pendingTasks")]
13064    pub pending_tasks: Option<Vec<PendingTask>>,
13065    pub state: Option<String>,
13066    pub status: Option<String>,
13067}
13068#[serde_with::skip_serializing_none]
13069#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
13070#[serde(default)]
13071pub struct PerformanceRequestBody {
13072    /// An array of strings containing each account identifier to retrieve performance details for.
13073    #[serde(rename = "acctIds")]
13074    pub acct_ids: Option<Vec<serde_json::Value>>,
13075    /// Specify the period for which the account should be analyzed. Available period lengths:
13076    ///   * `1D` - The last 24 hours.
13077    ///   * `7D` - The last 7 full days.
13078    ///   * `MTD` - Performance since the 1st of the month.
13079    ///   * `1M` - A full calendar month from the last full trade day.
13080    ///   * `3M` - 3 full calendar months from the last full trade day.
13081    ///   * `6M` - 6 full calendar months from the last full trade day.
13082    ///   * `12M` - 12 full calendar month from the last full trade day.
13083    ///   * `YTD` - Performance since January 1st.
13084    #[default(Some(Default::default()))]
13085    pub period: Option<PerformanceRequestBodyPeriod>,
13086}
13087/// Specify the period for which the account should be analyzed. Available period lengths:
13088///   * `1D` - The last 24 hours.
13089///   * `7D` - The last 7 full days.
13090///   * `MTD` - Performance since the 1st of the month.
13091///   * `1M` - A full calendar month from the last full trade day.
13092///   * `3M` - 3 full calendar months from the last full trade day.
13093///   * `6M` - 6 full calendar months from the last full trade day.
13094///   * `12M` - 12 full calendar month from the last full trade day.
13095///   * `YTD` - Performance since January 1st.
13096#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
13097pub enum PerformanceRequestBodyPeriod {
13098    #[serde(rename = "1D")]
13099    #[default]
13100    T1d,
13101    #[serde(rename = "7D")]
13102    T7d,
13103    #[serde(rename = "MTD")]
13104    Mtd,
13105    #[serde(rename = "1M")]
13106    T1m,
13107    #[serde(rename = "3M")]
13108    T3m,
13109    #[serde(rename = "6M")]
13110    T6m,
13111    #[serde(rename = "12M")]
13112    T12m,
13113    #[serde(rename = "YTD")]
13114    Ytd,
13115}
13116impl core::fmt::Display for PerformanceRequestBodyPeriod {
13117    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13118        match self {
13119            Self::T1d => write!(f, "1D"),
13120            Self::T7d => write!(f, "7D"),
13121            Self::Mtd => write!(f, "MTD"),
13122            Self::T1m => write!(f, "1M"),
13123            Self::T3m => write!(f, "3M"),
13124            Self::T6m => write!(f, "6M"),
13125            Self::T12m => write!(f, "12M"),
13126            Self::Ytd => write!(f, "YTD"),
13127        }
13128    }
13129}
13130#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13131pub struct PerformanceResponse {
13132    /// Returns the object containing the Cumulative performance data.
13133    pub cps: Option<PerformanceResponseCps>,
13134    /// Confirms if the currency type. If trading exclusively in your base currency, "base" will be returned.
13135    #[serde(rename = "currencyType")]
13136    pub currency_type: Option<String>,
13137    /// Returns the request identifier, getPerformanceData.
13138    pub id: Option<String>,
13139    /// Returns an array containing accounts reviewed.
13140    pub included: Option<Vec<serde_json::Value>>,
13141    /// Net asset value data for the account or consolidated accounts. NAV data is not applicable to benchmarks.
13142    pub nav: Option<PerformanceResponseNav>,
13143    /// Returns the total data points.
13144    pub nd: Option<i32>,
13145    /// Portfolio Measure. Used to indicate TWR or MWR values returned.
13146    pub pm: Option<String>,
13147    /// Returns the data identifier (Internal Use Only).
13148    pub rc: Option<i32>,
13149    /// Returns the time period performance data.
13150    pub tpps: Option<PerformanceResponseTpps>,
13151}
13152/// Returns the object containing the Cumulative performance data.
13153#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13154pub struct PerformanceResponseCps {
13155    /// Returns the array of cps data available.
13156    pub data: Option<Vec<PerformanceResponseCpsDatum>>,
13157    /// Returns the dates corresponding to the frequency of data.
13158    pub dates: Option<Vec<serde_json::Value>>,
13159    /// Returns the determining frequency of the data range.
13160    pub freq: Option<String>,
13161}
13162#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13163pub struct PerformanceResponseCpsDatum {
13164    /// Returns the base curency for the account.
13165    #[serde(rename = "baseCurrency")]
13166    pub base_currency: Option<String>,
13167    /// Returns the ending value of the value range.
13168    pub end: Option<String>,
13169    /// Returns the account identifier.
13170    pub id: Option<String>,
13171    /// Returns the key value of the request.
13172    #[serde(rename = "idType")]
13173    pub id_type: Option<String>,
13174    /// Returns all cps values in order between the start and end times.
13175    pub returns: Option<Vec<serde_json::Value>>,
13176    /// Returns the starting value of the value range.
13177    pub start: Option<String>,
13178}
13179/// Net asset value data for the account or consolidated accounts. NAV data is not applicable to benchmarks.
13180#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13181pub struct PerformanceResponseNav {
13182    /// Contains the affiliated 'nav' data.
13183    pub data: Option<Vec<PerformanceResponseNavDatum>>,
13184    /// Returns the array of dates formatted as strings corresponding to your frequency, the length should be same as the length of returns inside data.
13185    pub dates: Option<Vec<serde_json::Value>>,
13186    /// Displays the values corresponding to a given frequency.
13187    pub freq: Option<String>,
13188}
13189#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13190pub struct PerformanceResponseNavDatum {
13191    /// Returns the base currency used in the account.
13192    #[serde(rename = "baseCurrency")]
13193    pub base_currency: Option<String>,
13194    /// Returns the end of the available frequency.
13195    pub end: Option<String>,
13196    /// Returns the account identifier.
13197    pub id: Option<String>,
13198    /// Returns how identifiers are determined.
13199    #[serde(rename = "idType")]
13200    pub id_type: Option<String>,
13201    /// Returns sequential data points corresponding to the net asset value between the "start" and "end" days.
13202    pub navs: Option<Vec<serde_json::Value>>,
13203    /// Returns the first available date for data.
13204    pub start: Option<String>,
13205    /// Returns the intiial NAV available.
13206    #[serde(rename = "startNAV")]
13207    pub start_nav: Option<PerformanceResponseNavDatumStartNav>,
13208}
13209/// Returns the intiial NAV available.
13210#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13211pub struct PerformanceResponseNavDatumStartNav {
13212    /// Returns the starting date for the request.
13213    pub date: Option<String>,
13214    /// Returns the Net Asset Value of the account.
13215    pub val: Option<f64>,
13216}
13217/// Returns the time period performance data.
13218#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13219pub struct PerformanceResponseTpps {
13220    /// Object containing all data about tpps.
13221    pub data: Option<Vec<PerformanceResponseCpsDatum>>,
13222    /// Returns the dates corresponding to the frequency of data.
13223    pub dates: Option<Vec<serde_json::Value>>,
13224    /// Returns the determining frequency of the data range.
13225    pub freq: Option<String>,
13226}
13227#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13228pub struct PnlPartitionedResponse {
13229    /// Refers to the U accounts PnL. This does reference Realized Profit and Loss.
13230    pub upnl: Option<PnlPartitionedResponseUpnl>,
13231}
13232/// Refers to the U accounts PnL. This does reference Realized Profit and Loss.
13233#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13234pub struct PnlPartitionedResponseUpnl {
13235    /// The account or model's Profit and Loss.
13236    #[serde(rename = "U1234567.Core")]
13237    pub u1234567_core: Option<PnlPartitionedResponseUpnlU1234567Core>,
13238}
13239/// The account or model's Profit and Loss.
13240#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13241pub struct PnlPartitionedResponseUpnlU1234567Core {
13242    /// Daily PnL for the specified account profile.
13243    pub dpl: Option<f64>,
13244    /// Excess Liquidity for the specified account profile.
13245    pub el: Option<f64>,
13246    /// Margin value for the specified account profile.
13247    pub mv: Option<f64>,
13248    /// Net Liquidity for the specified account profile.
13249    pub nl: Option<f64>,
13250    /// Returns the positional value of the returned account. Always returns 1 for individual accounts.
13251    #[serde(rename = "rowType")]
13252    pub row_type: Option<i32>,
13253    /// Unrealized PnL for the specified account profile.
13254    pub upl: Option<f64>,
13255}
13256#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13257pub struct PollingInstructionResult {
13258    /// - Example: `1012983.0`
13259    #[serde(rename = "clientInstructionId")]
13260    pub client_instruction_id: f64,
13261    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
13262    pub description: Option<String>,
13263    pub error: Option<ResultError>,
13264    /// - Example: `Some(23456745.0)`
13265    #[serde(rename = "ibReferenceId")]
13266    pub ib_reference_id: Option<f64>,
13267    /// - Example: `45123654.0`
13268    #[serde(rename = "instructionId")]
13269    pub instruction_id: f64,
13270    /// - Example: `"PENDING"`
13271    #[serde(rename = "instructionStatus")]
13272    pub instruction_status: PollingInstructionResultInstructionStatus,
13273    /// - Example: `"INTERNAL_CASH_TRANSFER"`
13274    #[serde(rename = "instructionType")]
13275    pub instruction_type: InstructionResultInstructionType,
13276}
13277#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
13278pub enum PollingInstructionResultInstructionStatus {
13279    #[serde(rename = "PENDING")]
13280    #[default]
13281    Pending,
13282    #[serde(rename = "REJECTED")]
13283    Rejected,
13284    #[serde(rename = "PROCESSED")]
13285    Processed,
13286}
13287impl core::fmt::Display for PollingInstructionResultInstructionStatus {
13288    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13289        match self {
13290            Self::Pending => write!(f, "PENDING"),
13291            Self::Rejected => write!(f, "REJECTED"),
13292            Self::Processed => write!(f, "PROCESSED"),
13293        }
13294    }
13295}
13296/// Array of position objects, each defining a position held in the account.
13297pub type Portfolio2Positions = Vec<Portfolio2PositionsPortfolio2position>;
13298#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13299pub struct Portfolio2PositionsPortfolio2position {
13300    /// Asset class of the requested instrument.
13301    #[serde(rename = "assetClass")]
13302    pub asset_class: Option<String>,
13303    /// The account's average cost for its position.
13304    #[serde(rename = "avgCost")]
13305    pub avg_cost: Option<serde_json::Value>,
13306    /// The account's average price for its position.
13307    #[serde(rename = "avgPrice")]
13308    pub avg_price: Option<f64>,
13309    /// IB contract ID for the instrument.
13310    pub conid: Option<i32>,
13311    /// Currency in which the instrument trades.
13312    pub currency: Option<String>,
13313    /// Contract's local symbol
13314    pub description: Option<String>,
13315    /// Industry sub-categorization of the instrument.
13316    pub group: Option<String>,
13317    #[serde(rename = "isLastToLoq")]
13318    pub is_last_to_loq: Option<bool>,
13319    /// Current market price of the instrument, in the instrument's currency.
13320    #[serde(rename = "marketPrice")]
13321    pub market_price: Option<f64>,
13322    /// Current market value of the account's position in the instrument, in the instrument's currency.
13323    #[serde(rename = "marketValue")]
13324    pub market_value: Option<f64>,
13325    /// Name of the model portfolio in which the account is invested that contributes this position.
13326    pub model: Option<String>,
13327    /// Size of position in units of instrument.
13328    pub position: Option<f64>,
13329    /// Realized PnL for the instrument in the instrument's currency.
13330    #[serde(rename = "realizedPnl")]
13331    pub realized_pnl: Option<f64>,
13332    /// The security type of the instrument.
13333    #[serde(rename = "secType")]
13334    pub sec_type: Option<String>,
13335    /// Industry sector categorization of the instrument.
13336    pub sector: Option<String>,
13337    /// Time taken to retrieve position data in milliseconds.
13338    pub timestamp: Option<i32>,
13339    /// Unrealized PnL for the instrument in the account.
13340    #[serde(rename = "unrealizedPnl")]
13341    pub unrealized_pnl: Option<f64>,
13342}
13343#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13344pub struct PortfolioAllocations {
13345    /// Object containing values of positions sorted by long/short and asset class.
13346    #[serde(rename = "assetClass")]
13347    pub asset_class: Option<PortfolioAllocationsAssetClass>,
13348    /// Object containing values of positions sorted by long/short and Sector Group.
13349    pub group: Option<PortfolioAllocationsGroup>,
13350    /// Object containing values of positions sorted by long/short and Sector.
13351    pub sector: Option<PortfolioAllocationsSector>,
13352}
13353/// Object containing values of positions sorted by long/short and asset class.
13354#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13355pub struct PortfolioAllocationsAssetClass {
13356    /// Object containing value of long positions in the account aggregated by asset class.
13357    pub long: Option<std::collections::HashMap<String, f64>>,
13358    /// Object containing value of short positions in the account aggregated by asset class.
13359    pub short: Option<std::collections::HashMap<String, f64>>,
13360}
13361/// Object containing values of positions sorted by long/short and Sector Group.
13362#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13363pub struct PortfolioAllocationsGroup {
13364    /// Object containing value of long positions in the account aggregated by Sector Group.
13365    pub long: Option<std::collections::HashMap<String, f64>>,
13366    /// Object containing value of short positions in the account aggregated by Sector Group.
13367    pub short: Option<std::collections::HashMap<String, f64>>,
13368}
13369/// Object containing values of positions sorted by long/short and Sector.
13370#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13371pub struct PortfolioAllocationsSector {
13372    /// Object containing value of long positions in the account aggregated by Sector.
13373    pub long: Option<std::collections::HashMap<String, f64>>,
13374    /// Object containing value of short positions in the account aggregated by Sector.
13375    pub short: Option<std::collections::HashMap<String, f64>>,
13376}
13377#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13378pub struct PortfolioSummary {
13379    pub accountcode: Option<serde_json::Value>,
13380    pub accountready: Option<serde_json::Value>,
13381    pub accounttype: Option<serde_json::Value>,
13382    pub accruedcash: Option<serde_json::Value>,
13383    #[serde(rename = "accruedcash-c")]
13384    pub accruedcash_c: Option<serde_json::Value>,
13385    #[serde(rename = "accruedcash-s")]
13386    pub accruedcash_s: Option<serde_json::Value>,
13387    pub accrueddividend: Option<serde_json::Value>,
13388    #[serde(rename = "accrueddividend-c")]
13389    pub accrueddividend_c: Option<serde_json::Value>,
13390    #[serde(rename = "accrueddividend-s")]
13391    pub accrueddividend_s: Option<serde_json::Value>,
13392    pub availablefunds: Option<serde_json::Value>,
13393    #[serde(rename = "availablefunds-c")]
13394    pub availablefunds_c: Option<serde_json::Value>,
13395    #[serde(rename = "availablefunds-s")]
13396    pub availablefunds_s: Option<serde_json::Value>,
13397    pub availabletotrade: Option<serde_json::Value>,
13398    #[serde(rename = "availabletotrade-c")]
13399    pub availabletotrade_c: Option<serde_json::Value>,
13400    #[serde(rename = "availabletotrade-s")]
13401    pub availabletotrade_s: Option<serde_json::Value>,
13402    pub availabletowithdraw: Option<serde_json::Value>,
13403    #[serde(rename = "availabletowithdraw-c")]
13404    pub availabletowithdraw_c: Option<serde_json::Value>,
13405    #[serde(rename = "availabletowithdraw-s")]
13406    pub availabletowithdraw_s: Option<serde_json::Value>,
13407    pub billable: Option<serde_json::Value>,
13408    #[serde(rename = "billable-c")]
13409    pub billable_c: Option<serde_json::Value>,
13410    #[serde(rename = "billable-s")]
13411    pub billable_s: Option<serde_json::Value>,
13412    pub buyingpower: Option<serde_json::Value>,
13413    #[serde(rename = "columnprio-c")]
13414    pub columnprio_c: Option<serde_json::Value>,
13415    #[serde(rename = "columnprio-s")]
13416    pub columnprio_s: Option<serde_json::Value>,
13417    pub cushion: Option<serde_json::Value>,
13418    pub daytradesremaining: Option<serde_json::Value>,
13419    #[serde(rename = "daytradesremainingt+1")]
13420    pub daytradesremainingt_1: Option<serde_json::Value>,
13421    #[serde(rename = "daytradesremainingt+2")]
13422    pub daytradesremainingt_2: Option<serde_json::Value>,
13423    #[serde(rename = "daytradesremainingt+3")]
13424    pub daytradesremainingt_3: Option<serde_json::Value>,
13425    #[serde(rename = "daytradesremainingt+4")]
13426    pub daytradesremainingt_4: Option<serde_json::Value>,
13427    #[serde(rename = "daytradingstatus-s")]
13428    pub daytradingstatus_s: Option<serde_json::Value>,
13429    pub depositoncredithold: Option<serde_json::Value>,
13430    pub equitywithloanvalue: Option<serde_json::Value>,
13431    #[serde(rename = "equitywithloanvalue-c")]
13432    pub equitywithloanvalue_c: Option<serde_json::Value>,
13433    #[serde(rename = "equitywithloanvalue-s")]
13434    pub equitywithloanvalue_s: Option<serde_json::Value>,
13435    pub excessliquidity: Option<serde_json::Value>,
13436    #[serde(rename = "excessliquidity-c")]
13437    pub excessliquidity_c: Option<serde_json::Value>,
13438    #[serde(rename = "excessliquidity-s")]
13439    pub excessliquidity_s: Option<serde_json::Value>,
13440    pub fullavailablefunds: Option<serde_json::Value>,
13441    #[serde(rename = "fullavailablefunds-c")]
13442    pub fullavailablefunds_c: Option<serde_json::Value>,
13443    #[serde(rename = "fullavailablefunds-s")]
13444    pub fullavailablefunds_s: Option<serde_json::Value>,
13445    pub fullexcessliquidity: Option<serde_json::Value>,
13446    #[serde(rename = "fullexcessliquidity-c")]
13447    pub fullexcessliquidity_c: Option<serde_json::Value>,
13448    #[serde(rename = "fullexcessliquidity-s")]
13449    pub fullexcessliquidity_s: Option<serde_json::Value>,
13450    pub fullinitmarginreq: Option<serde_json::Value>,
13451    #[serde(rename = "fullinitmarginreq-c")]
13452    pub fullinitmarginreq_c: Option<serde_json::Value>,
13453    #[serde(rename = "fullinitmarginreq-s")]
13454    pub fullinitmarginreq_s: Option<serde_json::Value>,
13455    pub fullmaintmarginreq: Option<serde_json::Value>,
13456    #[serde(rename = "fullmaintmarginreq-c")]
13457    pub fullmaintmarginreq_c: Option<serde_json::Value>,
13458    #[serde(rename = "fullmaintmarginreq-s")]
13459    pub fullmaintmarginreq_s: Option<serde_json::Value>,
13460    pub grosspositionvalue: Option<serde_json::Value>,
13461    #[serde(rename = "grosspositionvalue-s")]
13462    pub grosspositionvalue_s: Option<serde_json::Value>,
13463    pub guarantee: Option<serde_json::Value>,
13464    #[serde(rename = "guarantee-c")]
13465    pub guarantee_c: Option<serde_json::Value>,
13466    #[serde(rename = "guarantee-s")]
13467    pub guarantee_s: Option<serde_json::Value>,
13468    pub highestseverity: Option<serde_json::Value>,
13469    pub indianstockhaircut: Option<serde_json::Value>,
13470    #[serde(rename = "indianstockhaircut-c")]
13471    pub indianstockhaircut_c: Option<serde_json::Value>,
13472    #[serde(rename = "indianstockhaircut-s")]
13473    pub indianstockhaircut_s: Option<serde_json::Value>,
13474    pub initmarginreq: Option<serde_json::Value>,
13475    #[serde(rename = "initmarginreq-c")]
13476    pub initmarginreq_c: Option<serde_json::Value>,
13477    #[serde(rename = "initmarginreq-s")]
13478    pub initmarginreq_s: Option<serde_json::Value>,
13479    #[serde(rename = "leverage-s")]
13480    pub leverage_s: Option<serde_json::Value>,
13481    pub lookaheadavailablefunds: Option<serde_json::Value>,
13482    #[serde(rename = "lookaheadavailablefunds-c")]
13483    pub lookaheadavailablefunds_c: Option<serde_json::Value>,
13484    #[serde(rename = "lookaheadavailablefunds-s")]
13485    pub lookaheadavailablefunds_s: Option<serde_json::Value>,
13486    pub lookaheadexcessliquidity: Option<serde_json::Value>,
13487    #[serde(rename = "lookaheadexcessliquidity-c")]
13488    pub lookaheadexcessliquidity_c: Option<serde_json::Value>,
13489    #[serde(rename = "lookaheadexcessliquidity-s")]
13490    pub lookaheadexcessliquidity_s: Option<serde_json::Value>,
13491    pub lookaheadinitmarginreq: Option<serde_json::Value>,
13492    #[serde(rename = "lookaheadinitmarginreq-c")]
13493    pub lookaheadinitmarginreq_c: Option<serde_json::Value>,
13494    #[serde(rename = "lookaheadinitmarginreq-s")]
13495    pub lookaheadinitmarginreq_s: Option<serde_json::Value>,
13496    pub lookaheadmaintmarginreq: Option<serde_json::Value>,
13497    #[serde(rename = "lookaheadmaintmarginreq-c")]
13498    pub lookaheadmaintmarginreq_c: Option<serde_json::Value>,
13499    #[serde(rename = "lookaheadmaintmarginreq-s")]
13500    pub lookaheadmaintmarginreq_s: Option<serde_json::Value>,
13501    pub lookaheadnextchange: Option<serde_json::Value>,
13502    pub maintmarginreq: Option<serde_json::Value>,
13503    #[serde(rename = "maintmarginreq-c")]
13504    pub maintmarginreq_c: Option<serde_json::Value>,
13505    #[serde(rename = "maintmarginreq-s")]
13506    pub maintmarginreq_s: Option<serde_json::Value>,
13507    pub netliquidation: Option<serde_json::Value>,
13508    #[serde(rename = "netliquidation-c")]
13509    pub netliquidation_c: Option<serde_json::Value>,
13510    #[serde(rename = "netliquidation-s")]
13511    pub netliquidation_s: Option<serde_json::Value>,
13512    pub netliquidationuncertainty: Option<serde_json::Value>,
13513    pub nlvandmargininreview: Option<serde_json::Value>,
13514    pub pasharesvalue: Option<serde_json::Value>,
13515    #[serde(rename = "pasharesvalue-c")]
13516    pub pasharesvalue_c: Option<serde_json::Value>,
13517    #[serde(rename = "pasharesvalue-s")]
13518    pub pasharesvalue_s: Option<serde_json::Value>,
13519    pub physicalcertificatevalue: Option<serde_json::Value>,
13520    #[serde(rename = "physicalcertificatevalue-c")]
13521    pub physicalcertificatevalue_c: Option<serde_json::Value>,
13522    #[serde(rename = "physicalcertificatevalue-s")]
13523    pub physicalcertificatevalue_s: Option<serde_json::Value>,
13524    pub postexpirationexcess: Option<serde_json::Value>,
13525    #[serde(rename = "postexpirationexcess-c")]
13526    pub postexpirationexcess_c: Option<serde_json::Value>,
13527    #[serde(rename = "postexpirationexcess-s")]
13528    pub postexpirationexcess_s: Option<serde_json::Value>,
13529    pub postexpirationmargin: Option<serde_json::Value>,
13530    #[serde(rename = "postexpirationmargin-c")]
13531    pub postexpirationmargin_c: Option<serde_json::Value>,
13532    #[serde(rename = "postexpirationmargin-s")]
13533    pub postexpirationmargin_s: Option<serde_json::Value>,
13534    pub previousdayequitywithloanvalue: Option<serde_json::Value>,
13535    #[serde(rename = "previousdayequitywithloanvalue-s")]
13536    pub previousdayequitywithloanvalue_s: Option<serde_json::Value>,
13537    pub regtequity: Option<serde_json::Value>,
13538    #[serde(rename = "regtequity-s")]
13539    pub regtequity_s: Option<serde_json::Value>,
13540    pub regtmargin: Option<serde_json::Value>,
13541    #[serde(rename = "regtmargin-s")]
13542    pub regtmargin_s: Option<serde_json::Value>,
13543    #[serde(rename = "segmenttitle-c")]
13544    pub segmenttitle_c: Option<serde_json::Value>,
13545    #[serde(rename = "segmenttitle-s")]
13546    pub segmenttitle_s: Option<serde_json::Value>,
13547    pub sma: Option<serde_json::Value>,
13548    #[serde(rename = "sma-s")]
13549    pub sma_s: Option<serde_json::Value>,
13550    pub totalcashvalue: Option<serde_json::Value>,
13551    #[serde(rename = "totalcashvalue-c")]
13552    pub totalcashvalue_c: Option<serde_json::Value>,
13553    #[serde(rename = "totalcashvalue-s")]
13554    pub totalcashvalue_s: Option<serde_json::Value>,
13555    pub totaldebitcardpendingcharges: Option<serde_json::Value>,
13556    #[serde(rename = "totaldebitcardpendingcharges-c")]
13557    pub totaldebitcardpendingcharges_c: Option<serde_json::Value>,
13558    #[serde(rename = "totaldebitcardpendingcharges-s")]
13559    pub totaldebitcardpendingcharges_s: Option<serde_json::Value>,
13560    #[serde(rename = "tradingtype-s")]
13561    pub tradingtype_s: Option<serde_json::Value>,
13562    pub whatifpmenabled: Option<serde_json::Value>,
13563}
13564#[serde_with::skip_serializing_none]
13565#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
13566pub struct PortfolioSummaryValue {
13567    /// Numerical data for the associated key.
13568    pub amount: Option<f64>,
13569    /// The currency in which the value of the 'amount' field is denominated.
13570    pub currency: Option<f64>,
13571    /// Indicates whether the associated key's value does not exist, as opposed to a value of zero.
13572    #[serde(rename = "isNull")]
13573    pub is_null: Option<bool>,
13574    /// severity
13575    pub severity: Option<i32>,
13576    /// Unix epoch timestamp of returned data in milliseconds.
13577    pub timestamp: Option<i32>,
13578    /// String and boolean (non-numerical) data for the associated key.
13579    pub value: Option<String>,
13580}
13581#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
13582pub struct Position200Response {
13583    /// Additional properties not defined in the schema.
13584    #[serde(flatten)]
13585    pub additional_properties: std::collections::HashMap<String, IndividualPosition>,
13586}
13587/// Array of objects reflecting all positions in the given account.
13588pub type Position200Response2 = Vec<IndividualPosition>;
13589#[serde_with::skip_serializing_none]
13590#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
13591pub struct PositionRequestBody {
13592    /// Define the model to retrieve accounts from.
13593    pub model: Option<String>,
13594    /// Request identifier to uniquely track a request.
13595    #[serde(rename = "reqID")]
13596    pub req_id: Option<i32>,
13597    /// Describes if the model is in polling mode.
13598    #[serde(rename = "subscriptionStatus")]
13599    pub subscription_status: Option<i32>,
13600}
13601#[serde_with::skip_serializing_none]
13602#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
13603pub struct PositionRequestBody2 {
13604    /// Maximum number of positions to return.
13605    /// - Example: `Some(10i32)`
13606    pub limit: Option<i32>,
13607    /// Name of your model.
13608    /// - Example: `Some("Sample-Model".to_string())`
13609    pub model: Option<String>,
13610    /// Request identifier to uniquely track a request.
13611    /// - Example: `Some(540_609i32)`
13612    #[serde(rename = "reqID")]
13613    pub req_id: Option<i32>,
13614    /// Direction to sort the request by.
13615    ///  * `ASC` - Sort from greatest to smallest.
13616    ///  * `DESC` - Sort from smallest to greatest.
13617    #[serde(rename = "sortDirection")]
13618    pub sort_direction: Option<PositionRequestBody2SortDirection>,
13619    /// Field to sort the response by.
13620    ///   * `actual` - Current actual model allocation for the instrument.
13621    ///   * `actualRangeMax` - Maximum actual model allocation allowed for the instrument.
13622    ///   * `actualRangeMin` - Minimum actual model allocation allowed for the instrument.
13623    ///   * `ccy` - Currency of the instrument.
13624    ///   * `conid` - Contract identifier, or conid.
13625    ///   * `dlv` - Market value.
13626    ///   * `instrumentImbalance` - How far an instrument's actual allocation is from its model.
13627    ///   * `instrument` - Symbol of the security.
13628    ///   * `mv` - Market value of the model position.
13629    ///   * `position` - Number of shares held by the model.
13630    ///   * `target` - Target percentage of an instrument held within a model.
13631    #[serde(rename = "sortField")]
13632    pub sort_field: Option<PositionRequestBody2SortField>,
13633}
13634/// Direction to sort the request by.
13635///  * `ASC` - Sort from greatest to smallest.
13636///  * `DESC` - Sort from smallest to greatest.
13637#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
13638pub enum PositionRequestBody2SortDirection {
13639    #[serde(rename = "ASC")]
13640    #[default]
13641    Asc,
13642    #[serde(rename = "DESC")]
13643    Desc,
13644}
13645impl core::fmt::Display for PositionRequestBody2SortDirection {
13646    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13647        match self {
13648            Self::Asc => write!(f, "ASC"),
13649            Self::Desc => write!(f, "DESC"),
13650        }
13651    }
13652}
13653/// Field to sort the response by.
13654///   * `actual` - Current actual model allocation for the instrument.
13655///   * `actualRangeMax` - Maximum actual model allocation allowed for the instrument.
13656///   * `actualRangeMin` - Minimum actual model allocation allowed for the instrument.
13657///   * `ccy` - Currency of the instrument.
13658///   * `conid` - Contract identifier, or conid.
13659///   * `dlv` - Market value.
13660///   * `instrumentImbalance` - How far an instrument's actual allocation is from its model.
13661///   * `instrument` - Symbol of the security.
13662///   * `mv` - Market value of the model position.
13663///   * `position` - Number of shares held by the model.
13664///   * `target` - Target percentage of an instrument held within a model.
13665#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
13666pub enum PositionRequestBody2SortField {
13667    #[serde(rename = "actual")]
13668    #[default]
13669    Actual,
13670    #[serde(rename = "actualRangeMax")]
13671    ActualRangeMax,
13672    #[serde(rename = "actualRangeMin")]
13673    ActualRangeMin,
13674    #[serde(rename = "ccy")]
13675    Ccy,
13676    #[serde(rename = "conid")]
13677    Conid,
13678    #[serde(rename = "dlv")]
13679    Dlv,
13680    #[serde(rename = "instrumentImbalance")]
13681    InstrumentImbalance,
13682    #[serde(rename = "instrument")]
13683    Instrument,
13684    #[serde(rename = "mismatchType")]
13685    MismatchType,
13686    #[serde(rename = "mv")]
13687    Mv,
13688    #[serde(rename = "position")]
13689    Position,
13690    #[serde(rename = "target")]
13691    Target,
13692}
13693impl core::fmt::Display for PositionRequestBody2SortField {
13694    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13695        match self {
13696            Self::Actual => write!(f, "actual"),
13697            Self::ActualRangeMax => write!(f, "actualRangeMax"),
13698            Self::ActualRangeMin => write!(f, "actualRangeMin"),
13699            Self::Ccy => write!(f, "ccy"),
13700            Self::Conid => write!(f, "conid"),
13701            Self::Dlv => write!(f, "dlv"),
13702            Self::InstrumentImbalance => write!(f, "instrumentImbalance"),
13703            Self::Instrument => write!(f, "instrument"),
13704            Self::MismatchType => write!(f, "mismatchType"),
13705            Self::Mv => write!(f, "mv"),
13706            Self::Position => write!(f, "position"),
13707            Self::Target => write!(f, "target"),
13708        }
13709    }
13710}
13711/// Task can be assigned from this api<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
13712#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
13713pub struct PostGwApiV1AccountsAccountidTasksRequest {
13714    #[validate(nested)]
13715    pub path: PostGwApiV1AccountsAccountidTasksRequestPath,
13716    pub body: AccountRequestBody,
13717}
13718impl PostGwApiV1AccountsAccountidTasksRequest {
13719    /// Parse the HTTP response into the response enum.
13720    pub async fn parse_response(
13721        req: reqwest::Response,
13722    ) -> anyhow::Result<PostGwApiV1AccountsAccountidTasksResponse> {
13723        let status = req.status();
13724        if status == http::StatusCode::OK {
13725            let data =
13726                oas3_gen_support::Diagnostics::<Task200Response2>::json_with_diagnostics(req)
13727                    .await?;
13728            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Ok(data));
13729        }
13730        if status == http::StatusCode::BAD_REQUEST {
13731            let _ = req.bytes().await?;
13732            return Ok(PostGwApiV1AccountsAccountidTasksResponse::BadRequest);
13733        }
13734        if status == http::StatusCode::UNAUTHORIZED {
13735            let _ = req.bytes().await?;
13736            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Unauthorized);
13737        }
13738        if status == http::StatusCode::FORBIDDEN {
13739            let _ = req.bytes().await?;
13740            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Forbidden);
13741        }
13742        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
13743            let _ = req.bytes().await?;
13744            return Ok(PostGwApiV1AccountsAccountidTasksResponse::UnsupportedMediaType);
13745        }
13746        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
13747            let _ = req.bytes().await?;
13748            return Ok(PostGwApiV1AccountsAccountidTasksResponse::InternalServerError);
13749        }
13750        let _ = req.bytes().await?;
13751        return Ok(PostGwApiV1AccountsAccountidTasksResponse::Unknown);
13752    }
13753}
13754#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
13755pub struct PostGwApiV1AccountsAccountidTasksRequestPath {
13756    #[validate(length(min = 1u64))]
13757    pub account_id: String,
13758}
13759/// Response types for post_gw_api_v1_accounts_accountid_tasks
13760#[derive(Debug, Clone)]
13761pub enum PostGwApiV1AccountsAccountidTasksResponse {
13762    ///200: Task can be assigned from this api
13763    Ok(Task200Response2),
13764    ///400: Returns error description representing bad request
13765    BadRequest,
13766    ///401: Returns error description representing access issue
13767    Unauthorized,
13768    ///403: Returns error description representing access issue
13769    Forbidden,
13770    ///415: Unsupported Media Type
13771    UnsupportedMediaType,
13772    ///500: Returns error description representing internal server error
13773    InternalServerError,
13774    ///default: Unknown response
13775    Unknown,
13776}
13777/// Provides mechanism to submit Agreements and Disclosures to IBKR once a day instead of with each application. We store these documents on the servers and will use them for new application requests submitted that day.<ul><li>Documents will need to be submitted once a day (before the Applications are submitted). PDFs will be displayed and submitted as is- no changes/edits will be made to the actual PDF files.</li><li>This end-point will not process any Tax Form Documents. Tax Form document should be submitted with every application</li><li>If submitted in the morning, you only need to include the Tax Form attachment for each applicant. Otherwise, you will need to include PDFs with each application (Create Account).</li></ul><br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
13778#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
13779pub struct PostGwApiV1AccountsDocumentsRequest {
13780    pub body: AccountRequestBody,
13781}
13782impl PostGwApiV1AccountsDocumentsRequest {
13783    /// Parse the HTTP response into the response enum.
13784    pub async fn parse_response(
13785        req: reqwest::Response,
13786    ) -> anyhow::Result<PostGwApiV1AccountsResponse> {
13787        let status = req.status();
13788        if status == http::StatusCode::OK {
13789            let data =
13790                oas3_gen_support::Diagnostics::<StatusResponse>::json_with_diagnostics(req).await?;
13791            return Ok(PostGwApiV1AccountsResponse::Ok(data));
13792        }
13793        if status == http::StatusCode::BAD_REQUEST {
13794            let _ = req.bytes().await?;
13795            return Ok(PostGwApiV1AccountsResponse::BadRequest);
13796        }
13797        if status == http::StatusCode::UNAUTHORIZED {
13798            let _ = req.bytes().await?;
13799            return Ok(PostGwApiV1AccountsResponse::Unauthorized);
13800        }
13801        if status == http::StatusCode::FORBIDDEN {
13802            let _ = req.bytes().await?;
13803            return Ok(PostGwApiV1AccountsResponse::Forbidden);
13804        }
13805        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
13806            let _ = req.bytes().await?;
13807            return Ok(PostGwApiV1AccountsResponse::UnsupportedMediaType);
13808        }
13809        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
13810            let _ = req.bytes().await?;
13811            return Ok(PostGwApiV1AccountsResponse::InternalServerError);
13812        }
13813        let _ = req.bytes().await?;
13814        return Ok(PostGwApiV1AccountsResponse::Unknown);
13815    }
13816}
13817/// Submit account application. This will create brokerage account for the end user.<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
13818#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
13819pub struct PostGwApiV1AccountsRequest {
13820    pub body: AccountRequestBody,
13821}
13822impl PostGwApiV1AccountsRequest {
13823    /// Parse the HTTP response into the response enum.
13824    pub async fn parse_response(
13825        req: reqwest::Response,
13826    ) -> anyhow::Result<PostGwApiV1AccountsResponse> {
13827        let status = req.status();
13828        if status == http::StatusCode::OK {
13829            let data =
13830                oas3_gen_support::Diagnostics::<StatusResponse>::json_with_diagnostics(req).await?;
13831            return Ok(PostGwApiV1AccountsResponse::Ok(data));
13832        }
13833        if status == http::StatusCode::BAD_REQUEST {
13834            let _ = req.bytes().await?;
13835            return Ok(PostGwApiV1AccountsResponse::BadRequest);
13836        }
13837        if status == http::StatusCode::UNAUTHORIZED {
13838            let _ = req.bytes().await?;
13839            return Ok(PostGwApiV1AccountsResponse::Unauthorized);
13840        }
13841        if status == http::StatusCode::FORBIDDEN {
13842            let _ = req.bytes().await?;
13843            return Ok(PostGwApiV1AccountsResponse::Forbidden);
13844        }
13845        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
13846            let _ = req.bytes().await?;
13847            return Ok(PostGwApiV1AccountsResponse::UnsupportedMediaType);
13848        }
13849        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
13850            let _ = req.bytes().await?;
13851            return Ok(PostGwApiV1AccountsResponse::InternalServerError);
13852        }
13853        let _ = req.bytes().await?;
13854        return Ok(PostGwApiV1AccountsResponse::Unknown);
13855    }
13856}
13857/// Response types for post_gw_api_v1_accounts
13858#[derive(Debug, Clone)]
13859pub enum PostGwApiV1AccountsResponse {
13860    ///200: Submit account application. This will create brokerage account for the end user.
13861    Ok(StatusResponse),
13862    ///400: Returns error description representing bad request
13863    BadRequest,
13864    ///401: Returns error description representing access issue
13865    Unauthorized,
13866    ///403: Returns error description representing access issue
13867    Forbidden,
13868    ///415: Unsupported Media Type
13869    UnsupportedMediaType,
13870    ///500: Returns error description representing internal server error
13871    InternalServerError,
13872    ///default: Unknown response
13873    Unknown,
13874}
13875/// View available cash for withdrawal and account equity value by accountId<br><br>**Scope**: `balances.read`<br>**Security Policy**: `Signed JWT`
13876#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
13877pub struct PostGwApiV1BalancesQueryRequest {
13878    pub query: PostGwApiV1BalancesQueryRequestQuery,
13879    /// Create an query request body
13880    pub body: QueryRequestBody,
13881}
13882impl PostGwApiV1BalancesQueryRequest {
13883    /// Parse the HTTP response into the response enum.
13884    pub async fn parse_response(
13885        req: reqwest::Response,
13886    ) -> anyhow::Result<PostGwApiV1BalancesQueryResponse> {
13887        let status = req.status();
13888        if status == http::StatusCode::CREATED {
13889            let _ = req.bytes().await?;
13890            return Ok(PostGwApiV1BalancesQueryResponse::Created);
13891        }
13892        if status == http::StatusCode::BAD_REQUEST {
13893            let _ = req.bytes().await?;
13894            return Ok(PostGwApiV1BalancesQueryResponse::BadRequest);
13895        }
13896        if status == http::StatusCode::FORBIDDEN {
13897            let _ = req.bytes().await?;
13898            return Ok(PostGwApiV1BalancesQueryResponse::Forbidden);
13899        }
13900        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
13901            let _ = req.bytes().await?;
13902            return Ok(PostGwApiV1BalancesQueryResponse::UnprocessableEntity);
13903        }
13904        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
13905            let _ = req.bytes().await?;
13906            return Ok(PostGwApiV1BalancesQueryResponse::InternalServerError);
13907        }
13908        let _ = req.bytes().await?;
13909        return Ok(PostGwApiV1BalancesQueryResponse::Unknown);
13910    }
13911}
13912#[serde_with::skip_serializing_none]
13913#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
13914pub struct PostGwApiV1BalancesQueryRequestQuery {
13915    /// The client's clientId
13916    /// - Example: `Some("abc123".to_string())`
13917    #[serde(rename = "client-id")]
13918    pub client_id: Option<String>,
13919}
13920/// Response types for post_gw_api_v1_balances_query
13921#[derive(Debug, Clone)]
13922pub enum PostGwApiV1BalancesQueryResponse {
13923    ///201: Instruction successfully created and processed synchronously
13924    Created,
13925    ///400: Returns a Problem detail instance representing a bad request.
13926    BadRequest,
13927    ///403: Returns a Problem detail instance representing a forbidden request.
13928    Forbidden,
13929    ///422: Returns a Problem detail instance representing a business error.
13930    UnprocessableEntity,
13931    ///500: Returns a Problem detail instance representing an internal server error.
13932    InternalServerError,
13933    ///default: Unknown response
13934    Unknown,
13935}
13936/// <br>**Scope**: `bank-instructions.write`<br>**Security Policy**: `Signed JWT`
13937#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
13938pub struct PostGwApiV1BankInstructionsBulkRequest {
13939    pub query: PostGwApiV1BankInstructionsBulkRequestQuery,
13940    /// Create Bulk Banking Instructions request body
13941    pub body: BankInstructionsBulkRequestBody,
13942}
13943impl PostGwApiV1BankInstructionsBulkRequest {
13944    /// Parse the HTTP response into the response enum.
13945    pub async fn parse_response(
13946        req: reqwest::Response,
13947    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
13948        let status = req.status();
13949        if status == http::StatusCode::ACCEPTED {
13950            let data = oas3_gen_support::Diagnostics::<
13951                AsynchronousInstructionSetResponse,
13952            >::json_with_diagnostics(req)
13953                .await?;
13954            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
13955        }
13956        if status == http::StatusCode::BAD_REQUEST {
13957            let _ = req.bytes().await?;
13958            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
13959        }
13960        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
13961            let _ = req.bytes().await?;
13962            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
13963        }
13964        let _ = req.bytes().await?;
13965        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
13966    }
13967}
13968#[serde_with::skip_serializing_none]
13969#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
13970pub struct PostGwApiV1BankInstructionsBulkRequestQuery {
13971    /// The client's clientId
13972    /// - Example: `Some("abc123".to_string())`
13973    #[serde(rename = "client-id")]
13974    pub client_id: Option<String>,
13975}
13976/// Response types for post_gw_api_v1_bank_instructions_bulk
13977#[derive(Debug, Clone)]
13978pub enum PostGwApiV1BankInstructionsBulkResponse {
13979    ///202: Accepts all instructions in Bulk request to create them asynchronously
13980    Accepted(AsynchronousInstructionSetResponse),
13981    ///400: Returns a Problem detail instance representing a bad request. Returned even if only one instruction in the bulk upload has syntactical errors.
13982    BadRequest,
13983    ///500: Unable to process request due to an Internal Error. Please try again later.
13984    InternalServerError,
13985    ///default: Unknown response
13986    Unknown,
13987}
13988/// View active bank instructions for an accountId.<br><br>**Scope**: `bank-instructions.read`<br>**Security Policy**: `Signed JWT`
13989#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
13990pub struct PostGwApiV1BankInstructionsQueryRequest {
13991    pub query: PostGwApiV1BankInstructionsQueryRequestQuery,
13992    /// Create get instruction name request body
13993    pub body: QueryRequestBody2,
13994}
13995impl PostGwApiV1BankInstructionsQueryRequest {
13996    /// Parse the HTTP response into the response enum.
13997    pub async fn parse_response(
13998        req: reqwest::Response,
13999    ) -> anyhow::Result<PostGwApiV1BankInstructionsQueryResponse> {
14000        let status = req.status();
14001        if status == http::StatusCode::CREATED {
14002            let data =
14003                oas3_gen_support::Diagnostics::<Query201Response>::json_with_diagnostics(req)
14004                    .await?;
14005            return Ok(PostGwApiV1BankInstructionsQueryResponse::Created(data));
14006        }
14007        if status == http::StatusCode::BAD_REQUEST {
14008            let _ = req.bytes().await?;
14009            return Ok(PostGwApiV1BankInstructionsQueryResponse::BadRequest);
14010        }
14011        if status == http::StatusCode::FORBIDDEN {
14012            let _ = req.bytes().await?;
14013            return Ok(PostGwApiV1BankInstructionsQueryResponse::Forbidden);
14014        }
14015        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14016            let _ = req.bytes().await?;
14017            return Ok(PostGwApiV1BankInstructionsQueryResponse::UnprocessableEntity);
14018        }
14019        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14020            let _ = req.bytes().await?;
14021            return Ok(PostGwApiV1BankInstructionsQueryResponse::InternalServerError);
14022        }
14023        let _ = req.bytes().await?;
14024        return Ok(PostGwApiV1BankInstructionsQueryResponse::Unknown);
14025    }
14026}
14027#[serde_with::skip_serializing_none]
14028#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14029pub struct PostGwApiV1BankInstructionsQueryRequestQuery {
14030    /// The client's clientId
14031    /// - Example: `Some("abc123".to_string())`
14032    #[serde(rename = "client-id")]
14033    pub client_id: Option<String>,
14034}
14035/// Response types for post_gw_api_v1_bank_instructions_query
14036#[derive(Debug, Clone)]
14037pub enum PostGwApiV1BankInstructionsQueryResponse {
14038    ///201: Instruction successfully created and processed synchronously
14039    Created(Query201Response),
14040    ///400: Returns a Problem detail instance representing a bad request.
14041    BadRequest,
14042    ///403: Returns a Problem detail instance representing a forbidden request.
14043    Forbidden,
14044    ///422: Returns a Problem detail instance representing a business error.
14045    UnprocessableEntity,
14046    ///500: Returns a Problem detail instance representing an internal server error.
14047    InternalServerError,
14048    ///default: Unknown response
14049    Unknown,
14050}
14051/// Create or delete bank instructions by accountId. Only ACH and EDDA are supported for 'Create'.<br><br>**Scope**: `bank-instructions.write`<br>**Security Policy**: `Signed JWT`
14052#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14053pub struct PostGwApiV1BankInstructionsRequest {
14054    pub query: PostGwApiV1BankInstructionsRequestQuery,
14055    pub body: InstructionRequestBody,
14056}
14057impl PostGwApiV1BankInstructionsRequest {
14058    /// Parse the HTTP response into the response enum.
14059    pub async fn parse_response(
14060        req: reqwest::Response,
14061    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
14062        let status = req.status();
14063        if status == http::StatusCode::ACCEPTED {
14064            let data = oas3_gen_support::Diagnostics::<
14065                AsynchronousInstructionResponse,
14066            >::json_with_diagnostics(req)
14067                .await?;
14068            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
14069        }
14070        if status == http::StatusCode::BAD_REQUEST {
14071            let _ = req.bytes().await?;
14072            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
14073        }
14074        if status == http::StatusCode::FORBIDDEN {
14075            let _ = req.bytes().await?;
14076            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
14077        }
14078        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14079            let _ = req.bytes().await?;
14080            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
14081        }
14082        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14083            let _ = req.bytes().await?;
14084            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
14085        }
14086        let _ = req.bytes().await?;
14087        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
14088    }
14089}
14090#[serde_with::skip_serializing_none]
14091#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14092pub struct PostGwApiV1BankInstructionsRequestQuery {
14093    /// The client's clientId
14094    /// - Example: `Some("abc123".to_string())`
14095    #[serde(rename = "client-id")]
14096    pub client_id: Option<String>,
14097}
14098/// Response types for post_gw_api_v1_bank_instructions
14099#[derive(Debug, Clone)]
14100pub enum PostGwApiV1BankInstructionsResponse {
14101    ///202: Accepts request to create a new instruction asynchronously
14102    Accepted(AsynchronousInstructionResponse),
14103    ///400: Returns a Problem detail instance representing a bad request.
14104    BadRequest,
14105    ///403: Returns a Problem detail instance representing a forbidden request.
14106    Forbidden,
14107    ///422: Returns a Problem detail instance representing a business error.
14108    UnprocessableEntity,
14109    ///500: Returns a Problem detail instance representing an internal server error.
14110    InternalServerError,
14111    ///default: Unknown response
14112    Unknown,
14113}
14114/// <br>**Scope**: `echo.write`<br>**Security Policy**: `Signed JWT`
14115#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14116pub struct PostGwApiV1EchoSignedJwtRequest {
14117    /// Create a Signed JWT echo request.
14118    pub body: AccountRequestBody,
14119}
14120impl PostGwApiV1EchoSignedJwtRequest {
14121    /// Parse the HTTP response into the response enum.
14122    pub async fn parse_response(
14123        req: reqwest::Response,
14124    ) -> anyhow::Result<GetGwApiV1EchoHttpsResponse> {
14125        let status = req.status();
14126        if status == http::StatusCode::OK {
14127            let data =
14128                oas3_gen_support::Diagnostics::<EchoResponse>::json_with_diagnostics(req).await?;
14129            return Ok(GetGwApiV1EchoHttpsResponse::Ok(data));
14130        }
14131        if status == http::StatusCode::UNAUTHORIZED {
14132            let _ = req.bytes().await?;
14133            return Ok(GetGwApiV1EchoHttpsResponse::Unauthorized);
14134        }
14135        if status == http::StatusCode::FORBIDDEN {
14136            let _ = req.bytes().await?;
14137            return Ok(GetGwApiV1EchoHttpsResponse::Forbidden);
14138        }
14139        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14140            let _ = req.bytes().await?;
14141            return Ok(GetGwApiV1EchoHttpsResponse::InternalServerError);
14142        }
14143        let _ = req.bytes().await?;
14144        return Ok(GetGwApiV1EchoHttpsResponse::Unknown);
14145    }
14146}
14147/// <br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
14148#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14149pub struct PostGwApiV1ExternalAssetTransfersBulkRequest {
14150    pub query: PostGwApiV1ExternalAssetTransfersBulkRequestQuery,
14151    /// Create Bulk External Asset transfers (Fop, DWAC and Complex Asset Transfer) request body
14152    pub body: ExternalAssetTransfersBulkRequestBody,
14153}
14154impl PostGwApiV1ExternalAssetTransfersBulkRequest {
14155    /// Parse the HTTP response into the response enum.
14156    pub async fn parse_response(
14157        req: reqwest::Response,
14158    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
14159        let status = req.status();
14160        if status == http::StatusCode::ACCEPTED {
14161            let data = oas3_gen_support::Diagnostics::<
14162                AsynchronousInstructionSetResponse,
14163            >::json_with_diagnostics(req)
14164                .await?;
14165            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
14166        }
14167        if status == http::StatusCode::BAD_REQUEST {
14168            let _ = req.bytes().await?;
14169            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
14170        }
14171        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14172            let _ = req.bytes().await?;
14173            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
14174        }
14175        let _ = req.bytes().await?;
14176        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
14177    }
14178}
14179#[serde_with::skip_serializing_none]
14180#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14181pub struct PostGwApiV1ExternalAssetTransfersBulkRequestQuery {
14182    /// The client's clientId
14183    /// - Example: `Some("abc123".to_string())`
14184    #[serde(rename = "client-id")]
14185    pub client_id: Option<String>,
14186}
14187/// Initiate request to submit external position transfer. Methods- ACATS, ATON, Basic FOP, FOP, DWAC. More information on transfer methods can be found here - https://www.interactivebrokers.com/campus/trading-lessons/cash-and-position-transfers/<br><br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
14188#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14189pub struct PostGwApiV1ExternalAssetTransfersRequest {
14190    pub query: PostGwApiV1ExternalAssetTransfersRequestQuery,
14191    pub body: TransferRequestBody2,
14192}
14193impl PostGwApiV1ExternalAssetTransfersRequest {
14194    /// Parse the HTTP response into the response enum.
14195    pub async fn parse_response(
14196        req: reqwest::Response,
14197    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
14198        let status = req.status();
14199        if status == http::StatusCode::ACCEPTED {
14200            let data = oas3_gen_support::Diagnostics::<
14201                AsynchronousInstructionResponse,
14202            >::json_with_diagnostics(req)
14203                .await?;
14204            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
14205        }
14206        if status == http::StatusCode::BAD_REQUEST {
14207            let _ = req.bytes().await?;
14208            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
14209        }
14210        if status == http::StatusCode::FORBIDDEN {
14211            let _ = req.bytes().await?;
14212            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
14213        }
14214        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14215            let _ = req.bytes().await?;
14216            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
14217        }
14218        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14219            let _ = req.bytes().await?;
14220            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
14221        }
14222        let _ = req.bytes().await?;
14223        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
14224    }
14225}
14226#[serde_with::skip_serializing_none]
14227#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14228pub struct PostGwApiV1ExternalAssetTransfersRequestQuery {
14229    /// The client's clientId
14230    /// - Example: `Some("abc123".to_string())`
14231    #[serde(rename = "client-id")]
14232    pub client_id: Option<String>,
14233}
14234/// <br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
14235#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14236pub struct PostGwApiV1ExternalCashTransfersBulkRequest {
14237    pub query: PostGwApiV1ExternalCashTransfersBulkRequestQuery,
14238    /// Create Bulk External Cash transfers (Deposit and Withdraw fund) request body
14239    pub body: ExternalCashTransfersBulkRequestBody,
14240}
14241impl PostGwApiV1ExternalCashTransfersBulkRequest {
14242    /// Parse the HTTP response into the response enum.
14243    pub async fn parse_response(
14244        req: reqwest::Response,
14245    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
14246        let status = req.status();
14247        if status == http::StatusCode::ACCEPTED {
14248            let data = oas3_gen_support::Diagnostics::<
14249                AsynchronousInstructionSetResponse,
14250            >::json_with_diagnostics(req)
14251                .await?;
14252            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
14253        }
14254        if status == http::StatusCode::BAD_REQUEST {
14255            let _ = req.bytes().await?;
14256            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
14257        }
14258        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14259            let _ = req.bytes().await?;
14260            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
14261        }
14262        let _ = req.bytes().await?;
14263        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
14264    }
14265}
14266#[serde_with::skip_serializing_none]
14267#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14268pub struct PostGwApiV1ExternalCashTransfersBulkRequestQuery {
14269    /// The client's clientId
14270    /// - Example: `Some("abc123".to_string())`
14271    #[serde(rename = "client-id")]
14272    pub client_id: Option<String>,
14273}
14274/// View available cash for withdrawal with and without margin loan by accountId<br><br>**Scope**: `transfers.read`<br>**Security Policy**: `Signed JWT`
14275#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14276pub struct PostGwApiV1ExternalCashTransfersQueryRequest {
14277    pub query: PostGwApiV1ExternalCashTransfersQueryRequestQuery,
14278    /// Create an external cash transfer query request body
14279    pub body: QueryRequestBody3,
14280}
14281impl PostGwApiV1ExternalCashTransfersQueryRequest {
14282    /// Parse the HTTP response into the response enum.
14283    pub async fn parse_response(
14284        req: reqwest::Response,
14285    ) -> anyhow::Result<PostGwApiV1ExternalCashTransfersQueryResponse> {
14286        let status = req.status();
14287        if status == http::StatusCode::CREATED {
14288            let data =
14289                oas3_gen_support::Diagnostics::<Query201Response2>::json_with_diagnostics(req)
14290                    .await?;
14291            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::Created(data));
14292        }
14293        if status == http::StatusCode::BAD_REQUEST {
14294            let _ = req.bytes().await?;
14295            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::BadRequest);
14296        }
14297        if status == http::StatusCode::FORBIDDEN {
14298            let _ = req.bytes().await?;
14299            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::Forbidden);
14300        }
14301        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14302            let _ = req.bytes().await?;
14303            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::UnprocessableEntity);
14304        }
14305        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14306            let _ = req.bytes().await?;
14307            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::InternalServerError);
14308        }
14309        let _ = req.bytes().await?;
14310        return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::Unknown);
14311    }
14312}
14313#[serde_with::skip_serializing_none]
14314#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14315pub struct PostGwApiV1ExternalCashTransfersQueryRequestQuery {
14316    /// The client's clientId
14317    /// - Example: `Some("abc123".to_string())`
14318    #[serde(rename = "client-id")]
14319    pub client_id: Option<String>,
14320}
14321/// Response types for post_gw_api_v1_external_cash_transfers_query
14322#[derive(Debug, Clone)]
14323pub enum PostGwApiV1ExternalCashTransfersQueryResponse {
14324    ///201: Instruction successfully created and processed synchronously
14325    Created(Query201Response2),
14326    ///400: Returns a Problem detail instance representing a bad request.
14327    BadRequest,
14328    ///403: Returns a Problem detail instance representing a forbidden request.
14329    Forbidden,
14330    ///422: Returns a Problem detail instance representing a business error.
14331    UnprocessableEntity,
14332    ///500: Returns a Problem detail instance representing an internal server error.
14333    InternalServerError,
14334    ///default: Unknown response
14335    Unknown,
14336}
14337/// Initiate request to deposit or withdrawal between IBKR account and bank account. More information on transfer methods can be found here - https://www.interactivebrokers.com/campus/trading-lessons/cash-and-position-transfers<br><br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
14338#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14339pub struct PostGwApiV1ExternalCashTransfersRequest {
14340    pub query: PostGwApiV1ExternalCashTransfersRequestQuery,
14341    pub body: TransferRequestBody3,
14342}
14343impl PostGwApiV1ExternalCashTransfersRequest {
14344    /// Parse the HTTP response into the response enum.
14345    pub async fn parse_response(
14346        req: reqwest::Response,
14347    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
14348        let status = req.status();
14349        if status == http::StatusCode::ACCEPTED {
14350            let data = oas3_gen_support::Diagnostics::<
14351                AsynchronousInstructionResponse,
14352            >::json_with_diagnostics(req)
14353                .await?;
14354            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
14355        }
14356        if status == http::StatusCode::BAD_REQUEST {
14357            let _ = req.bytes().await?;
14358            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
14359        }
14360        if status == http::StatusCode::FORBIDDEN {
14361            let _ = req.bytes().await?;
14362            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
14363        }
14364        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14365            let _ = req.bytes().await?;
14366            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
14367        }
14368        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14369            let _ = req.bytes().await?;
14370            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
14371        }
14372        let _ = req.bytes().await?;
14373        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
14374    }
14375}
14376#[serde_with::skip_serializing_none]
14377#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14378pub struct PostGwApiV1ExternalCashTransfersRequestQuery {
14379    /// The client's clientId
14380    /// - Example: `Some("abc123".to_string())`
14381    #[serde(rename = "client-id")]
14382    pub client_id: Option<String>,
14383}
14384/// <br>**Scope**: `instructions.write`<br>**Security Policy**: `Signed JWT`
14385#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14386pub struct PostGwApiV1InstructionsCancelBulkRequest {
14387    pub query: PostGwApiV1InstructionsCancelBulkRequestQuery,
14388    /// Create Bulk Cancel Instructions request body
14389    pub body: CancelBulkRequestBody,
14390}
14391impl PostGwApiV1InstructionsCancelBulkRequest {
14392    /// Parse the HTTP response into the response enum.
14393    pub async fn parse_response(
14394        req: reqwest::Response,
14395    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
14396        let status = req.status();
14397        if status == http::StatusCode::ACCEPTED {
14398            let data = oas3_gen_support::Diagnostics::<
14399                AsynchronousInstructionSetResponse,
14400            >::json_with_diagnostics(req)
14401                .await?;
14402            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
14403        }
14404        if status == http::StatusCode::BAD_REQUEST {
14405            let _ = req.bytes().await?;
14406            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
14407        }
14408        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14409            let _ = req.bytes().await?;
14410            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
14411        }
14412        let _ = req.bytes().await?;
14413        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
14414    }
14415}
14416#[serde_with::skip_serializing_none]
14417#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14418pub struct PostGwApiV1InstructionsCancelBulkRequestQuery {
14419    /// The client's clientId
14420    /// - Example: `Some("abc123".to_string())`
14421    #[serde(rename = "client-id")]
14422    pub client_id: Option<String>,
14423}
14424/// Cancel request by instructionId.<br><br>**Scope**: `instructions.write`<br>**Security Policy**: `Signed JWT`
14425#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14426pub struct PostGwApiV1InstructionsCancelRequest {
14427    pub query: PostGwApiV1InstructionsCancelRequestQuery,
14428    #[validate(nested)]
14429    pub body: CancelRequestBody,
14430}
14431impl PostGwApiV1InstructionsCancelRequest {
14432    /// Parse the HTTP response into the response enum.
14433    pub async fn parse_response(
14434        req: reqwest::Response,
14435    ) -> anyhow::Result<PostGwApiV1InstructionsCancelResponse> {
14436        let status = req.status();
14437        if status == http::StatusCode::CREATED {
14438            let data = oas3_gen_support::Diagnostics::<
14439                SynchronousInstructionResponse,
14440            >::json_with_diagnostics(req)
14441                .await?;
14442            return Ok(PostGwApiV1InstructionsCancelResponse::Created(data));
14443        }
14444        if status == http::StatusCode::BAD_REQUEST {
14445            let _ = req.bytes().await?;
14446            return Ok(PostGwApiV1InstructionsCancelResponse::BadRequest);
14447        }
14448        if status == http::StatusCode::FORBIDDEN {
14449            let _ = req.bytes().await?;
14450            return Ok(PostGwApiV1InstructionsCancelResponse::Forbidden);
14451        }
14452        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14453            let _ = req.bytes().await?;
14454            return Ok(PostGwApiV1InstructionsCancelResponse::UnprocessableEntity);
14455        }
14456        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14457            let _ = req.bytes().await?;
14458            return Ok(PostGwApiV1InstructionsCancelResponse::InternalServerError);
14459        }
14460        let _ = req.bytes().await?;
14461        return Ok(PostGwApiV1InstructionsCancelResponse::Unknown);
14462    }
14463}
14464#[serde_with::skip_serializing_none]
14465#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14466pub struct PostGwApiV1InstructionsCancelRequestQuery {
14467    /// The client's clientId
14468    /// - Example: `Some("abc123".to_string())`
14469    #[serde(rename = "client-id")]
14470    pub client_id: Option<String>,
14471}
14472/// Response types for post_gw_api_v1_instructions_cancel
14473#[derive(Debug, Clone)]
14474pub enum PostGwApiV1InstructionsCancelResponse {
14475    ///201: Instruction successfully created and processed synchronously
14476    Created(SynchronousInstructionResponse),
14477    ///400: Returns a Problem detail instance representing a bad request.
14478    BadRequest,
14479    ///403: Returns a Problem detail instance representing a forbidden request.
14480    Forbidden,
14481    ///422: Returns a Problem detail instance representing a business error.
14482    UnprocessableEntity,
14483    ///500: Returns a Problem detail instance representing an internal server error.
14484    InternalServerError,
14485    ///default: Unknown response
14486    Unknown,
14487}
14488/// Query list of recent transactions (up to 30 days) based on accountId.<br><br>**Scope**: `instructions.read`<br>**Security Policy**: `Signed JWT`
14489#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14490pub struct PostGwApiV1InstructionsQueryRequest {
14491    pub query: PostGwApiV1InstructionsQueryRequestQuery,
14492    /// Create recent instructions request body
14493    #[validate(nested)]
14494    pub body: QueryRequestBody4,
14495}
14496impl PostGwApiV1InstructionsQueryRequest {
14497    /// Parse the HTTP response into the response enum.
14498    pub async fn parse_response(
14499        req: reqwest::Response,
14500    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
14501        let status = req.status();
14502        if status == http::StatusCode::ACCEPTED {
14503            let data = oas3_gen_support::Diagnostics::<
14504                AsynchronousInstructionResponse,
14505            >::json_with_diagnostics(req)
14506                .await?;
14507            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
14508        }
14509        if status == http::StatusCode::BAD_REQUEST {
14510            let _ = req.bytes().await?;
14511            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
14512        }
14513        if status == http::StatusCode::FORBIDDEN {
14514            let _ = req.bytes().await?;
14515            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
14516        }
14517        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14518            let _ = req.bytes().await?;
14519            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
14520        }
14521        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14522            let _ = req.bytes().await?;
14523            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
14524        }
14525        let _ = req.bytes().await?;
14526        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
14527    }
14528}
14529#[serde_with::skip_serializing_none]
14530#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14531pub struct PostGwApiV1InstructionsQueryRequestQuery {
14532    /// The client's clientId
14533    /// - Example: `Some("abc123".to_string())`
14534    #[serde(rename = "client-id")]
14535    pub client_id: Option<String>,
14536}
14537/// <br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
14538#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14539pub struct PostGwApiV1InternalAssetTransfersBulkRequest {
14540    pub query: PostGwApiV1InternalAssetTransfersBulkRequestQuery,
14541    /// Create Bulk Internal Asset Transfers request body
14542    pub body: InternalAssetTransfersBulkRequestBody,
14543}
14544impl PostGwApiV1InternalAssetTransfersBulkRequest {
14545    /// Parse the HTTP response into the response enum.
14546    pub async fn parse_response(
14547        req: reqwest::Response,
14548    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
14549        let status = req.status();
14550        if status == http::StatusCode::ACCEPTED {
14551            let data = oas3_gen_support::Diagnostics::<
14552                AsynchronousInstructionSetResponse,
14553            >::json_with_diagnostics(req)
14554                .await?;
14555            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
14556        }
14557        if status == http::StatusCode::BAD_REQUEST {
14558            let _ = req.bytes().await?;
14559            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
14560        }
14561        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14562            let _ = req.bytes().await?;
14563            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
14564        }
14565        let _ = req.bytes().await?;
14566        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
14567    }
14568}
14569#[serde_with::skip_serializing_none]
14570#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14571pub struct PostGwApiV1InternalAssetTransfersBulkRequestQuery {
14572    /// The client's clientId
14573    /// - Example: `Some("abc123".to_string())`
14574    #[serde(rename = "client-id")]
14575    pub client_id: Option<String>,
14576}
14577/// Transfer positions internally between two accounts with Interactive Brokers<br><br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
14578#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14579pub struct PostGwApiV1InternalAssetTransfersRequest {
14580    pub query: PostGwApiV1InternalAssetTransfersRequestQuery,
14581    #[validate(nested)]
14582    pub body: TransferRequestBody4,
14583}
14584impl PostGwApiV1InternalAssetTransfersRequest {
14585    /// Parse the HTTP response into the response enum.
14586    pub async fn parse_response(
14587        req: reqwest::Response,
14588    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
14589        let status = req.status();
14590        if status == http::StatusCode::ACCEPTED {
14591            let data = oas3_gen_support::Diagnostics::<
14592                AsynchronousInstructionResponse,
14593            >::json_with_diagnostics(req)
14594                .await?;
14595            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
14596        }
14597        if status == http::StatusCode::BAD_REQUEST {
14598            let _ = req.bytes().await?;
14599            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
14600        }
14601        if status == http::StatusCode::FORBIDDEN {
14602            let _ = req.bytes().await?;
14603            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
14604        }
14605        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14606            let _ = req.bytes().await?;
14607            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
14608        }
14609        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14610            let _ = req.bytes().await?;
14611            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
14612        }
14613        let _ = req.bytes().await?;
14614        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
14615    }
14616}
14617#[serde_with::skip_serializing_none]
14618#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14619pub struct PostGwApiV1InternalAssetTransfersRequestQuery {
14620    /// The client's clientId
14621    /// - Example: `Some("abc123".to_string())`
14622    #[serde(rename = "client-id")]
14623    pub client_id: Option<String>,
14624}
14625/// <br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
14626#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14627pub struct PostGwApiV1InternalCashTransfersBulkRequest {
14628    pub query: PostGwApiV1InternalCashTransfersBulkRequestQuery,
14629    /// Create Bulk Internal Cash Transfers request body
14630    pub body: InternalCashTransfersBulkRequestBody,
14631}
14632impl PostGwApiV1InternalCashTransfersBulkRequest {
14633    /// Parse the HTTP response into the response enum.
14634    pub async fn parse_response(
14635        req: reqwest::Response,
14636    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
14637        let status = req.status();
14638        if status == http::StatusCode::ACCEPTED {
14639            let data = oas3_gen_support::Diagnostics::<
14640                AsynchronousInstructionSetResponse,
14641            >::json_with_diagnostics(req)
14642                .await?;
14643            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
14644        }
14645        if status == http::StatusCode::BAD_REQUEST {
14646            let _ = req.bytes().await?;
14647            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
14648        }
14649        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14650            let _ = req.bytes().await?;
14651            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
14652        }
14653        let _ = req.bytes().await?;
14654        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
14655    }
14656}
14657#[serde_with::skip_serializing_none]
14658#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14659pub struct PostGwApiV1InternalCashTransfersBulkRequestQuery {
14660    /// The client's clientId
14661    /// - Example: `Some("abc123".to_string())`
14662    #[serde(rename = "client-id")]
14663    pub client_id: Option<String>,
14664}
14665/// Transfer cash internally between two accounts with Interactive Brokers.<br><br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
14666#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14667pub struct PostGwApiV1InternalCashTransfersRequest {
14668    pub query: PostGwApiV1InternalCashTransfersRequestQuery,
14669    #[validate(nested)]
14670    pub body: TransferRequestBody5,
14671}
14672impl PostGwApiV1InternalCashTransfersRequest {
14673    /// Parse the HTTP response into the response enum.
14674    pub async fn parse_response(
14675        req: reqwest::Response,
14676    ) -> anyhow::Result<PostGwApiV1InstructionsCancelResponse> {
14677        let status = req.status();
14678        if status == http::StatusCode::CREATED {
14679            let data = oas3_gen_support::Diagnostics::<
14680                SynchronousInstructionResponse,
14681            >::json_with_diagnostics(req)
14682                .await?;
14683            return Ok(PostGwApiV1InstructionsCancelResponse::Created(data));
14684        }
14685        if status == http::StatusCode::BAD_REQUEST {
14686            let _ = req.bytes().await?;
14687            return Ok(PostGwApiV1InstructionsCancelResponse::BadRequest);
14688        }
14689        if status == http::StatusCode::FORBIDDEN {
14690            let _ = req.bytes().await?;
14691            return Ok(PostGwApiV1InstructionsCancelResponse::Forbidden);
14692        }
14693        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
14694            let _ = req.bytes().await?;
14695            return Ok(PostGwApiV1InstructionsCancelResponse::UnprocessableEntity);
14696        }
14697        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14698            let _ = req.bytes().await?;
14699            return Ok(PostGwApiV1InstructionsCancelResponse::InternalServerError);
14700        }
14701        let _ = req.bytes().await?;
14702        return Ok(PostGwApiV1InstructionsCancelResponse::Unknown);
14703    }
14704}
14705#[serde_with::skip_serializing_none]
14706#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
14707pub struct PostGwApiV1InternalCashTransfersRequestQuery {
14708    /// The client's clientId
14709    /// - Example: `Some("abc123".to_string())`
14710    #[serde(rename = "client-id")]
14711    pub client_id: Option<String>,
14712}
14713/// <br>**Scope**: `sso-browser-sessions.write`<br>**Security Policy**: `Signed JWT`
14714#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14715pub struct PostGwApiV1SsoBrowserSessionsRequest {
14716    #[validate(nested)]
14717    pub header: PostGwApiV1SsoBrowserSessionsRequestHeader,
14718    /// Create browser session on behalf of end-user.
14719    pub body: AccountRequestBody,
14720}
14721impl PostGwApiV1SsoBrowserSessionsRequest {
14722    /// Parse the HTTP response into the response enum.
14723    pub async fn parse_response(
14724        req: reqwest::Response,
14725    ) -> anyhow::Result<PostGwApiV1SsoBrowserSessionsResponse> {
14726        let status = req.status();
14727        if status == http::StatusCode::OK {
14728            let data = oas3_gen_support::Diagnostics::<
14729                CreateBrowserSessionResponse,
14730            >::json_with_diagnostics(req)
14731                .await?;
14732            return Ok(PostGwApiV1SsoBrowserSessionsResponse::Ok(data));
14733        }
14734        if status == http::StatusCode::BAD_REQUEST {
14735            let _ = req.bytes().await?;
14736            return Ok(PostGwApiV1SsoBrowserSessionsResponse::BadRequest);
14737        }
14738        if status == http::StatusCode::UNAUTHORIZED {
14739            let _ = req.bytes().await?;
14740            return Ok(PostGwApiV1SsoBrowserSessionsResponse::Unauthorized);
14741        }
14742        if status == http::StatusCode::FORBIDDEN {
14743            let _ = req.bytes().await?;
14744            return Ok(PostGwApiV1SsoBrowserSessionsResponse::Forbidden);
14745        }
14746        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14747            let _ = req.bytes().await?;
14748            return Ok(PostGwApiV1SsoBrowserSessionsResponse::InternalServerError);
14749        }
14750        let _ = req.bytes().await?;
14751        return Ok(PostGwApiV1SsoBrowserSessionsResponse::Unknown);
14752    }
14753}
14754#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
14755pub struct PostGwApiV1SsoBrowserSessionsRequestHeader {
14756    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
14757    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
14758    #[validate(length(min = 1u64))]
14759    pub authorization: String,
14760}
14761impl core::convert::TryFrom<&PostGwApiV1SsoBrowserSessionsRequestHeader> for http::HeaderMap {
14762    type Error = http::header::InvalidHeaderValue;
14763    fn try_from(
14764        headers: &PostGwApiV1SsoBrowserSessionsRequestHeader,
14765    ) -> core::result::Result<Self, Self::Error> {
14766        let mut map = http::HeaderMap::with_capacity(1usize);
14767        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
14768        map.insert(AUTHORIZATION, header_value);
14769        Ok(map)
14770    }
14771}
14772impl core::convert::TryFrom<PostGwApiV1SsoBrowserSessionsRequestHeader> for http::HeaderMap {
14773    type Error = http::header::InvalidHeaderValue;
14774    fn try_from(
14775        headers: PostGwApiV1SsoBrowserSessionsRequestHeader,
14776    ) -> core::result::Result<Self, Self::Error> {
14777        http::HeaderMap::try_from(&headers)
14778    }
14779}
14780/// Response types for post_gw_api_v1_sso_browser_sessions
14781#[derive(Debug, Clone)]
14782pub enum PostGwApiV1SsoBrowserSessionsResponse {
14783    ///200: Create a Single Sign On (SSO) to access the IBKR hosted portal (White Branded).
14784    Ok(CreateBrowserSessionResponse),
14785    ///400: Returns a Problem detail instance representing a bad request.
14786    BadRequest,
14787    ///401: Returns a Problem detail instance representing an unauthorized request.
14788    Unauthorized,
14789    ///403: Returns a Problem detail instance representing a forbidden request.
14790    Forbidden,
14791    ///500: Returns a Problem detail instance representing an internal server error.
14792    InternalServerError,
14793    ///default: Unknown response
14794    Unknown,
14795}
14796/// <br>**Scope**: `sso-sessions.write`<br>**Security Policy**: `Signed JWT`
14797#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14798pub struct PostGwApiV1SsoSessionsRequest {
14799    #[validate(nested)]
14800    pub header: PostGwApiV1SsoSessionsRequestHeader,
14801    /// Create session on behalf of end-user.
14802    pub body: AccountRequestBody,
14803}
14804impl PostGwApiV1SsoSessionsRequest {
14805    /// Parse the HTTP response into the response enum.
14806    pub async fn parse_response(
14807        req: reqwest::Response,
14808    ) -> anyhow::Result<PostGwApiV1SsoSessionsResponse> {
14809        let status = req.status();
14810        if status == http::StatusCode::OK {
14811            let data =
14812                oas3_gen_support::Diagnostics::<CreateSessionResponse>::json_with_diagnostics(req)
14813                    .await?;
14814            return Ok(PostGwApiV1SsoSessionsResponse::Ok(data));
14815        }
14816        if status == http::StatusCode::BAD_REQUEST {
14817            let _ = req.bytes().await?;
14818            return Ok(PostGwApiV1SsoSessionsResponse::BadRequest);
14819        }
14820        if status == http::StatusCode::UNAUTHORIZED {
14821            let _ = req.bytes().await?;
14822            return Ok(PostGwApiV1SsoSessionsResponse::Unauthorized);
14823        }
14824        if status == http::StatusCode::FORBIDDEN {
14825            let _ = req.bytes().await?;
14826            return Ok(PostGwApiV1SsoSessionsResponse::Forbidden);
14827        }
14828        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14829            let _ = req.bytes().await?;
14830            return Ok(PostGwApiV1SsoSessionsResponse::InternalServerError);
14831        }
14832        let _ = req.bytes().await?;
14833        return Ok(PostGwApiV1SsoSessionsResponse::Unknown);
14834    }
14835}
14836#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
14837pub struct PostGwApiV1SsoSessionsRequestHeader {
14838    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
14839    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
14840    #[validate(length(min = 1u64))]
14841    pub authorization: String,
14842}
14843impl core::convert::TryFrom<&PostGwApiV1SsoSessionsRequestHeader> for http::HeaderMap {
14844    type Error = http::header::InvalidHeaderValue;
14845    fn try_from(
14846        headers: &PostGwApiV1SsoSessionsRequestHeader,
14847    ) -> core::result::Result<Self, Self::Error> {
14848        let mut map = http::HeaderMap::with_capacity(1usize);
14849        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
14850        map.insert(AUTHORIZATION, header_value);
14851        Ok(map)
14852    }
14853}
14854impl core::convert::TryFrom<PostGwApiV1SsoSessionsRequestHeader> for http::HeaderMap {
14855    type Error = http::header::InvalidHeaderValue;
14856    fn try_from(
14857        headers: PostGwApiV1SsoSessionsRequestHeader,
14858    ) -> core::result::Result<Self, Self::Error> {
14859        http::HeaderMap::try_from(&headers)
14860    }
14861}
14862/// Response types for post_gw_api_v1_sso_sessions
14863#[derive(Debug, Clone)]
14864pub enum PostGwApiV1SsoSessionsResponse {
14865    ///200: Returns a JSON object containing a reference to the newly created SSO session.
14866    Ok(CreateSessionResponse),
14867    ///400: Returns a Problem detail instance representing a bad request.
14868    BadRequest,
14869    ///401: Returns a Problem detail instance representing an unauthorized request.
14870    Unauthorized,
14871    ///403: Returns a Problem detail instance representing a forbidden request.
14872    Forbidden,
14873    ///500: Returns a Problem detail instance representing an internal server error.
14874    InternalServerError,
14875    ///default: Unknown response
14876    Unknown,
14877}
14878/// <br>**Scope**: `statements.read` OR `statements.write` OR `reports.write`<br>**Security Policy**: `Signed JWT`
14879#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14880pub struct PostGwApiV1StatementsRequest {
14881    #[validate(nested)]
14882    pub header: PostGwApiV1StatementsRequestHeader,
14883    /// Report request object
14884    #[validate(nested)]
14885    pub body: StmtRequest,
14886}
14887impl PostGwApiV1StatementsRequest {
14888    /// Parse the HTTP response into the response enum.
14889    pub async fn parse_response(
14890        req: reqwest::Response,
14891    ) -> anyhow::Result<PostGwApiV1StatementsResponse> {
14892        let status = req.status();
14893        if status == http::StatusCode::OK {
14894            let data =
14895                oas3_gen_support::Diagnostics::<GetStatementsResponse>::json_with_diagnostics(req)
14896                    .await?;
14897            return Ok(PostGwApiV1StatementsResponse::Ok(data));
14898        }
14899        if status == http::StatusCode::BAD_REQUEST {
14900            let _ = req.bytes().await?;
14901            return Ok(PostGwApiV1StatementsResponse::BadRequest);
14902        }
14903        if status == http::StatusCode::UNAUTHORIZED {
14904            let _ = req.bytes().await?;
14905            return Ok(PostGwApiV1StatementsResponse::Unauthorized);
14906        }
14907        if status == http::StatusCode::PAYMENT_REQUIRED {
14908            let _ = req.bytes().await?;
14909            return Ok(PostGwApiV1StatementsResponse::PaymentRequired);
14910        }
14911        if status == http::StatusCode::FORBIDDEN {
14912            let _ = req.bytes().await?;
14913            return Ok(PostGwApiV1StatementsResponse::Forbidden);
14914        }
14915        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
14916            let _ = req.bytes().await?;
14917            return Ok(PostGwApiV1StatementsResponse::InternalServerError);
14918        }
14919        let _ = req.bytes().await?;
14920        return Ok(PostGwApiV1StatementsResponse::Unknown);
14921    }
14922}
14923#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
14924pub struct PostGwApiV1StatementsRequestHeader {
14925    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
14926    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
14927    #[validate(length(min = 1u64))]
14928    pub authorization: String,
14929}
14930impl core::convert::TryFrom<&PostGwApiV1StatementsRequestHeader> for http::HeaderMap {
14931    type Error = http::header::InvalidHeaderValue;
14932    fn try_from(
14933        headers: &PostGwApiV1StatementsRequestHeader,
14934    ) -> core::result::Result<Self, Self::Error> {
14935        let mut map = http::HeaderMap::with_capacity(1usize);
14936        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
14937        map.insert(AUTHORIZATION, header_value);
14938        Ok(map)
14939    }
14940}
14941impl core::convert::TryFrom<PostGwApiV1StatementsRequestHeader> for http::HeaderMap {
14942    type Error = http::header::InvalidHeaderValue;
14943    fn try_from(
14944        headers: PostGwApiV1StatementsRequestHeader,
14945    ) -> core::result::Result<Self, Self::Error> {
14946        http::HeaderMap::try_from(&headers)
14947    }
14948}
14949/// Response types for post_gw_api_v1_statements
14950#[derive(Debug, Clone)]
14951pub enum PostGwApiV1StatementsResponse {
14952    ///200: Returns a JSON object containing the relevant statement.
14953    Ok(GetStatementsResponse),
14954    ///400: Returns a Problem detail instance representing a bad request.
14955    BadRequest,
14956    ///401: Returns a Problem detail instance representing an unauthorized request.
14957    Unauthorized,
14958    ///402: Returns a Problem detail instance representing an unauthorized request.
14959    PaymentRequired,
14960    ///403: Returns a Problem detail instance representing a forbidden request.
14961    Forbidden,
14962    ///500: Returns a Problem detail instance representing an internal server error.
14963    InternalServerError,
14964    ///default: Unknown response
14965    Unknown,
14966}
14967/// <br>**Scope**: `statements.write` OR `reports.write`<br>**Security Policy**: `Signed JWT`
14968#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
14969pub struct PostGwApiV1TaxDocumentsRequest {
14970    #[validate(nested)]
14971    pub header: PostGwApiV1TaxDocumentsRequestHeader,
14972    /// Tax Form request object
14973    #[validate(nested)]
14974    pub body: TaxFormRequest,
14975}
14976impl PostGwApiV1TaxDocumentsRequest {
14977    /// Parse the HTTP response into the response enum.
14978    pub async fn parse_response(
14979        req: reqwest::Response,
14980    ) -> anyhow::Result<PostGwApiV1TaxDocumentsResponse> {
14981        let status = req.status();
14982        if status == http::StatusCode::OK {
14983            let data = oas3_gen_support::Diagnostics::<TaxFormResponse>::json_with_diagnostics(req)
14984                .await?;
14985            return Ok(PostGwApiV1TaxDocumentsResponse::Ok(data));
14986        }
14987        if status == http::StatusCode::BAD_REQUEST {
14988            let _ = req.bytes().await?;
14989            return Ok(PostGwApiV1TaxDocumentsResponse::BadRequest);
14990        }
14991        if status == http::StatusCode::UNAUTHORIZED {
14992            let _ = req.bytes().await?;
14993            return Ok(PostGwApiV1TaxDocumentsResponse::Unauthorized);
14994        }
14995        if status == http::StatusCode::PAYMENT_REQUIRED {
14996            let _ = req.bytes().await?;
14997            return Ok(PostGwApiV1TaxDocumentsResponse::PaymentRequired);
14998        }
14999        if status == http::StatusCode::FORBIDDEN {
15000            let _ = req.bytes().await?;
15001            return Ok(PostGwApiV1TaxDocumentsResponse::Forbidden);
15002        }
15003        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
15004            let _ = req.bytes().await?;
15005            return Ok(PostGwApiV1TaxDocumentsResponse::InternalServerError);
15006        }
15007        let _ = req.bytes().await?;
15008        return Ok(PostGwApiV1TaxDocumentsResponse::Unknown);
15009    }
15010}
15011#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
15012pub struct PostGwApiV1TaxDocumentsRequestHeader {
15013    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
15014    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
15015    #[validate(length(min = 1u64))]
15016    pub authorization: String,
15017}
15018impl core::convert::TryFrom<&PostGwApiV1TaxDocumentsRequestHeader> for http::HeaderMap {
15019    type Error = http::header::InvalidHeaderValue;
15020    fn try_from(
15021        headers: &PostGwApiV1TaxDocumentsRequestHeader,
15022    ) -> core::result::Result<Self, Self::Error> {
15023        let mut map = http::HeaderMap::with_capacity(1usize);
15024        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
15025        map.insert(AUTHORIZATION, header_value);
15026        Ok(map)
15027    }
15028}
15029impl core::convert::TryFrom<PostGwApiV1TaxDocumentsRequestHeader> for http::HeaderMap {
15030    type Error = http::header::InvalidHeaderValue;
15031    fn try_from(
15032        headers: PostGwApiV1TaxDocumentsRequestHeader,
15033    ) -> core::result::Result<Self, Self::Error> {
15034        http::HeaderMap::try_from(&headers)
15035    }
15036}
15037/// Response types for post_gw_api_v1_tax_documents
15038#[derive(Debug, Clone)]
15039pub enum PostGwApiV1TaxDocumentsResponse {
15040    ///200: Returns a JSON object containing the relevant Tax Form.
15041    Ok(TaxFormResponse),
15042    ///400: Returns a Problem detail instance representing a bad request.
15043    BadRequest,
15044    ///401: Returns a Problem detail instance representing an unauthorized request.
15045    Unauthorized,
15046    ///402: Returns a Problem detail instance representing an unauthorized request.
15047    PaymentRequired,
15048    ///403: Returns a Problem detail instance representing a forbidden request.
15049    Forbidden,
15050    ///500: Returns a Problem detail instance representing an internal server error.
15051    InternalServerError,
15052    ///default: Unknown response
15053    Unknown,
15054}
15055/// <br>**Scope**: `statements.write` OR `reports.write`<br>**Security Policy**: `Signed JWT`
15056#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
15057pub struct PostGwApiV1TradeConfirmationsRequest {
15058    #[validate(nested)]
15059    pub header: PostGwApiV1TradeConfirmationsRequestHeader,
15060    /// Trade confirmation request body
15061    #[validate(nested)]
15062    pub body: TradeConfirmationRequest,
15063}
15064impl PostGwApiV1TradeConfirmationsRequest {
15065    /// Parse the HTTP response into the response enum.
15066    pub async fn parse_response(
15067        req: reqwest::Response,
15068    ) -> anyhow::Result<PostGwApiV1TradeConfirmationsResponse> {
15069        let status = req.status();
15070        if status == http::StatusCode::OK {
15071            let data =
15072                oas3_gen_support::Diagnostics::<TradeConfirmationResponse>::json_with_diagnostics(
15073                    req,
15074                )
15075                .await?;
15076            return Ok(PostGwApiV1TradeConfirmationsResponse::Ok(data));
15077        }
15078        if status == http::StatusCode::BAD_REQUEST {
15079            let _ = req.bytes().await?;
15080            return Ok(PostGwApiV1TradeConfirmationsResponse::BadRequest);
15081        }
15082        if status == http::StatusCode::UNAUTHORIZED {
15083            let _ = req.bytes().await?;
15084            return Ok(PostGwApiV1TradeConfirmationsResponse::Unauthorized);
15085        }
15086        if status == http::StatusCode::PAYMENT_REQUIRED {
15087            let _ = req.bytes().await?;
15088            return Ok(PostGwApiV1TradeConfirmationsResponse::PaymentRequired);
15089        }
15090        if status == http::StatusCode::FORBIDDEN {
15091            let _ = req.bytes().await?;
15092            return Ok(PostGwApiV1TradeConfirmationsResponse::Forbidden);
15093        }
15094        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
15095            let _ = req.bytes().await?;
15096            return Ok(PostGwApiV1TradeConfirmationsResponse::InternalServerError);
15097        }
15098        let _ = req.bytes().await?;
15099        return Ok(PostGwApiV1TradeConfirmationsResponse::Unknown);
15100    }
15101}
15102#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
15103pub struct PostGwApiV1TradeConfirmationsRequestHeader {
15104    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
15105    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
15106    #[validate(length(min = 1u64))]
15107    pub authorization: String,
15108}
15109impl core::convert::TryFrom<&PostGwApiV1TradeConfirmationsRequestHeader> for http::HeaderMap {
15110    type Error = http::header::InvalidHeaderValue;
15111    fn try_from(
15112        headers: &PostGwApiV1TradeConfirmationsRequestHeader,
15113    ) -> core::result::Result<Self, Self::Error> {
15114        let mut map = http::HeaderMap::with_capacity(1usize);
15115        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
15116        map.insert(AUTHORIZATION, header_value);
15117        Ok(map)
15118    }
15119}
15120impl core::convert::TryFrom<PostGwApiV1TradeConfirmationsRequestHeader> for http::HeaderMap {
15121    type Error = http::header::InvalidHeaderValue;
15122    fn try_from(
15123        headers: PostGwApiV1TradeConfirmationsRequestHeader,
15124    ) -> core::result::Result<Self, Self::Error> {
15125        http::HeaderMap::try_from(&headers)
15126    }
15127}
15128/// Response types for post_gw_api_v1_trade_confirmations
15129#[derive(Debug, Clone)]
15130pub enum PostGwApiV1TradeConfirmationsResponse {
15131    ///200: Returns a JSON object containing the relevant Trade Confirmation.
15132    Ok(TradeConfirmationResponse),
15133    ///400: Returns a Problem detail instance representing a bad request.
15134    BadRequest,
15135    ///401: Returns a Problem detail instance representing an unauthorized request.
15136    Unauthorized,
15137    ///402: Returns a Problem detail instance representing an unauthorized request.
15138    PaymentRequired,
15139    ///403: Returns a Problem detail instance representing a forbidden request.
15140    Forbidden,
15141    ///500: Returns a Problem detail instance representing an internal server error.
15142    InternalServerError,
15143    ///default: Unknown response
15144    Unknown,
15145}
15146/// Create a named watchlist by submitting a set of conids.
15147#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
15148pub struct PostNewWatchlistRequest {
15149    /// Watchlist contents.
15150    #[validate(nested)]
15151    pub body: WatchlistRequestBody,
15152}
15153impl PostNewWatchlistRequest {
15154    /// Parse the HTTP response into the response enum.
15155    pub async fn parse_response(
15156        req: reqwest::Response,
15157    ) -> anyhow::Result<PostNewWatchlistResponse> {
15158        let status = req.status();
15159        if status == http::StatusCode::OK {
15160            let data =
15161                oas3_gen_support::Diagnostics::<Watchlist200Response>::json_with_diagnostics(req)
15162                    .await?;
15163            return Ok(PostNewWatchlistResponse::Ok(data));
15164        }
15165        if status == http::StatusCode::BAD_REQUEST {
15166            let _ = req.bytes().await?;
15167            return Ok(PostNewWatchlistResponse::BadRequest);
15168        }
15169        if status == http::StatusCode::UNAUTHORIZED {
15170            let _ = req.bytes().await?;
15171            return Ok(PostNewWatchlistResponse::Unauthorized);
15172        }
15173        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
15174            let _ = req.bytes().await?;
15175            return Ok(PostNewWatchlistResponse::InternalServerError);
15176        }
15177        if status == http::StatusCode::SERVICE_UNAVAILABLE {
15178            let _ = req.bytes().await?;
15179            return Ok(PostNewWatchlistResponse::ServiceUnavailable);
15180        }
15181        let _ = req.bytes().await?;
15182        return Ok(PostNewWatchlistResponse::Unknown);
15183    }
15184}
15185/// Response types for postNewWatchlist
15186#[derive(Debug, Clone)]
15187pub enum PostNewWatchlistResponse {
15188    ///200: Watchlist creation successful.
15189    Ok(Watchlist200Response),
15190    ///400: Invalid input format or missing required fields
15191    BadRequest,
15192    ///401: Invalid or expired access token
15193    Unauthorized,
15194    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
15195     */
15196    InternalServerError,
15197    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
15198     */
15199    ServiceUnavailable,
15200    ///default: Unknown response
15201    Unknown,
15202}
15203#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15204pub struct PredefinedDestinationInstruction {
15205    /// - Example: `"U2323232".to_string()`
15206    #[serde(rename = "accountId")]
15207    #[validate(length(min = 1u64, max = 10u64))]
15208    pub account_id: String,
15209    /// - Example: `"ACH"`
15210    #[serde(rename = "bankInstructionMethod")]
15211    pub bank_instruction_method: PredefinedDestinationInstructionBankInstructionMethod,
15212    /// - Example: `"Instruction".to_string()`
15213    #[serde(rename = "bankInstructionName")]
15214    #[validate(length(min = 1u64, max = 100u64))]
15215    pub bank_instruction_name: String,
15216    /// - Example: `1012983.0`
15217    #[serde(rename = "clientInstructionId")]
15218    pub client_instruction_id: f64,
15219    /// - Example: `"USD".to_string()`
15220    #[validate(length(min = 3u64, max = 3u64))]
15221    pub currency: String,
15222    #[serde(rename = "financialInstitution")]
15223    #[validate(nested)]
15224    pub financial_institution: PredefinedDestinationInstructionFinancialInstitution,
15225}
15226#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
15227pub enum PredefinedDestinationInstructionBankInstructionMethod {
15228    #[serde(rename = "LVP")]
15229    #[default]
15230    Lvp,
15231    #[serde(rename = "SEPA")]
15232    Sepa,
15233    #[serde(rename = "WIRE")]
15234    Wire,
15235    #[serde(rename = "ACH")]
15236    Ach,
15237    #[serde(rename = "CPA")]
15238    Cpa,
15239}
15240impl core::fmt::Display for PredefinedDestinationInstructionBankInstructionMethod {
15241    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15242        match self {
15243            Self::Lvp => write!(f, "LVP"),
15244            Self::Sepa => write!(f, "SEPA"),
15245            Self::Wire => write!(f, "WIRE"),
15246            Self::Ach => write!(f, "ACH"),
15247            Self::Cpa => write!(f, "CPA"),
15248        }
15249    }
15250}
15251#[serde_with::skip_serializing_none]
15252#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15253pub struct PredefinedDestinationInstructionFinancialInstitution {
15254    #[serde(rename = "branchCode")]
15255    #[validate(length(min = 0u64, max = 32u64))]
15256    pub branch_code: Option<String>,
15257    /// - Example: `Some("BSB_AUD")`
15258    #[serde(rename = "branchCodeType")]
15259    pub branch_code_type:
15260        Option<PredefinedDestinationInstructionFinancialInstitutionBranchCodeType>,
15261    /// - Example: `"132456789".to_string()`
15262    #[serde(rename = "clientAccountId")]
15263    #[validate(length(min = 1u64, max = 32u64))]
15264    pub client_account_id: String,
15265    /// - Example: `"SBIN001000".to_string()`
15266    #[validate(length(min = 1u64, max = 24u64))]
15267    pub identifier: String,
15268    /// - Example: `"BIC"`
15269    #[serde(rename = "identifierType")]
15270    pub identifier_type: PredefinedDestinationInstructionFinancialInstitutionIdentifierType,
15271    /// - Example: `"SBI BANK".to_string()`
15272    #[validate(length(min = 1u64, max = 100u64))]
15273    pub name: String,
15274}
15275#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
15276pub enum PredefinedDestinationInstructionFinancialInstitutionBranchCodeType {
15277    #[serde(rename = "BSB_AUD")]
15278    #[default]
15279    BsbAud,
15280    #[serde(rename = "BANK_CODE_CAD")]
15281    BankCodeCad,
15282    #[serde(rename = "NONE")]
15283    None,
15284}
15285impl core::fmt::Display for PredefinedDestinationInstructionFinancialInstitutionBranchCodeType {
15286    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15287        match self {
15288            Self::BsbAud => write!(f, "BSB_AUD"),
15289            Self::BankCodeCad => write!(f, "BANK_CODE_CAD"),
15290            Self::None => write!(f, "NONE"),
15291        }
15292    }
15293}
15294#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
15295pub enum PredefinedDestinationInstructionFinancialInstitutionIdentifierType {
15296    #[serde(rename = "BIC")]
15297    #[default]
15298    Bic,
15299    #[serde(rename = "IFSC")]
15300    Ifsc,
15301}
15302impl core::fmt::Display for PredefinedDestinationInstructionFinancialInstitutionIdentifierType {
15303    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15304        match self {
15305            Self::Bic => write!(f, "BIC"),
15306            Self::Ifsc => write!(f, "IFSC"),
15307        }
15308    }
15309}
15310#[serde_with::skip_serializing_none]
15311#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
15312pub struct Presets {
15313    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
15314    ///   * `A` - Available Equity
15315    ///   * `E` - Equal
15316    ///   * `N` - Net Liquidation Value
15317    ///
15318    /// User-specified allocation methods:
15319    ///   * `C` - Cash Quantity
15320    ///   * `P` - Percentage
15321    ///   * `R` - Ratios
15322    ///   * `S` - Shares
15323    pub default_method_for_all: Option<PresetsDefaultMethodForAll>,
15324    /// Determines if allocation groups should prioritize closing positions over equal distribution.
15325    pub group_auto_close_positions: Option<bool>,
15326    /// Determines if the system should keep allocation groups proportional for scaling.
15327    pub group_proportional_allocation: Option<bool>,
15328    /// Determines if allocation profiles should prioritize closing positions over equal distribution.
15329    pub profiles_auto_close_positions: Option<bool>,
15330    /// Determines if the system should always check user credit before beginning the order process every time, or only at the time of order placement and execution.
15331    pub strict_credit_check: Option<bool>,
15332}
15333/// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
15334///   * `A` - Available Equity
15335///   * `E` - Equal
15336///   * `N` - Net Liquidation Value
15337///
15338/// User-specified allocation methods:
15339///   * `C` - Cash Quantity
15340///   * `P` - Percentage
15341///   * `R` - Ratios
15342///   * `S` - Shares
15343#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
15344pub enum PresetsDefaultMethodForAll {
15345    #[default]
15346    AvailableEquity,
15347    E,
15348    N,
15349    C,
15350    P,
15351    R,
15352    S,
15353}
15354impl core::fmt::Display for PresetsDefaultMethodForAll {
15355    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15356        match self {
15357            Self::AvailableEquity => write!(f, "AvailableEquity"),
15358            Self::E => write!(f, "E"),
15359            Self::N => write!(f, "N"),
15360            Self::C => write!(f, "C"),
15361            Self::P => write!(f, "P"),
15362            Self::R => write!(f, "R"),
15363            Self::S => write!(f, "S"),
15364        }
15365    }
15366}
15367/// Preview the projected effects of an order ticket or bracket of orders, including cost and changes to margin and account equity.
15368#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
15369pub struct PreviewMarginImpactRequest {
15370    #[validate(nested)]
15371    pub path: PreviewMarginImpactRequestPath,
15372    #[validate(nested)]
15373    pub body: OrdersSubmissionRequest,
15374}
15375impl PreviewMarginImpactRequest {
15376    /// Parse the HTTP response into the response enum.
15377    pub async fn parse_response(
15378        req: reqwest::Response,
15379    ) -> anyhow::Result<PreviewMarginImpactResponse> {
15380        let status = req.status();
15381        if status == http::StatusCode::OK {
15382            let data =
15383                oas3_gen_support::Diagnostics::<OrderPreview>::json_with_diagnostics(req).await?;
15384            return Ok(PreviewMarginImpactResponse::Ok(data));
15385        }
15386        if status == http::StatusCode::BAD_REQUEST {
15387            let _ = req.bytes().await?;
15388            return Ok(PreviewMarginImpactResponse::BadRequest);
15389        }
15390        if status == http::StatusCode::UNAUTHORIZED {
15391            let _ = req.bytes().await?;
15392            return Ok(PreviewMarginImpactResponse::Unauthorized);
15393        }
15394        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
15395            let _ = req.bytes().await?;
15396            return Ok(PreviewMarginImpactResponse::InternalServerError);
15397        }
15398        if status == http::StatusCode::SERVICE_UNAVAILABLE {
15399            let _ = req.bytes().await?;
15400            return Ok(PreviewMarginImpactResponse::ServiceUnavailable);
15401        }
15402        let _ = req.bytes().await?;
15403        return Ok(PreviewMarginImpactResponse::Unknown);
15404    }
15405}
15406#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
15407pub struct PreviewMarginImpactRequestPath {
15408    /// The account to which the order will clear.
15409    /// - Example: `"DU123456".to_string()`
15410    #[validate(length(min = 1u64))]
15411    pub account_id: String,
15412}
15413/// Response types for previewMarginImpact
15414#[derive(Debug, Clone)]
15415pub enum PreviewMarginImpactResponse {
15416    ///200: Order Preview
15417    Ok(OrderPreview),
15418    ///400: Invalid input format or missing required fields
15419    BadRequest,
15420    ///401: Invalid or expired access token
15421    Unauthorized,
15422    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
15423     */
15424    InternalServerError,
15425    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
15426     */
15427    ServiceUnavailable,
15428    ///default: Unknown response
15429    Unknown,
15430}
15431#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15432#[serde(untagged)]
15433pub enum Query201Response {
15434    #[default]
15435    RecentRecurringEvent(QueryRecentRecurringEventResponse),
15436    BankInstruction(QueryBankInstructionResponse),
15437    RecurringInstructions(QueryRecurringInstructionsResponse),
15438}
15439#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15440#[serde(untagged)]
15441pub enum Query201Response2 {
15442    #[default]
15443    QueryWithdrawableAmountsResponse(QueryWithdrawableAmountsResponse),
15444    WithoutOriginHold(QueryWithdrawableAmountsWithoutOriginHoldResponse),
15445}
15446#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15447pub struct QueryBankInstruction {
15448    /// - Example: `"U399192".to_string()`
15449    #[serde(rename = "accountId")]
15450    #[validate(length(min = 1u64))]
15451    pub account_id: String,
15452    /// - Example: `"WIRE"`
15453    #[serde(rename = "bankInstructionMethod")]
15454    pub bank_instruction_method: BankInstructionMethod,
15455    /// - Example: `1012983.0`
15456    #[serde(rename = "clientInstructionId")]
15457    pub client_instruction_id: f64,
15458}
15459#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15460pub struct QueryBankInstructionResponse {
15461    #[serde(rename = "instructionResult")]
15462    pub instruction_result: Option<QueryBankInstructionResult>,
15463    /// - Example: `-1988905739.0`
15464    #[serde(rename = "instructionSetId")]
15465    pub instruction_set_id: f64,
15466    /// - Example: `202.0`
15467    pub status: f64,
15468}
15469#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15470pub struct QueryBankInstructionResult {
15471    #[serde(rename = "accountId")]
15472    pub account_id: String,
15473    #[serde(rename = "bankInstructionDetails")]
15474    pub bank_instruction_details: Vec<QueryBankInstructionResultBankInstructionDetail>,
15475    #[serde(rename = "bankInstructionMethod")]
15476    pub bank_instruction_method: BankInstructionMethod,
15477    /// - Example: `1012983.0`
15478    #[serde(rename = "clientInstructionId")]
15479    pub client_instruction_id: f64,
15480    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
15481    pub description: Option<String>,
15482    /// - Example: `Some(23456745.0)`
15483    #[serde(rename = "ibReferenceId")]
15484    pub ib_reference_id: Option<f64>,
15485    /// - Example: `45123654.0`
15486    #[serde(rename = "instructionId")]
15487    pub instruction_id: f64,
15488    /// - Example: `"PENDING"`
15489    #[serde(rename = "instructionStatus")]
15490    pub instruction_status: InstructionResultInstructionStatus,
15491    /// - Example: `"INTERNAL_CASH_TRANSFER"`
15492    #[serde(rename = "instructionType")]
15493    pub instruction_type: InstructionResultInstructionType,
15494}
15495#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15496pub struct QueryBankInstructionResultBankInstructionDetail {
15497    /// - Example: `"*****0000".to_string()`
15498    #[serde(rename = "bankAccountNumber")]
15499    pub bank_account_number: String,
15500    /// - Example: `"000000000".to_string()`
15501    #[serde(rename = "bankRoutingNumber")]
15502    pub bank_routing_number: String,
15503    /// - Example: `"USD".to_string()`
15504    pub currency: String,
15505    /// - Example: `"testinstr".to_string()`
15506    #[serde(rename = "instructionName")]
15507    pub instruction_name: String,
15508    /// - Example: `"PROCESSED".to_string()`
15509    #[serde(rename = "instructionStatus")]
15510    pub instruction_status: String,
15511    /// - Example: `"CREDIT".to_string()`
15512    #[serde(rename = "type")]
15513    pub r#type: String,
15514}
15515#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15516pub struct QueryIRAContributions {
15517    /// - Example: `"U399192".to_string()`
15518    #[serde(rename = "accountId")]
15519    #[validate(length(min = 1u64))]
15520    pub account_id: String,
15521    /// - Example: `1012983.0`
15522    #[serde(rename = "clientInstructionId")]
15523    pub client_instruction_id: f64,
15524    /// - Example: `"2003".to_string()`
15525    #[validate(length(min = 4u64, max = 4u64))]
15526    pub year: String,
15527}
15528#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15529pub struct QueryIRAContributionsResponse {
15530    #[serde(rename = "instructionResult")]
15531    pub instruction_result: Option<QueryIRAContributionsResult>,
15532    /// - Example: `-1988905739.0`
15533    #[serde(rename = "instructionSetId")]
15534    pub instruction_set_id: f64,
15535    /// - Example: `202.0`
15536    pub status: f64,
15537}
15538#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15539pub struct QueryIRAContributionsResult {
15540    #[serde(rename = "accountId")]
15541    pub account_id: String,
15542    /// - Example: `1012983.0`
15543    #[serde(rename = "clientInstructionId")]
15544    pub client_instruction_id: f64,
15545    pub contributions: Vec<QueryIRAContributionsResultContribution>,
15546    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
15547    pub description: Option<String>,
15548    pub error: Option<ResultError>,
15549    /// - Example: `Some(23456745.0)`
15550    #[serde(rename = "ibReferenceId")]
15551    pub ib_reference_id: Option<f64>,
15552    /// - Example: `45123654.0`
15553    #[serde(rename = "instructionId")]
15554    pub instruction_id: f64,
15555    /// - Example: `"PENDING"`
15556    #[serde(rename = "instructionStatus")]
15557    pub instruction_status: PollingInstructionResultInstructionStatus,
15558    /// - Example: `"INTERNAL_CASH_TRANSFER"`
15559    #[serde(rename = "instructionType")]
15560    pub instruction_type: InstructionResultInstructionType,
15561    #[serde(rename = "iraType")]
15562    pub ira_type: String,
15563    pub year: String,
15564}
15565#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15566pub struct QueryIRAContributionsResultContribution {
15567    #[serde(rename = "allowedContributionLimit")]
15568    pub allowed_contribution_limit: f64,
15569    #[serde(rename = "maximumContributionLimit")]
15570    pub maximum_contribution_limit: f64,
15571    #[serde(rename = "yearToDateContribution")]
15572    pub year_to_date_contribution: f64,
15573}
15574#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
15575#[serde(untagged)]
15576pub enum QueryInstructionKind {
15577    #[default]
15578    BankInstruction(QueryBankInstruction),
15579    RecentRecurringEvents(QueryRecentRecurringEvents),
15580    RecurringInstructions(QueryRecurringInstructions),
15581}
15582#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
15583#[serde(untagged)]
15584pub enum QueryInstructionKind2 {
15585    #[default]
15586    WithdrawableFunds(QueryWithdrawableFunds),
15587    IRAContributions(QueryIRAContributions),
15588}
15589#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15590pub struct QueryRecentInstructionResponse {
15591    #[serde(rename = "instructionResult")]
15592    pub instruction_result: Option<QueryRecentInstructionResult>,
15593    /// - Example: `-1988905739.0`
15594    #[serde(rename = "instructionSetId")]
15595    pub instruction_set_id: f64,
15596    /// - Example: `202.0`
15597    pub status: f64,
15598}
15599#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15600pub struct QueryRecentInstructionResult {
15601    /// - Example: `1012983.0`
15602    #[serde(rename = "clientInstructionId")]
15603    pub client_instruction_id: f64,
15604    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
15605    pub description: Option<String>,
15606    pub error: Option<ResultError>,
15607    /// - Example: `Some(23456745.0)`
15608    #[serde(rename = "ibReferenceId")]
15609    pub ib_reference_id: Option<f64>,
15610    #[serde(rename = "instructionHistory")]
15611    pub instruction_history: QueryRecentInstructionResultInstructionHistory,
15612    /// - Example: `45123654.0`
15613    #[serde(rename = "instructionId")]
15614    pub instruction_id: f64,
15615    /// - Example: `"PENDING"`
15616    #[serde(rename = "instructionStatus")]
15617    pub instruction_status: PollingInstructionResultInstructionStatus,
15618    /// - Example: `"INTERNAL_CASH_TRANSFER"`
15619    #[serde(rename = "instructionType")]
15620    pub instruction_type: InstructionResultInstructionType,
15621}
15622#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15623pub struct QueryRecentInstructionResultInstructionHistory {
15624    #[serde(rename = "historyMaxDepthNumberOfDays")]
15625    pub history_max_depth_number_of_days: i32,
15626    #[serde(rename = "historyMaxDepthNumberOfInstruction")]
15627    pub history_max_depth_number_of_instruction: i32,
15628    pub result: Vec<serde_json::Value>,
15629}
15630#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15631pub struct QueryRecentInstructions {
15632    /// - Example: `"U399192".to_string()`
15633    #[serde(rename = "accountId")]
15634    #[validate(length(min = 1u64))]
15635    pub account_id: String,
15636    /// - Example: `1012983.0`
15637    #[serde(rename = "clientInstructionId")]
15638    pub client_instruction_id: f64,
15639    #[serde(rename = "transactionHistory")]
15640    #[validate(nested)]
15641    pub transaction_history: QueryRecentInstructionsTransactionHistory,
15642}
15643#[serde_with::skip_serializing_none]
15644#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15645pub struct QueryRecentInstructionsTransactionHistory {
15646    /// - Example: `5.0`
15647    #[serde(rename = "daysToGoBack")]
15648    #[validate(range(min = 1.0))]
15649    pub days_to_go_back: f64,
15650    /// - Example: `Some("INTERNAL_CASH_TRANSFER")`
15651    #[serde(rename = "transactionType")]
15652    pub transaction_type: Option<QueryRecentInstructionsTransactionHistoryTransactionType>,
15653}
15654#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
15655pub enum QueryRecentInstructionsTransactionHistoryTransactionType {
15656    #[serde(rename = "ALL")]
15657    #[default]
15658    All,
15659    #[serde(rename = "ACH_INSTRUCTION")]
15660    AchInstruction,
15661    #[serde(rename = "PREDEFINED_DESTINATION_INSTRUCTION")]
15662    PredefinedDestinationInstruction,
15663    #[serde(rename = "WITHDRAWAL")]
15664    Withdrawal,
15665    #[serde(rename = "DEPOSIT")]
15666    Deposit,
15667    #[serde(rename = "DWAC")]
15668    Dwac,
15669    #[serde(rename = "FOP")]
15670    Fop,
15671    #[serde(rename = "EDDA_INSTRUCTION")]
15672    EddaInstruction,
15673    #[serde(rename = "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")]
15674    TraditionalBankInstructionVerification,
15675    #[serde(rename = "CANCEL_INSTRUCTION")]
15676    CancelInstruction,
15677    #[serde(rename = "DELETE_BANK_INSTRUCTION")]
15678    DeleteBankInstruction,
15679    #[serde(rename = "EXTERNAL_POSITION_TRANSFER")]
15680    ExternalPositionTransfer,
15681    #[serde(rename = "INTERNAL_CASH_TRANSFER")]
15682    InternalCashTransfer,
15683    #[serde(rename = "INTERNAL_POSITION_TRANSFER")]
15684    InternalPositionTransfer,
15685    #[serde(rename = "COMPLEX_ASSET_TRANSFER")]
15686    ComplexAssetTransfer,
15687}
15688impl core::fmt::Display for QueryRecentInstructionsTransactionHistoryTransactionType {
15689    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15690        match self {
15691            Self::All => write!(f, "ALL"),
15692            Self::AchInstruction => write!(f, "ACH_INSTRUCTION"),
15693            Self::PredefinedDestinationInstruction => {
15694                write!(f, "PREDEFINED_DESTINATION_INSTRUCTION")
15695            }
15696            Self::Withdrawal => write!(f, "WITHDRAWAL"),
15697            Self::Deposit => write!(f, "DEPOSIT"),
15698            Self::Dwac => write!(f, "DWAC"),
15699            Self::Fop => write!(f, "FOP"),
15700            Self::EddaInstruction => write!(f, "EDDA_INSTRUCTION"),
15701            Self::TraditionalBankInstructionVerification => {
15702                write!(f, "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")
15703            }
15704            Self::CancelInstruction => write!(f, "CANCEL_INSTRUCTION"),
15705            Self::DeleteBankInstruction => write!(f, "DELETE_BANK_INSTRUCTION"),
15706            Self::ExternalPositionTransfer => write!(f, "EXTERNAL_POSITION_TRANSFER"),
15707            Self::InternalCashTransfer => write!(f, "INTERNAL_CASH_TRANSFER"),
15708            Self::InternalPositionTransfer => write!(f, "INTERNAL_POSITION_TRANSFER"),
15709            Self::ComplexAssetTransfer => write!(f, "COMPLEX_ASSET_TRANSFER"),
15710        }
15711    }
15712}
15713#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15714pub struct QueryRecentRecurringEventResponse {
15715    #[serde(rename = "instructionResult")]
15716    pub instruction_result: Option<QueryRecentRecurringEventResult>,
15717    /// - Example: `-1988905739.0`
15718    #[serde(rename = "instructionSetId")]
15719    pub instruction_set_id: f64,
15720    /// - Example: `202.0`
15721    pub status: f64,
15722}
15723#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15724pub struct QueryRecentRecurringEventResult {
15725    pub amount: f64,
15726    /// - Example: `1012983.0`
15727    #[serde(rename = "clientInstructionId")]
15728    pub client_instruction_id: f64,
15729    pub currency: String,
15730    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
15731    pub description: Option<String>,
15732    /// - Example: `Some(23456745.0)`
15733    #[serde(rename = "ibReferenceId")]
15734    pub ib_reference_id: Option<f64>,
15735    /// - Example: `45123654.0`
15736    #[serde(rename = "instructionId")]
15737    pub instruction_id: f64,
15738    /// - Example: `"PENDING"`
15739    #[serde(rename = "instructionStatus")]
15740    pub instruction_status: InstructionResultInstructionStatus,
15741    /// - Example: `"INTERNAL_CASH_TRANSFER"`
15742    #[serde(rename = "instructionType")]
15743    pub instruction_type: InstructionResultInstructionType,
15744    pub method: String,
15745    #[serde(rename = "recurringInstructionName")]
15746    pub recurring_instruction_name: String,
15747    #[serde(rename = "recurringTransactionStatus")]
15748    pub recurring_transaction_status: String,
15749    #[serde(rename = "recurringTransactionType")]
15750    pub recurring_transaction_type: String,
15751    #[serde(rename = "transactionHistory")]
15752    pub transaction_history: QueryRecentRecurringEventResultTransactionHistory,
15753}
15754#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15755pub struct QueryRecentRecurringEventResultTransactionHistory {
15756    #[serde(rename = "maxNumberOfTransactions")]
15757    pub max_number_of_transactions: Option<i32>,
15758    pub result: Option<Vec<QueryRecentRecurringEventResultTransactionHistoryResult>>,
15759}
15760#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15761pub struct QueryRecentRecurringEventResultTransactionHistoryResult {
15762    #[serde(rename = "ibRequestId")]
15763    pub ib_request_id: Option<i32>,
15764    pub status: Option<String>,
15765}
15766#[serde_with::skip_serializing_none]
15767#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15768pub struct QueryRecentRecurringEvents {
15769    /// - Example: `1012983.0`
15770    #[serde(rename = "clientInstructionId")]
15771    pub client_instruction_id: f64,
15772    /// - Example: `-343872793.0`
15773    #[serde(rename = "ibReferenceId")]
15774    #[validate(range(min = 0.0))]
15775    pub ib_reference_id: f64,
15776    /// - Example: `Some(15.0)`
15777    #[serde(rename = "numberOfTransactions")]
15778    #[validate(range(min = 1.0))]
15779    pub number_of_transactions: Option<f64>,
15780}
15781#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15782pub struct QueryRecurringInstructions {
15783    /// - Example: `"U399192".to_string()`
15784    #[serde(rename = "accountId")]
15785    #[validate(length(min = 1u64))]
15786    pub account_id: String,
15787    /// - Example: `1012983.0`
15788    #[serde(rename = "clientInstructionId")]
15789    pub client_instruction_id: f64,
15790}
15791#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15792pub struct QueryRecurringInstructionsResponse {
15793    #[serde(rename = "instructionResult")]
15794    pub instruction_result: Option<QueryRecurringInstructionsResult>,
15795}
15796#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15797pub struct QueryRecurringInstructionsResult {
15798    #[serde(rename = "accountId")]
15799    pub account_id: String,
15800    /// - Example: `1012983.0`
15801    #[serde(rename = "clientInstructionId")]
15802    pub client_instruction_id: f64,
15803    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
15804    pub description: Option<String>,
15805    /// - Example: `Some(23456745.0)`
15806    #[serde(rename = "ibReferenceId")]
15807    pub ib_reference_id: Option<f64>,
15808    /// - Example: `45123654.0`
15809    #[serde(rename = "instructionId")]
15810    pub instruction_id: f64,
15811    /// - Example: `"PENDING"`
15812    #[serde(rename = "instructionStatus")]
15813    pub instruction_status: InstructionResultInstructionStatus,
15814    /// - Example: `"INTERNAL_CASH_TRANSFER"`
15815    #[serde(rename = "instructionType")]
15816    pub instruction_type: InstructionResultInstructionType,
15817    #[serde(rename = "recurringInstructions")]
15818    pub recurring_instructions: Vec<QueryRecurringInstructionsResultRecurringInstruction>,
15819}
15820#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15821pub struct QueryRecurringInstructionsResultRecurringInstruction {
15822    pub amount: Option<f64>,
15823    #[serde(rename = "bankInstructionMethod")]
15824    pub bank_instruction_method: Option<String>,
15825    #[serde(rename = "bankInstructionName")]
15826    pub bank_instruction_name: Option<String>,
15827    pub currency: Option<String>,
15828    #[serde(rename = "endDate")]
15829    pub end_date: Option<String>,
15830    pub frequency: Option<String>,
15831    #[serde(rename = "requestId")]
15832    pub request_id: Option<i32>,
15833    #[serde(rename = "startDate")]
15834    pub start_date: Option<String>,
15835    #[serde(rename = "transactionType")]
15836    pub transaction_type: Option<String>,
15837}
15838#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
15839#[serde(default)]
15840pub struct QueryRequestBody {
15841    pub instruction: QueryRequestBodyInstruction,
15842    #[serde(rename = "instructionType")]
15843    #[default("QUERY_WITHDRAWABLE_CASH_EQUITY".to_string())]
15844    pub instruction_type: String,
15845}
15846#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
15847pub struct QueryRequestBody2 {
15848    pub instruction: QueryInstructionKind,
15849    #[serde(rename = "instructionType")]
15850    pub instruction_type: QueryRequestBody2InstructionType,
15851}
15852#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
15853pub enum QueryRequestBody2InstructionType {
15854    #[serde(rename = "QUERY_BANK_INSTRUCTION")]
15855    #[default]
15856    QueryBankInstruction,
15857    #[serde(rename = "QUERY_RECENT_RECURRING_EVENTS")]
15858    QueryRecentRecurringEvents,
15859    #[serde(rename = "QUERY_RECURRING_INSTRUCTIONS")]
15860    QueryRecurringInstructions,
15861}
15862impl core::fmt::Display for QueryRequestBody2InstructionType {
15863    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15864        match self {
15865            Self::QueryBankInstruction => write!(f, "QUERY_BANK_INSTRUCTION"),
15866            Self::QueryRecentRecurringEvents => {
15867                write!(f, "QUERY_RECENT_RECURRING_EVENTS")
15868            }
15869            Self::QueryRecurringInstructions => write!(f, "QUERY_RECURRING_INSTRUCTIONS"),
15870        }
15871    }
15872}
15873#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
15874pub struct QueryRequestBody3 {
15875    pub instruction: QueryInstructionKind2,
15876    #[serde(rename = "instructionType")]
15877    pub instruction_type: QueryRequestBody3InstructionType,
15878}
15879#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
15880pub enum QueryRequestBody3InstructionType {
15881    #[serde(rename = "QUERY_WITHDRAWABLE_FUNDS")]
15882    #[default]
15883    QueryWithdrawableFunds,
15884    #[serde(rename = "QUERY_IRA_CONTRIBUTIONS")]
15885    QueryIraContributions,
15886}
15887impl core::fmt::Display for QueryRequestBody3InstructionType {
15888    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
15889        match self {
15890            Self::QueryWithdrawableFunds => write!(f, "QUERY_WITHDRAWABLE_FUNDS"),
15891            Self::QueryIraContributions => write!(f, "QUERY_IRA_CONTRIBUTIONS"),
15892        }
15893    }
15894}
15895#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15896#[serde(default)]
15897pub struct QueryRequestBody4 {
15898    #[validate(nested)]
15899    pub instruction: QueryRecentInstructions,
15900    #[serde(rename = "instructionType")]
15901    #[default("QUERY_RECENT_INSTRUCTIONS".to_string())]
15902    pub instruction_type: String,
15903}
15904#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
15905#[serde(untagged)]
15906pub enum QueryRequestBodyInstruction {
15907    #[default]
15908    QueryWithdrawableCashEquity(QueryWithdrawableCashEquity),
15909}
15910#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15911pub struct QueryWithdrawableAmountsInstructionResult {
15912    #[serde(rename = "accountId")]
15913    pub account_id: String,
15914    #[serde(rename = "allowedTransferAmountToMaster")]
15915    pub allowed_transfer_amount_to_master: f64,
15916    #[serde(rename = "allowedTransferAmountToMasterNoBorrow")]
15917    pub allowed_transfer_amount_to_master_no_borrow: f64,
15918    /// - Example: `1012983.0`
15919    #[serde(rename = "clientInstructionId")]
15920    pub client_instruction_id: f64,
15921    pub currency: String,
15922    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
15923    pub description: Option<String>,
15924    pub error: Option<ResultError>,
15925    /// - Example: `Some(23456745.0)`
15926    #[serde(rename = "ibReferenceId")]
15927    pub ib_reference_id: Option<f64>,
15928    /// - Example: `45123654.0`
15929    #[serde(rename = "instructionId")]
15930    pub instruction_id: f64,
15931    /// - Example: `"PENDING"`
15932    #[serde(rename = "instructionStatus")]
15933    pub instruction_status: PollingInstructionResultInstructionStatus,
15934    /// - Example: `"INTERNAL_CASH_TRANSFER"`
15935    #[serde(rename = "instructionType")]
15936    pub instruction_type: InstructionResultInstructionType,
15937    #[serde(rename = "withdrawableAmount")]
15938    pub withdrawable_amount: f64,
15939    #[serde(rename = "withdrawableAmountNoBorrow")]
15940    pub withdrawable_amount_no_borrow: f64,
15941}
15942#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15943pub struct QueryWithdrawableAmountsResponse {
15944    #[serde(rename = "instructionResult")]
15945    pub instruction_result: Option<QueryWithdrawableAmountsInstructionResult>,
15946    /// - Example: `-1988905739.0`
15947    #[serde(rename = "instructionSetId")]
15948    pub instruction_set_id: f64,
15949    /// - Example: `202.0`
15950    pub status: f64,
15951}
15952#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15953pub struct QueryWithdrawableAmountsWithoutOriginHoldResponse {
15954    #[serde(rename = "instructionResult")]
15955    pub instruction_result: Option<QueryWithdrawableAmountsWithoutOriginHoldResult>,
15956    /// - Example: `-1988905739.0`
15957    #[serde(rename = "instructionSetId")]
15958    pub instruction_set_id: f64,
15959    /// - Example: `202.0`
15960    pub status: f64,
15961}
15962#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
15963pub struct QueryWithdrawableAmountsWithoutOriginHoldResult {
15964    #[serde(rename = "accountId")]
15965    pub account_id: String,
15966    /// - Example: `1012983.0`
15967    #[serde(rename = "clientInstructionId")]
15968    pub client_instruction_id: f64,
15969    pub currency: String,
15970    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
15971    pub description: Option<String>,
15972    pub error: Option<ResultError>,
15973    /// - Example: `Some(23456745.0)`
15974    #[serde(rename = "ibReferenceId")]
15975    pub ib_reference_id: Option<f64>,
15976    /// - Example: `45123654.0`
15977    #[serde(rename = "instructionId")]
15978    pub instruction_id: f64,
15979    /// - Example: `"PENDING"`
15980    #[serde(rename = "instructionStatus")]
15981    pub instruction_status: PollingInstructionResultInstructionStatus,
15982    /// - Example: `"INTERNAL_CASH_TRANSFER"`
15983    #[serde(rename = "instructionType")]
15984    pub instruction_type: InstructionResultInstructionType,
15985    #[serde(rename = "withdrawableAmountWithoutOriginationHold")]
15986    pub withdrawable_amount_without_origination_hold: f64,
15987    #[serde(rename = "withdrawableAmountWithoutOriginationHoldNoBorrow")]
15988    pub withdrawable_amount_without_origination_hold_no_borrow: f64,
15989}
15990#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
15991pub struct QueryWithdrawableCashEquity {
15992    /// - Example: `"U399192".to_string()`
15993    #[serde(rename = "accountId")]
15994    #[validate(length(min = 1u64))]
15995    pub account_id: String,
15996    /// - Example: `1012983.0`
15997    #[serde(rename = "clientInstructionId")]
15998    pub client_instruction_id: f64,
15999    /// - Example: `"USD".to_string()`
16000    #[validate(length(min = 3u64, max = 3u64))]
16001    pub currency: String,
16002}
16003#[serde_with::skip_serializing_none]
16004#[derive(
16005    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
16006)]
16007pub struct QueryWithdrawableCashEquityResponse {
16008    #[serde(rename = "instructionResult")]
16009    #[validate(nested)]
16010    pub instruction_result: Option<QueryWithdrawableCashEquityResult>,
16011    /// - Example: `-1988905739.0`
16012    #[serde(rename = "instructionSetId")]
16013    pub instruction_set_id: f64,
16014    /// - Example: `202.0`
16015    pub status: f64,
16016}
16017#[serde_with::skip_serializing_none]
16018#[derive(
16019    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
16020)]
16021pub struct QueryWithdrawableCashEquityResult {
16022    #[serde(rename = "accountId")]
16023    #[validate(length(min = 1u64))]
16024    pub account_id: String,
16025    #[serde(rename = "availableEquityValue")]
16026    pub available_equity_value: f64,
16027    /// - Example: `1012983.0`
16028    #[serde(rename = "clientInstructionId")]
16029    pub client_instruction_id: f64,
16030    #[validate(length(min = 1u64))]
16031    pub currency: String,
16032    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
16033    pub description: Option<String>,
16034    #[validate(nested)]
16035    pub error: Option<ResultError>,
16036    /// - Example: `Some(23456745.0)`
16037    #[serde(rename = "ibReferenceId")]
16038    pub ib_reference_id: Option<f64>,
16039    /// - Example: `45123654.0`
16040    #[serde(rename = "instructionId")]
16041    pub instruction_id: f64,
16042    /// - Example: `"PENDING"`
16043    #[serde(rename = "instructionStatus")]
16044    pub instruction_status: PollingInstructionResultInstructionStatus,
16045    /// - Example: `"INTERNAL_CASH_TRANSFER"`
16046    #[serde(rename = "instructionType")]
16047    pub instruction_type: InstructionResultInstructionType,
16048    #[serde(rename = "withdrawableCashAmount")]
16049    pub withdrawable_cash_amount: f64,
16050}
16051#[serde_with::skip_serializing_none]
16052#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
16053pub struct QueryWithdrawableFunds {
16054    /// - Example: `"U399192".to_string()`
16055    #[serde(rename = "accountId")]
16056    #[validate(length(min = 1u64))]
16057    pub account_id: String,
16058    /// If bankAccountNumber is provided then bankRoutingNumber is also required, cannot be passed with bankInstructionName
16059    /// - Example: `Some("9876543210".to_string())`
16060    #[serde(rename = "bankAccountNumber")]
16061    #[validate(length(min = 1u64))]
16062    pub bank_account_number: Option<String>,
16063    /// bankInstructionName cannot be passed with (bankAccountNumber or bankRoutingNumber)
16064    /// - Example: `Some("test".to_string())`
16065    #[serde(rename = "bankInstructionName")]
16066    #[validate(length(min = 1u64))]
16067    pub bank_instruction_name: Option<String>,
16068    /// If bankRoutingNumber is provided then bankAccountNumber is also required, cannot be passed with bankInstructionName
16069    /// - Example: `Some("122199983".to_string())`
16070    #[serde(rename = "bankRoutingNumber")]
16071    #[validate(length(min = 1u64))]
16072    pub bank_routing_number: Option<String>,
16073    /// - Example: `1012983.0`
16074    #[serde(rename = "clientInstructionId")]
16075    pub client_instruction_id: f64,
16076    /// - Example: `"USD".to_string()`
16077    #[validate(length(min = 1u64))]
16078    pub currency: String,
16079}
16080#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16081pub struct QuestionnaireResponse {
16082    pub answers: Option<Vec<AnswerResponse>>,
16083    #[serde(rename = "isMandatoryToAnswer")]
16084    pub is_mandatory_to_answer: Option<bool>,
16085    pub question: Option<String>,
16086    #[serde(rename = "questionId")]
16087    pub question_id: Option<i64>,
16088    #[serde(rename = "questionType")]
16089    pub question_type: Option<String>,
16090}
16091#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16092pub struct RateResponse {
16093    /// Returns the exchange rate for the currency pair.
16094    pub rate: Option<f64>,
16095}
16096/// Mark a specific disclaimer message as read.
16097#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
16098pub struct ReadFyiDisclaimerRequest {
16099    pub path: ReadFyiDisclaimerRequestPath,
16100}
16101impl ReadFyiDisclaimerRequest {
16102    /// Parse the HTTP response into the response enum.
16103    pub async fn parse_response(
16104        req: reqwest::Response,
16105    ) -> anyhow::Result<ModifyFyiDeliveryResponse> {
16106        let status = req.status();
16107        if status == http::StatusCode::OK {
16108            let data = oas3_gen_support::Diagnostics::<FyiVT>::json_with_diagnostics(req).await?;
16109            return Ok(ModifyFyiDeliveryResponse::Ok(data));
16110        }
16111        if status == http::StatusCode::BAD_REQUEST {
16112            let _ = req.bytes().await?;
16113            return Ok(ModifyFyiDeliveryResponse::BadRequest);
16114        }
16115        if status == http::StatusCode::UNAUTHORIZED {
16116            let _ = req.bytes().await?;
16117            return Ok(ModifyFyiDeliveryResponse::Unauthorized);
16118        }
16119        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
16120            let _ = req.bytes().await?;
16121            return Ok(ModifyFyiDeliveryResponse::InternalServerError);
16122        }
16123        if status == http::StatusCode::SERVICE_UNAVAILABLE {
16124            let _ = req.bytes().await?;
16125            return Ok(ModifyFyiDeliveryResponse::ServiceUnavailable);
16126        }
16127        let _ = req.bytes().await?;
16128        return Ok(ModifyFyiDeliveryResponse::Unknown);
16129    }
16130}
16131#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
16132pub struct ReadFyiDisclaimerRequestPath {
16133    /// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
16134    ///   * `BA` - Borrow Availability
16135    ///   * `CA` - Comparable Algo
16136    ///   * `DA` - Dividends Advisory
16137    ///   * `EA` - Upcoming Earnings
16138    ///   * `MF` - Mutual Fund Advisory
16139    ///   * `OE` - Option Expiration
16140    ///   * `PR` - Portfolio Builder Rebalance
16141    ///   * `SE` - Suspend Order on Economic Event
16142    ///   * `SG` - Short Term Gain turning Long Term
16143    ///   * `SM` - System Messages
16144    ///   * `T2` - Assignment Realizing Long-Term Gains
16145    ///   * `TO` - Takeover
16146    ///   * `UA` - User Alert
16147    ///   * `M8` - M871 Trades
16148    ///   * `PS` - Platform Use Suggestions
16149    ///   * `DL` - Unexercised Option Loss Prevention Reminder
16150    ///   * `PT` - Position Transfer
16151    ///   * `CB` - Missing Cost Basis
16152    ///   * `MS` - Milestones
16153    ///   * `TD` - MiFID || 10% Deprecation Notice
16154    ///   * `ST` - Save Taxes
16155    ///   * `TI` - Trade Idea
16156    ///   * `CT` - Cash Transfer
16157    pub typecode: Typecodes,
16158}
16159/// Mark a particular notification message as read or unread.
16160#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
16161pub struct ReadFyiNotificationRequest {
16162    pub path: ReadFyiNotificationRequestPath,
16163}
16164impl ReadFyiNotificationRequest {
16165    /// Parse the HTTP response into the response enum.
16166    pub async fn parse_response(
16167        req: reqwest::Response,
16168    ) -> anyhow::Result<ReadFyiNotificationResponse> {
16169        let status = req.status();
16170        if status == http::StatusCode::OK {
16171            let data = oas3_gen_support::Diagnostics::<
16172                NotificationReadAcknowledge,
16173            >::json_with_diagnostics(req)
16174                .await?;
16175            return Ok(ReadFyiNotificationResponse::Ok(data));
16176        }
16177        if status == http::StatusCode::BAD_REQUEST {
16178            let _ = req.bytes().await?;
16179            return Ok(ReadFyiNotificationResponse::BadRequest);
16180        }
16181        if status == http::StatusCode::UNAUTHORIZED {
16182            let _ = req.bytes().await?;
16183            return Ok(ReadFyiNotificationResponse::Unauthorized);
16184        }
16185        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
16186            let _ = req.bytes().await?;
16187            return Ok(ReadFyiNotificationResponse::InternalServerError);
16188        }
16189        if status == http::StatusCode::SERVICE_UNAVAILABLE {
16190            let _ = req.bytes().await?;
16191            return Ok(ReadFyiNotificationResponse::ServiceUnavailable);
16192        }
16193        let _ = req.bytes().await?;
16194        return Ok(ReadFyiNotificationResponse::Unknown);
16195    }
16196}
16197#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
16198pub struct ReadFyiNotificationRequestPath {
16199    /// Code used to signify a specific notification to mark. Value received from /fyi/notifications
16200    pub notification_id: serde_json::Value,
16201}
16202/// Response types for readFyiNotification
16203#[derive(Debug, Clone)]
16204pub enum ReadFyiNotificationResponse {
16205    ///200: Successfully enabled or disabled your email notifications.
16206    Ok(NotificationReadAcknowledge),
16207    ///400: Invalid input format or missing required fields
16208    BadRequest,
16209    ///401: Invalid or expired access token
16210    Unauthorized,
16211    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
16212     */
16213    InternalServerError,
16214    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
16215     */
16216    ServiceUnavailable,
16217    ///default: Unknown response
16218    Unknown,
16219}
16220#[serde_with::skip_serializing_none]
16221#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
16222pub struct RecurringInstructionDetail {
16223    /// - Example: `Some("2023-10-16".to_string())`
16224    #[serde(rename = "endDate")]
16225    pub end_date: Option<String>,
16226    /// - Example: `"MONTHLY"`
16227    pub frequency: RecurringInstructionDetailFrequency,
16228    /// - Example: `"Arkansas-Test".to_string()`
16229    #[serde(rename = "instructionName")]
16230    #[validate(length(min = 1u64, max = 64u64))]
16231    pub instruction_name: String,
16232    /// - Example: `"2023-10-16".to_string()`
16233    #[serde(rename = "startDate")]
16234    #[validate(length(min = 1u64))]
16235    pub start_date: String,
16236}
16237#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
16238pub enum RecurringInstructionDetailFrequency {
16239    #[serde(rename = "MONTHLY")]
16240    #[default]
16241    Monthly,
16242    #[serde(rename = "QUARTERLY")]
16243    Quarterly,
16244    #[serde(rename = "YEARLY")]
16245    Yearly,
16246}
16247impl core::fmt::Display for RecurringInstructionDetailFrequency {
16248    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
16249        match self {
16250            Self::Monthly => write!(f, "MONTHLY"),
16251            Self::Quarterly => write!(f, "QUARTERLY"),
16252            Self::Yearly => write!(f, "YEARLY"),
16253        }
16254    }
16255}
16256#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16257pub struct RegistrationTask {
16258    pub action: Option<String>,
16259    #[serde(rename = "dateCompleted")]
16260    pub date_completed: Option<chrono::DateTime<chrono::Utc>>,
16261    #[serde(rename = "externalId")]
16262    pub external_id: Option<String>,
16263    #[serde(rename = "formName")]
16264    pub form_name: Option<String>,
16265    #[serde(rename = "formNumber")]
16266    pub form_number: Option<i32>,
16267    #[serde(rename = "isCompleted")]
16268    pub is_completed: Option<bool>,
16269    #[serde(rename = "isDeclined")]
16270    pub is_declined: Option<bool>,
16271    #[serde(rename = "isRequiredForApproval")]
16272    pub is_required_for_approval: Option<bool>,
16273    #[serde(rename = "questionIds")]
16274    pub question_ids: Option<Vec<i32>>,
16275    pub state: Option<String>,
16276    pub warning: Option<String>,
16277}
16278#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16279pub struct RegistrationTasksResponse {
16280    #[serde(rename = "accountId")]
16281    pub account_id: Option<String>,
16282    pub description: Option<String>,
16283    pub error: Option<Box<ErrorResponse>>,
16284    #[serde(rename = "errorDescription")]
16285    pub error_description: Option<String>,
16286    #[serde(rename = "hasError")]
16287    pub has_error: Option<bool>,
16288    #[serde(rename = "registrationTaskPresent")]
16289    pub registration_task_present: Option<bool>,
16290    #[serde(rename = "registrationTasks")]
16291    pub registration_tasks: Option<Vec<RegistrationTask>>,
16292    pub state: Option<String>,
16293    pub status: Option<String>,
16294}
16295#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16296#[serde(untagged)]
16297pub enum Reply200Response {
16298    /// A successful submission of one or more order tickets.
16299    #[default]
16300    OrderSubmitSuccess(OrderSubmitSuccess),
16301    /// An array containing objects that each deliver the order reply messages emitted against one order ticket in the submission request's array.  Indicies of the order reply message objects in this array correspond to the indicies of the order tickets in the submission request's array.
16302    OrderReplyMessage(OrderReplyMessage),
16303    /// Indicates that the order reply message or submission was not accepted.
16304    OrderSubmitError(OrderSubmitError),
16305    /// Indicates that the order reply ID does not exist.
16306    OrderReplyNotFound(OrderReplyNotFound),
16307    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
16308    AdvancedOrderReject(AdvancedOrderReject),
16309}
16310impl Reply200Response {
16311    /// Indicates that the order reply message or submission was not accepted.
16312    pub fn order_submit_error(error: Option<String>) -> Self {
16313        Self::OrderSubmitError(OrderSubmitError {
16314            error,
16315            ..Default::default()
16316        })
16317    }
16318    /// Indicates that the order reply ID does not exist.
16319    pub fn order_reply_not_found(error: Option<String>) -> Self {
16320        Self::OrderReplyNotFound(OrderReplyNotFound {
16321            error,
16322            ..Default::default()
16323        })
16324    }
16325    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
16326    pub fn advanced_order_reject() -> Self {
16327        Self::AdvancedOrderReject(AdvancedOrderReject::default())
16328    }
16329}
16330/// Request an access token for the IB username that has granted authorization to the consumer.
16331#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
16332pub struct ReqAccessTokenRequest {
16333    pub header: ReqAccessTokenRequestHeader,
16334}
16335impl ReqAccessTokenRequest {
16336    /// Parse the HTTP response into the response enum.
16337    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ReqAccessTokenResponse> {
16338        let status = req.status();
16339        if status == http::StatusCode::OK {
16340            let data =
16341                oas3_gen_support::Diagnostics::<AccessToken200Response>::json_with_diagnostics(req)
16342                    .await?;
16343            return Ok(ReqAccessTokenResponse::Ok(data));
16344        }
16345        if status == http::StatusCode::UNAUTHORIZED {
16346            let _ = req.bytes().await?;
16347            return Ok(ReqAccessTokenResponse::Unauthorized);
16348        }
16349        if status == http::StatusCode::SERVICE_UNAVAILABLE {
16350            let _ = req.bytes().await?;
16351            return Ok(ReqAccessTokenResponse::ServiceUnavailable);
16352        }
16353        let _ = req.bytes().await?;
16354        return Ok(ReqAccessTokenResponse::Unknown);
16355    }
16356}
16357#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
16358pub struct ReqAccessTokenRequestHeader {
16359    /// OAuth 1.0a authorization request header for request to /access_token endpoint.
16360    /// - Example: `Some("OAuth oauth_verifier=\"1e1dc5666e87ca5a18e0\",oauth_token=\"e0d75b4c5c1d2c0f2af7\",oauth_consumer_key=\"TESTCONS\",oauth_nonce=\"v235...456h\",oauth_signature=\"af1%252...0nd2\",oauth_signature_method=\"RSA-SHA256\",oauth_timestamp=\"1714489450\",realm=\"test_realm\"".to_string())`
16361    pub authorization: Option<String>,
16362}
16363impl core::convert::TryFrom<&ReqAccessTokenRequestHeader> for http::HeaderMap {
16364    type Error = http::header::InvalidHeaderValue;
16365    fn try_from(headers: &ReqAccessTokenRequestHeader) -> core::result::Result<Self, Self::Error> {
16366        let mut map = http::HeaderMap::with_capacity(1usize);
16367        if let Some(value) = &headers.authorization {
16368            let header_value = http::HeaderValue::try_from(value)?;
16369            map.insert(AUTHORIZATION, header_value);
16370        }
16371        Ok(map)
16372    }
16373}
16374impl core::convert::TryFrom<ReqAccessTokenRequestHeader> for http::HeaderMap {
16375    type Error = http::header::InvalidHeaderValue;
16376    fn try_from(headers: ReqAccessTokenRequestHeader) -> core::result::Result<Self, Self::Error> {
16377        http::HeaderMap::try_from(&headers)
16378    }
16379}
16380/// Response types for reqAccessToken
16381#[derive(Debug, Clone)]
16382pub enum ReqAccessTokenResponse {
16383    ///200: Success response with permanent OAuth access token
16384    Ok(AccessToken200Response),
16385    ///401: Invalid or expired access token
16386    Unauthorized,
16387    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
16388     */
16389    ServiceUnavailable,
16390    ///default: Unknown response
16391    Unknown,
16392}
16393#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
16394pub struct ReqIDRequestBody {
16395    /// Request identifier to uniquely track a request.
16396    /// - Example: `540_608i32`
16397    #[serde(rename = "reqID")]
16398    pub req_id: i32,
16399}
16400/// Generate a Live Session Token shared secret and gain access to Web API.
16401#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
16402pub struct ReqLiveSessionTokenRequest {
16403    pub header: ReqLiveSessionTokenRequestHeader,
16404}
16405impl ReqLiveSessionTokenRequest {
16406    /// Parse the HTTP response into the response enum.
16407    pub async fn parse_response(
16408        req: reqwest::Response,
16409    ) -> anyhow::Result<ReqLiveSessionTokenResponse> {
16410        let status = req.status();
16411        if status == http::StatusCode::OK {
16412            let data = oas3_gen_support::Diagnostics::<
16413                LiveSessionToken200Response,
16414            >::json_with_diagnostics(req)
16415                .await?;
16416            return Ok(ReqLiveSessionTokenResponse::Ok(data));
16417        }
16418        if status == http::StatusCode::UNAUTHORIZED {
16419            let _ = req.bytes().await?;
16420            return Ok(ReqLiveSessionTokenResponse::Unauthorized);
16421        }
16422        if status == http::StatusCode::SERVICE_UNAVAILABLE {
16423            let _ = req.bytes().await?;
16424            return Ok(ReqLiveSessionTokenResponse::ServiceUnavailable);
16425        }
16426        let _ = req.bytes().await?;
16427        return Ok(ReqLiveSessionTokenResponse::Unknown);
16428    }
16429}
16430#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
16431pub struct ReqLiveSessionTokenRequestHeader {
16432    /// OAuth 1.0a authorization request header for request to /live_session_token endpoint.
16433    /// - Example: `Some("OAuth diffie_hellman_challenge=\"b393...g6f3\",oauth_token=\"56786fc07bcbabc4584\",oauth_consumer_key=\"TESTCONS\",oauth_nonce=\"v235...456h\",oauth_signature=\"af1%252...0nd2\",oauth_signature_method=\"RSA-SHA256\",oauth_timestamp=\"1714489460\",realm=\"test_realm\"".to_string())`
16434    pub authorization: Option<String>,
16435}
16436impl core::convert::TryFrom<&ReqLiveSessionTokenRequestHeader> for http::HeaderMap {
16437    type Error = http::header::InvalidHeaderValue;
16438    fn try_from(
16439        headers: &ReqLiveSessionTokenRequestHeader,
16440    ) -> core::result::Result<Self, Self::Error> {
16441        let mut map = http::HeaderMap::with_capacity(1usize);
16442        if let Some(value) = &headers.authorization {
16443            let header_value = http::HeaderValue::try_from(value)?;
16444            map.insert(AUTHORIZATION, header_value);
16445        }
16446        Ok(map)
16447    }
16448}
16449impl core::convert::TryFrom<ReqLiveSessionTokenRequestHeader> for http::HeaderMap {
16450    type Error = http::header::InvalidHeaderValue;
16451    fn try_from(
16452        headers: ReqLiveSessionTokenRequestHeader,
16453    ) -> core::result::Result<Self, Self::Error> {
16454        http::HeaderMap::try_from(&headers)
16455    }
16456}
16457/// Response types for reqLiveSessionToken
16458#[derive(Debug, Clone)]
16459pub enum ReqLiveSessionTokenResponse {
16460    ///200: Success response with Diffie-Hellman challenge and Signature value
16461    Ok(LiveSessionToken200Response),
16462    ///401: Invalid or expired access token
16463    Unauthorized,
16464    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
16465     */
16466    ServiceUnavailable,
16467    ///default: Unknown response
16468    Unknown,
16469}
16470/// Request a temporary token as a third party to begin the OAuth 1.0a authorization workflow.
16471#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
16472pub struct ReqTempTokenRequest {
16473    pub header: ReqTempTokenRequestHeader,
16474}
16475impl ReqTempTokenRequest {
16476    /// Parse the HTTP response into the response enum.
16477    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ReqTempTokenResponse> {
16478        let status = req.status();
16479        if status == http::StatusCode::OK {
16480            let data =
16481                oas3_gen_support::Diagnostics::<OauthTokenResponse>::json_with_diagnostics(req)
16482                    .await?;
16483            return Ok(ReqTempTokenResponse::Ok(data));
16484        }
16485        if status == http::StatusCode::UNAUTHORIZED {
16486            let _ = req.bytes().await?;
16487            return Ok(ReqTempTokenResponse::Unauthorized);
16488        }
16489        if status == http::StatusCode::SERVICE_UNAVAILABLE {
16490            let _ = req.bytes().await?;
16491            return Ok(ReqTempTokenResponse::ServiceUnavailable);
16492        }
16493        let _ = req.bytes().await?;
16494        return Ok(ReqTempTokenResponse::Unknown);
16495    }
16496}
16497#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
16498pub struct ReqTempTokenRequestHeader {
16499    /// OAuth 1.0a authorization request header for request to /request_token endpoint.
16500    /// - Example: `Some("OAuth oauth_callback=\"oob\",oauth_consumer_key=\"TESTCONS\",oauth_nonce=\"b249...8f57\",oauth_signature=\"41Sx%252...ZYZ2\",oauth_signature_method=\"RSA-SHA256\",oauth_timestamp=\"1714489440\",realm=\"test_realm\"".to_string())`
16501    pub authorization: Option<String>,
16502}
16503impl core::convert::TryFrom<&ReqTempTokenRequestHeader> for http::HeaderMap {
16504    type Error = http::header::InvalidHeaderValue;
16505    fn try_from(headers: &ReqTempTokenRequestHeader) -> core::result::Result<Self, Self::Error> {
16506        let mut map = http::HeaderMap::with_capacity(1usize);
16507        if let Some(value) = &headers.authorization {
16508            let header_value = http::HeaderValue::try_from(value)?;
16509            map.insert(AUTHORIZATION, header_value);
16510        }
16511        Ok(map)
16512    }
16513}
16514impl core::convert::TryFrom<ReqTempTokenRequestHeader> for http::HeaderMap {
16515    type Error = http::header::InvalidHeaderValue;
16516    fn try_from(headers: ReqTempTokenRequestHeader) -> core::result::Result<Self, Self::Error> {
16517        http::HeaderMap::try_from(&headers)
16518    }
16519}
16520/// Response types for reqTempToken
16521#[derive(Debug, Clone)]
16522pub enum ReqTempTokenResponse {
16523    ///200: Success response with temporary OAuth access token
16524    Ok(OauthTokenResponse),
16525    ///401: Invalid or expired access token
16526    Unauthorized,
16527    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
16528     */
16529    ServiceUnavailable,
16530    ///default: Unknown response
16531    Unknown,
16532}
16533#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16534pub struct RequestDetail {
16535    #[serde(rename = "accountID")]
16536    pub account_id: Option<String>,
16537    #[serde(rename = "dateSubmitted")]
16538    pub date_submitted: Option<String>,
16539    #[serde(rename = "requestId")]
16540    pub request_id: Option<i64>,
16541    #[serde(rename = "requestType")]
16542    pub request_type: Option<String>,
16543    pub status: Option<String>,
16544}
16545#[serde_with::skip_serializing_none]
16546#[derive(
16547    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
16548)]
16549pub struct RequestDetailsRequest {
16550    #[serde(rename = "endDate")]
16551    pub end_date: chrono::NaiveDate,
16552    #[validate(range(min = 1i32, max = 1_000i32))]
16553    pub limit: Option<i32>,
16554    #[validate(range(min = 0i32))]
16555    pub offset: Option<i32>,
16556    #[serde(rename = "startDate")]
16557    pub start_date: chrono::NaiveDate,
16558    pub status: Option<RequestStatus>,
16559}
16560#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16561pub struct RequestDetailsResponse {
16562    pub limit: Option<i32>,
16563    pub offset: Option<i32>,
16564    #[serde(rename = "requestDetails")]
16565    pub request_details: Option<Vec<RequestDetail>>,
16566    pub total: Option<i32>,
16567}
16568#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
16569pub enum RequestStatus {
16570    #[default]
16571    N,
16572    O,
16573    P,
16574    C,
16575    A,
16576    E,
16577    F,
16578    I,
16579    J,
16580    L,
16581    M,
16582    R,
16583    W,
16584    Q,
16585}
16586impl core::fmt::Display for RequestStatus {
16587    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
16588        match self {
16589            Self::N => write!(f, "N"),
16590            Self::O => write!(f, "O"),
16591            Self::P => write!(f, "P"),
16592            Self::C => write!(f, "C"),
16593            Self::A => write!(f, "A"),
16594            Self::E => write!(f, "E"),
16595            Self::F => write!(f, "F"),
16596            Self::I => write!(f, "I"),
16597            Self::J => write!(f, "J"),
16598            Self::L => write!(f, "L"),
16599            Self::M => write!(f, "M"),
16600            Self::R => write!(f, "R"),
16601            Self::W => write!(f, "W"),
16602            Self::Q => write!(f, "Q"),
16603        }
16604    }
16605}
16606#[serde_with::skip_serializing_none]
16607#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
16608pub struct RequiredFormsRequest {
16609    #[serde(rename = "accountType")]
16610    pub account_type: Option<String>,
16611    #[serde(rename = "additionalAccount")]
16612    pub additional_account: Option<bool>,
16613    #[serde(rename = "additionalApplicant")]
16614    pub additional_applicant: Option<bool>,
16615    #[serde(rename = "applicantType")]
16616    pub applicant_type: Option<String>,
16617    pub capability: Option<Vec<String>>,
16618    #[serde(rename = "faTradingAccount")]
16619    pub fa_trading_account: Option<bool>,
16620    pub ira: Option<bool>,
16621    #[serde(rename = "iraType")]
16622    pub ira_type: Option<String>,
16623    #[serde(rename = "mifidCategory")]
16624    pub mifid_category: Option<String>,
16625    #[serde(rename = "processType")]
16626    pub process_type: Option<String>,
16627    #[serde(rename = "requestedFCBP")]
16628    pub requested_fcbp: Option<bool>,
16629    #[serde(rename = "requestedSYEP")]
16630    pub requested_syep: Option<bool>,
16631    #[serde(rename = "residenceCountry")]
16632    pub residence_country: Option<String>,
16633    #[serde(rename = "tradingPermissions")]
16634    pub trading_permissions: Option<Vec<String>>,
16635}
16636#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16637pub struct RequiredFormsResponse {
16638    pub error: Option<Box<ErrorResponse>>,
16639    #[serde(rename = "errorDescription")]
16640    pub error_description: Option<String>,
16641    pub forms: Option<Vec<String>>,
16642    #[serde(rename = "hasError")]
16643    pub has_error: Option<bool>,
16644}
16645/// Removes suppression of all order reply messages that were previously suppressed in the current brokerage session.
16646#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
16647pub struct ResetOrderSuppressionRequest {}
16648impl ResetOrderSuppressionRequest {
16649    /// Parse the HTTP response into the response enum.
16650    pub async fn parse_response(
16651        req: reqwest::Response,
16652    ) -> anyhow::Result<ResetOrderSuppressionResponse> {
16653        let status = req.status();
16654        if status == http::StatusCode::OK {
16655            let data = oas3_gen_support::Diagnostics::<StatusResponse3>::json_with_diagnostics(req)
16656                .await?;
16657            return Ok(ResetOrderSuppressionResponse::Ok(data));
16658        }
16659        if status == http::StatusCode::UNAUTHORIZED {
16660            let _ = req.bytes().await?;
16661            return Ok(ResetOrderSuppressionResponse::Unauthorized);
16662        }
16663        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
16664            let _ = req.bytes().await?;
16665            return Ok(ResetOrderSuppressionResponse::InternalServerError);
16666        }
16667        if status == http::StatusCode::SERVICE_UNAVAILABLE {
16668            let _ = req.bytes().await?;
16669            return Ok(ResetOrderSuppressionResponse::ServiceUnavailable);
16670        }
16671        let _ = req.bytes().await?;
16672        return Ok(ResetOrderSuppressionResponse::Unknown);
16673    }
16674}
16675/// Response types for resetOrderSuppression
16676#[derive(Debug, Clone)]
16677pub enum ResetOrderSuppressionResponse {
16678    ///200: Request's status
16679    Ok(StatusResponse3),
16680    ///401: Invalid or expired access token
16681    Unauthorized,
16682    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
16683     */
16684    InternalServerError,
16685    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
16686     */
16687    ServiceUnavailable,
16688    ///default: Unknown response
16689    Unknown,
16690}
16691#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16692pub struct ResponseData {
16693    /// specify response media types that are acceptable
16694    pub accept: Option<String>,
16695    /// the data type of the value after decoding
16696    #[serde(rename = "dataType")]
16697    pub data_type: Option<String>,
16698    /// encoding used for the value
16699    pub encoding: Option<String>,
16700    /// content encoding flag. Represents whether the response is compressed
16701    pub gzip: Option<bool>,
16702    /// mimeType of document after decoding and serializing the value
16703    #[serde(rename = "mimeType")]
16704    pub mime_type: Option<String>,
16705    /// Base 64 encoded String of byte[]. Byte[] represents compressed data when gzip is true
16706    pub value: Option<String>,
16707}
16708#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16709pub struct ResponseFileResponse {
16710    pub data: Option<serde_json::Value>,
16711    pub error: Option<Box<ErrorResponse>>,
16712    #[serde(rename = "errorDescription")]
16713    pub error_description: Option<String>,
16714    #[serde(rename = "hasError")]
16715    pub has_error: Option<bool>,
16716    #[serde(rename = "isProcessed")]
16717    pub is_processed: Option<bool>,
16718    pub name: Option<String>,
16719}
16720#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16721pub struct RestrictionInfo {
16722    #[serde(rename = "byIB")]
16723    pub by_ib: Option<bool>,
16724    pub id: Option<i32>,
16725    pub name: Option<String>,
16726}
16727/// Signed JWT token
16728pub type RestrictionRequestBody = String;
16729#[derive(
16730    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
16731)]
16732pub struct ResultError {
16733    #[serde(rename = "errorCode")]
16734    #[validate(length(min = 1u64))]
16735    pub error_code: String,
16736    #[serde(rename = "errorMessage")]
16737    #[validate(length(min = 1u64))]
16738    pub error_message: String,
16739}
16740#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16741pub struct Rule200Response {
16742    /// Allowed to sell shares you own.
16743    pub allow_sell_long: Option<bool>,
16744    /// Indicates the industry category of the instrument.
16745    pub category: Option<String>,
16746    /// Classification of Financial Instrument codes
16747    pub cfi_code: Option<String>,
16748    pub classifier: Option<String>,
16749    /// Indicates the name of the company or index.
16750    pub company_name: Option<String>,
16751    /// Indicates the contract identifier of the given contract.
16752    pub con_id: Option<i32>,
16753    pub contract_clarification_type: Option<String>,
16754    /// Indicates the year and month the contract expires.
16755    pub contract_month: Option<String>,
16756    /// Base currency contract is traded in.
16757    pub currency: Option<String>,
16758    /// Returns the CUSIP for the given instrument. Only used in BOND trading.
16759    pub cusip: Option<String>,
16760    /// Indicates the primary exchange for which the contract can be traded.
16761    pub exchange: Option<String>,
16762    /// Returns the expiration month of the contract.
16763    pub expiry_full: Option<String>,
16764    /// Specific group of companies or businesses.
16765    pub industry: Option<String>,
16766    /// Asset class of the instrument.
16767    pub instrument_type: Option<String>,
16768    /// Indicates if the contract supports zero commission trading.
16769    pub is_zero_commission_security: Option<bool>,
16770    /// Contract's symbol from primary exchange. For options it is the OCC symbol.
16771    pub local_symbol: Option<String>,
16772    /// Indicates the final maturity date of the given contract.
16773    pub maturity_date: Option<String>,
16774    /// Indicates the multiplier of the contract.
16775    pub multiplier: Option<String>,
16776    /// Indicates if the contract can be traded outside regular trading hours or not.
16777    pub r_t_h: Option<bool>,
16778    /// detailed contract information
16779    pub rules: Option<ContractRules>,
16780    /// Indicates if the contract can be smart routed or not.
16781    pub smart_available: Option<bool>,
16782    /// Underlying symbol
16783    pub symbol: Option<String>,
16784    /// Indicates the display name of the contract, as shown with Client Portal.
16785    pub text: Option<String>,
16786    /// Designated trading class of the contract.
16787    pub trading_class: Option<String>,
16788    /// Underlying contract identifier for the requested contract.
16789    pub underlying_con_id: Option<i32>,
16790    /// Indicates the issuer of the underlying.
16791    pub underlying_issuer: Option<String>,
16792    /// Comma separated list of support exchanges or trading venues.
16793    pub valid_exchanges: Option<String>,
16794}
16795#[serde_with::skip_serializing_none]
16796#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
16797#[serde(default)]
16798pub struct RuleRequestBody {
16799    /// Contract identifier for the interested contract.
16800    pub conid: i32,
16801    /// Side of the market rules apply too. Set to true for Buy Orders, set to false for Sell orders.
16802    #[serde(rename = "isBuy")]
16803    #[default(Some(true))]
16804    pub is_buy: Option<bool>,
16805    /// Used to find trading rules related to an existing order.
16806    #[serde(rename = "modifyOrder")]
16807    #[default(Some(false))]
16808    pub modify_order: Option<bool>,
16809    /// Specify the order identifier used for tracking a given order.
16810    #[serde(rename = "orderId")]
16811    pub order_id: Option<i32>,
16812}
16813#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16814pub struct Save200Response {
16815    /// Report the behavior when attempting to save.
16816    pub error: Option<String>,
16817    /// Request identifier to uniquely track a request.
16818    #[serde(rename = "reqID")]
16819    pub req_id: Option<i32>,
16820    /// Describes if the model is in polling mode.
16821    #[serde(rename = "subscriptionStatus")]
16822    pub subscription_status: Option<i32>,
16823    /// Signifies that the request was successfully submitted.
16824    pub success: Option<bool>,
16825}
16826#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16827pub struct Save200Response2 {
16828    /// Request identifier to uniquely track a request.
16829    /// - Example: `Some(540_607i32)`
16830    #[serde(rename = "reqID")]
16831    pub req_id: Option<i32>,
16832    /// Signifies that the request was successfully submitted.
16833    pub success: Option<bool>,
16834}
16835#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
16836pub struct SaveRequestBody {
16837    /// Array target cash objects
16838    #[serde(rename = "cashTargets")]
16839    pub cash_targets: Vec<SaveRequestBodyCashTarget>,
16840    /// Personal description of model to read in IBKR GUI elements.
16841    #[validate(length(min = 1u64))]
16842    pub desc: String,
16843    /// Determine if investing and rebalancing should be handled statically or dynamically.
16844    ///  * `true` - Static models will always use the original targets.
16845    ///  * `false` - Dynamic models will adjust allocation in response to market movements.
16846    #[serde(rename = "isStatic")]
16847    pub is_static: bool,
16848    /// Name of your model.
16849    /// - Example: `"Sample-Model".to_string()`
16850    #[validate(length(min = 1u64))]
16851    pub model: String,
16852    /// List containing all contracts to hold in the model.
16853    #[serde(rename = "positionTargets")]
16854    pub position_targets: Vec<SaveRequestBodyPositionTarget>,
16855    /// Request identifier to uniquely track a request.
16856    /// - Example: `540_607i32`
16857    #[serde(rename = "reqID")]
16858    pub req_id: i32,
16859}
16860#[serde_with::skip_serializing_none]
16861#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
16862pub struct SaveRequestBodyCashTarget {
16863    /// Currency code to hold positions.
16864    /// - Example: `Some("USD".to_string())`
16865    pub ccy: Option<String>,
16866    /// Percentage of model to distribute to the given currency.
16867    /// - Example: `Some(0.0)`
16868    pub target: Option<f64>,
16869}
16870#[serde_with::skip_serializing_none]
16871#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
16872pub struct SaveRequestBodyPositionTarget {
16873    /// Contract identifier, conid, to designate which security to hold.
16874    /// - Example: `Some(265_598i32)`
16875    pub conid: Option<i32>,
16876    /// Percentage of model to distribute to the given currency.
16877    /// - Example: `Some(0.0)`
16878    pub target: Option<f64>,
16879}
16880#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16881pub struct ScheduleResponse {
16882    /// Returns the time zone the exchange trades in.
16883    pub exchange_time_zone: Option<String>,
16884    /// Returns a series of date objects of the given contract.
16885    pub schedules: Option<ScheduleResponseSchedules>,
16886}
16887/// Returns a series of date objects of the given contract.
16888#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16889pub struct ScheduleResponseSchedules {
16890    /// object containing the  of hours objects detailing extended and liquid trading.
16891    pub date: Option<ScheduleResponseSchedulesDate>,
16892}
16893/// object containing the  of hours objects detailing extended and liquid trading.
16894#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16895pub struct ScheduleResponseSchedulesDate {
16896    pub extended_hours: Option<Vec<ScheduleResponseSchedulesDateExtendedHour>>,
16897    pub liquid_hours: Option<Vec<ScheduleResponseSchedulesDateLiquidHour>>,
16898}
16899#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16900pub struct ScheduleResponseSchedulesDateExtendedHour {
16901    /// Determines if DAY orders are canceled after 'closing' time.
16902    pub cancel_daily_orders: Option<bool>,
16903    /// Epoch timestamp of the exchange's close.
16904    pub closing: Option<i32>,
16905    /// Epoch timestamp of the exchange's open.
16906    pub opening: Option<i32>,
16907}
16908#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16909pub struct ScheduleResponseSchedulesDateLiquidHour {
16910    /// Epoch timestamp of the exchange's close.
16911    pub closing: Option<i32>,
16912    /// Epoch timestamp of the exchange's open.
16913    pub opening: Option<i32>,
16914}
16915#[serde_with::skip_serializing_none]
16916#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
16917#[serde(default)]
16918pub struct SearchRequestBody {
16919    /// fund search
16920    pub fund: Option<bool>,
16921    #[serde(rename = "fundFamilyConidEx")]
16922    pub fund_family_conid_ex: Option<String>,
16923    pub more: Option<bool>,
16924    /// Denotes if the symbol value is the ticker symbol or part of the company's name.
16925    pub name: Option<bool>,
16926    /// pattern search
16927    pub pattern: Option<bool>,
16928    pub referrer: Option<String>,
16929    /// Available underlying security types:
16930    ///   * `STK` - Represents an underlying as a Stock security type.
16931    ///   * `IND` - Represents an underlying as an Index security type.
16932    ///   * `BOND` - Represents an underlying as a Bond security type.
16933    #[serde(rename = "secType")]
16934    #[default(Some(Default::default()))]
16935    pub sec_type: Option<GetContractSymbolsRequestQuerySecType>,
16936    /// The ticker symbol, bond issuer type, or company name of the equity you are looking to trade.
16937    /// - Example: `"AAPL".to_string()`
16938    #[validate(length(min = 1u64))]
16939    pub symbol: String,
16940}
16941#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16942pub struct SecDefInfoResponse {
16943    /// Name of the company for the given contract.
16944    #[serde(rename = "companyName")]
16945    pub company_name: Option<String>,
16946    /// Contract Identifier of the given contract.
16947    pub conid: Option<i32>,
16948    /// Traded currency allowed for the given contract.
16949    pub currency: Option<String>,
16950    /// Exchange requesting data for.
16951    pub exchange: Option<String>,
16952    /// Primary listing exchange for the given contract.
16953    #[serde(rename = "listingExchange")]
16954    pub listing_exchange: Option<String>,
16955    /// Date of expiration for the given contract.
16956    #[serde(rename = "maturityDate")]
16957    pub maturity_date: Option<String>,
16958    #[serde(rename = "priceRendering")]
16959    pub price_rendering: Option<String>,
16960    /// Set the right for the given contract. * `C` - for Call options. * `P` - for Put options.
16961    pub right: Option<IndividualPositionPutOrCall>,
16962    /// Security type for the given contract.
16963    #[serde(rename = "secType")]
16964    pub sec_type: Option<String>,
16965    /// Returns the given strike value for the given contract.
16966    pub strike: Option<f64>,
16967    /// Ticker symbol for the given contract
16968    pub ticker: Option<String>,
16969    /// Series of all valid exchanges the contract can be traded on in a single comma-separated string.
16970    #[serde(rename = "validExchanges")]
16971    pub valid_exchanges: Option<String>,
16972}
16973pub type SecdefSearchResponse = Vec<SecdefSearchResponseSecdefSearchResponse>;
16974#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
16975pub struct SecdefSearchResponseSecdefSearchResponse {
16976    /// applicable for bonds
16977    pub bondid: Option<i32>,
16978    /// Company Name - Exchange
16979    #[serde(rename = "companyHeader")]
16980    pub company_header: Option<String>,
16981    /// Formal name of the company.
16982    #[serde(rename = "companyName")]
16983    pub company_name: Option<String>,
16984    /// Contract identifier for the unique contract.
16985    pub conid: Option<String>,
16986    /// Primary exchange of the contract
16987    pub description: Option<String>,
16988    /// Returns a string of dates, separated by semicolons.
16989    pub fop: Option<String>,
16990    pub issuers: Option<Vec<SecdefSearchResponseSecdefSearchResponseIssuer>>,
16991    /// Returns a string of dates, separated by semicolons.
16992    pub opt: Option<String>,
16993    /// Returns if the contract is available for trading.
16994    pub restricted: Option<bool>,
16995    pub sections: Option<Vec<SecdefSearchResponseSecdefSearchResponseSection>>,
16996    /// Underlying ticker symbol.
16997    pub symbol: Option<String>,
16998    /// Returns a string of dates, separated by semicolons.
16999    pub war: Option<String>,
17000}
17001#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17002pub struct SecdefSearchResponseSecdefSearchResponseIssuer {
17003    pub id: Option<String>,
17004    pub name: Option<String>,
17005}
17006#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17007pub struct SecdefSearchResponseSecdefSearchResponseSection {
17008    /// semicolon separated list of exchanges
17009    pub exchange: Option<String>,
17010    /// semicolon separated list of months
17011    pub months: Option<String>,
17012    #[serde(rename = "secType")]
17013    pub sec_type: Option<String>,
17014}
17015#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17016pub struct SetAccountResponse {
17017    /// Confirms the account switched to.
17018    #[serde(rename = "acctId")]
17019    pub acct_id: Option<String>,
17020    /// Confirms that the account change was set
17021    pub set: Option<bool>,
17022}
17023/// Assign an account and the amount of cash to allocate into a model.
17024#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
17025pub struct SetAccountinvestmentInModelRequest {
17026    pub body: InvestDivestRequestBody,
17027}
17028impl SetAccountinvestmentInModelRequest {
17029    /// Parse the HTTP response into the response enum.
17030    pub async fn parse_response(
17031        req: reqwest::Response,
17032    ) -> anyhow::Result<SetAccountinvestmentInModelResponse> {
17033        let status = req.status();
17034        if status == http::StatusCode::OK {
17035            let data =
17036                oas3_gen_support::Diagnostics::<InvestDivest200Response>::json_with_diagnostics(
17037                    req,
17038                )
17039                .await?;
17040            return Ok(SetAccountinvestmentInModelResponse::Ok(data));
17041        }
17042        if status == http::StatusCode::UNAUTHORIZED {
17043            let _ = req.bytes().await?;
17044            return Ok(SetAccountinvestmentInModelResponse::Unauthorized);
17045        }
17046        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
17047            let _ = req.bytes().await?;
17048            return Ok(SetAccountinvestmentInModelResponse::InternalServerError);
17049        }
17050        if status == http::StatusCode::SERVICE_UNAVAILABLE {
17051            let _ = req.bytes().await?;
17052            return Ok(SetAccountinvestmentInModelResponse::ServiceUnavailable);
17053        }
17054        let _ = req.bytes().await?;
17055        return Ok(SetAccountinvestmentInModelResponse::Unknown);
17056    }
17057}
17058/// Response types for setAccountinvestmentInModel
17059#[derive(Debug, Clone)]
17060pub enum SetAccountinvestmentInModelResponse {
17061    ///200: Successfully submitted model investment.
17062    Ok(InvestDivest200Response),
17063    ///401: Invalid or expired access token
17064    Unauthorized,
17065    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
17066     */
17067    InternalServerError,
17068    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
17069     */
17070    ServiceUnavailable,
17071    ///default: Unknown response
17072    Unknown,
17073}
17074/// Switch the active account for how you request data. Only available for financial advisors and multi-account structures.
17075#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
17076pub struct SetActiveAccountRequest {
17077    pub body: AcctIdRequestBody,
17078}
17079impl SetActiveAccountRequest {
17080    /// Parse the HTTP response into the response enum.
17081    pub async fn parse_response(
17082        req: reqwest::Response,
17083    ) -> anyhow::Result<SetActiveAccountResponse> {
17084        let status = req.status();
17085        if status == http::StatusCode::OK {
17086            let data =
17087                oas3_gen_support::Diagnostics::<SetAccountResponse>::json_with_diagnostics(req)
17088                    .await?;
17089            return Ok(SetActiveAccountResponse::Ok(data));
17090        }
17091        if status == http::StatusCode::UNAUTHORIZED {
17092            let _ = req.bytes().await?;
17093            return Ok(SetActiveAccountResponse::Unauthorized);
17094        }
17095        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
17096            let _ = req.bytes().await?;
17097            return Ok(SetActiveAccountResponse::InternalServerError);
17098        }
17099        if status == http::StatusCode::SERVICE_UNAVAILABLE {
17100            let _ = req.bytes().await?;
17101            return Ok(SetActiveAccountResponse::ServiceUnavailable);
17102        }
17103        let _ = req.bytes().await?;
17104        return Ok(SetActiveAccountResponse::Unknown);
17105    }
17106}
17107/// Response types for setActiveAccount
17108#[derive(Debug, Clone)]
17109pub enum SetActiveAccountResponse {
17110    ///200: Validates the account swapped to.
17111    Ok(SetAccountResponse),
17112    ///401: Invalid or expired access token
17113    Unauthorized,
17114    /**500: Internal Server Error. Unable to process request if incoming values are not valid. For example accountId is not correct
17115     */
17116    InternalServerError,
17117    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
17118     */
17119    ServiceUnavailable,
17120    ///default: Unknown response
17121    Unknown,
17122}
17123/// Set the preset behavior for new allocation groups for specific events.
17124#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
17125pub struct SetAllocationPresetRequest {
17126    pub body: Presets,
17127}
17128impl SetAllocationPresetRequest {
17129    /// Parse the HTTP response into the response enum.
17130    pub async fn parse_response(
17131        req: reqwest::Response,
17132    ) -> anyhow::Result<SetAllocationPresetResponse> {
17133        let status = req.status();
17134        if status == http::StatusCode::OK {
17135            let data =
17136                oas3_gen_support::Diagnostics::<SuccessResponse2>::json_with_diagnostics(req)
17137                    .await?;
17138            return Ok(SetAllocationPresetResponse::Ok(data));
17139        }
17140        if status == http::StatusCode::UNAUTHORIZED {
17141            let _ = req.bytes().await?;
17142            return Ok(SetAllocationPresetResponse::Unauthorized);
17143        }
17144        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
17145            let _ = req.bytes().await?;
17146            return Ok(SetAllocationPresetResponse::InternalServerError);
17147        }
17148        if status == http::StatusCode::SERVICE_UNAVAILABLE {
17149            let _ = req.bytes().await?;
17150            return Ok(SetAllocationPresetResponse::ServiceUnavailable);
17151        }
17152        let _ = req.bytes().await?;
17153        return Ok(SetAllocationPresetResponse::Unknown);
17154    }
17155}
17156/// Response types for setAllocationPreset
17157#[derive(Debug, Clone)]
17158pub enum SetAllocationPresetResponse {
17159    ///200: Successfully retrieve preset details
17160    Ok(SuccessResponse2),
17161    ///401: Invalid or expired access token
17162    Unauthorized,
17163    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
17164     */
17165    InternalServerError,
17166    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
17167     */
17168    ServiceUnavailable,
17169    ///default: Unknown response
17170    Unknown,
17171}
17172/// Set the active dynamic account.
17173#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
17174pub struct SetDynamicAccountRequest {
17175    #[validate(nested)]
17176    pub body: AcctIdRequestBody2,
17177}
17178impl SetDynamicAccountRequest {
17179    /// Parse the HTTP response into the response enum.
17180    pub async fn parse_response(
17181        req: reqwest::Response,
17182    ) -> anyhow::Result<SetActiveAccountResponse> {
17183        let status = req.status();
17184        if status == http::StatusCode::OK {
17185            let data =
17186                oas3_gen_support::Diagnostics::<SetAccountResponse>::json_with_diagnostics(req)
17187                    .await?;
17188            return Ok(SetActiveAccountResponse::Ok(data));
17189        }
17190        if status == http::StatusCode::UNAUTHORIZED {
17191            let _ = req.bytes().await?;
17192            return Ok(SetActiveAccountResponse::Unauthorized);
17193        }
17194        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
17195            let _ = req.bytes().await?;
17196            return Ok(SetActiveAccountResponse::InternalServerError);
17197        }
17198        if status == http::StatusCode::SERVICE_UNAVAILABLE {
17199            let _ = req.bytes().await?;
17200            return Ok(SetActiveAccountResponse::ServiceUnavailable);
17201        }
17202        let _ = req.bytes().await?;
17203        return Ok(SetActiveAccountResponse::Unknown);
17204    }
17205}
17206/// Set the preset behavior for models.
17207#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
17208pub struct SetModelPresetsRequest {
17209    pub body: ModelPresetsResponse,
17210}
17211impl SetModelPresetsRequest {
17212    /// Parse the HTTP response into the response enum.
17213    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<SetModelPresetsResponse> {
17214        let status = req.status();
17215        if status == http::StatusCode::OK {
17216            let data = oas3_gen_support::Diagnostics::<Save200Response>::json_with_diagnostics(req)
17217                .await?;
17218            return Ok(SetModelPresetsResponse::Ok(data));
17219        }
17220        if status == http::StatusCode::UNAUTHORIZED {
17221            let _ = req.bytes().await?;
17222            return Ok(SetModelPresetsResponse::Unauthorized);
17223        }
17224        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
17225            let _ = req.bytes().await?;
17226            return Ok(SetModelPresetsResponse::InternalServerError);
17227        }
17228        if status == http::StatusCode::SERVICE_UNAVAILABLE {
17229            let _ = req.bytes().await?;
17230            return Ok(SetModelPresetsResponse::ServiceUnavailable);
17231        }
17232        let _ = req.bytes().await?;
17233        return Ok(SetModelPresetsResponse::Unknown);
17234    }
17235}
17236/// Response types for setModelPresets
17237#[derive(Debug, Clone)]
17238pub enum SetModelPresetsResponse {
17239    ///200: Successfully retrieve preset details
17240    Ok(Save200Response),
17241    ///401: Invalid or expired access token
17242    Unauthorized,
17243    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
17244     */
17245    InternalServerError,
17246    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
17247     */
17248    ServiceUnavailable,
17249    ///default: Unknown response
17250    Unknown,
17251}
17252/// Create or Modify a model's target positions.
17253#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
17254pub struct SetModelTargetPositionsRequest {
17255    #[validate(nested)]
17256    pub body: SaveRequestBody,
17257}
17258impl SetModelTargetPositionsRequest {
17259    /// Parse the HTTP response into the response enum.
17260    pub async fn parse_response(
17261        req: reqwest::Response,
17262    ) -> anyhow::Result<SetModelTargetPositionsResponse> {
17263        let status = req.status();
17264        if status == http::StatusCode::OK {
17265            let data =
17266                oas3_gen_support::Diagnostics::<Save200Response2>::json_with_diagnostics(req)
17267                    .await?;
17268            return Ok(SetModelTargetPositionsResponse::Ok(data));
17269        }
17270        if status == http::StatusCode::UNAUTHORIZED {
17271            let _ = req.bytes().await?;
17272            return Ok(SetModelTargetPositionsResponse::Unauthorized);
17273        }
17274        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
17275            let _ = req.bytes().await?;
17276            return Ok(SetModelTargetPositionsResponse::InternalServerError);
17277        }
17278        if status == http::StatusCode::SERVICE_UNAVAILABLE {
17279            let _ = req.bytes().await?;
17280            return Ok(SetModelTargetPositionsResponse::ServiceUnavailable);
17281        }
17282        let _ = req.bytes().await?;
17283        return Ok(SetModelTargetPositionsResponse::Unknown);
17284    }
17285}
17286/// Response types for setModelTargetPositions
17287#[derive(Debug, Clone)]
17288pub enum SetModelTargetPositionsResponse {
17289    ///200: Successfully saved a model
17290    Ok(Save200Response2),
17291    ///401: Invalid or expired access token
17292    Unauthorized,
17293    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
17294     */
17295    InternalServerError,
17296    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
17297     */
17298    ServiceUnavailable,
17299    ///default: Unknown response
17300    Unknown,
17301}
17302/// Side of the order ticket.
17303#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
17304pub enum Side {
17305    #[serde(rename = "BUY")]
17306    #[default]
17307    Buy,
17308    #[serde(rename = "SELL")]
17309    Sell,
17310}
17311impl core::fmt::Display for Side {
17312    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
17313        match self {
17314            Self::Buy => write!(f, "BUY"),
17315            Self::Sell => write!(f, "SELL"),
17316        }
17317    }
17318}
17319#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17320pub struct SignatureAndOwners {
17321    /// Account identifier
17322    #[serde(rename = "accountId")]
17323    pub account_id: Option<String>,
17324    pub applicant: Option<SignatureAndOwnersApplicant>,
17325    pub users: Option<Vec<User>>,
17326}
17327#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17328pub struct SignatureAndOwnersApplicant {
17329    /// All names attached to the account
17330    pub signatures: Option<Vec<String>>,
17331}
17332/// Object containing Bid and Ask data for a single OHLC bar.
17333#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17334pub struct SingleHistoricalBarBidAsk {
17335    /// Closing value of the bar. Indicates the time average ask during the bar.
17336    pub c: Option<f64>,
17337    /// High value of the bar. Indicates the highest ask price during the bar.
17338    pub h: Option<f64>,
17339    /// Low value of the bar. Indicates the lowest bid price during the bar.
17340    pub l: Option<f64>,
17341    /// Opening value of the bar. Indicates the time average bid during the bar.
17342    pub o: Option<f64>,
17343    /// Unix timestamp of the start (chronologically earlier) of the bar.
17344    pub t: Option<i32>,
17345    /// Volume value of the bar. Always returns 0.
17346    pub v: Option<f64>,
17347}
17348/// Object containing Last or Trades data for a single OHLC bar.
17349#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17350pub struct SingleHistoricalBarLast {
17351    /// Closing value of the bar. Indicates the final traded price of the bar.
17352    pub c: Option<f64>,
17353    /// High value of the bar. Indicates the highest traded price of the bar.
17354    pub h: Option<f64>,
17355    /// Low value of the bar. Indicates the lowest traded price of the bar.
17356    pub l: Option<f64>,
17357    /// Opening value of the bar. Indicates first traded price of the bar.
17358    pub o: Option<f64>,
17359    /// Unix timestamp of the start (chronologically earlier) of the bar.
17360    pub t: Option<i32>,
17361    /// Volume value of the bar, returned only for "Last" barType.
17362    pub v: Option<f64>,
17363}
17364/// Object containing Midpoint data for a single OHLC bar.
17365#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17366pub struct SingleHistoricalBarMidpoint {
17367    /// Closing value of the bar. Indicates the last midpoint price traded price during the bar.
17368    pub c: Option<f64>,
17369    /// High value of the bar. Indicates the highest midpoint price traded price during the bar.
17370    pub h: Option<f64>,
17371    /// Low value of the bar. Indicates the lowest midpoint price traded price during the bar.
17372    pub l: Option<f64>,
17373    /// Opening value of the bar. Indicates the starting midpoint price traded price during the bar.
17374    pub o: Option<f64>,
17375    /// Unix timestamp of the start (chronologically earlier) of the bar.
17376    pub t: Option<i32>,
17377    /// Volume value of the bar. Always returns 0.
17378    pub v: Option<f64>,
17379}
17380/// A single order ticket.
17381#[serde_with::skip_serializing_none]
17382#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
17383pub struct SingleOrderSubmissionRequest {
17384    /// Receiving account of the order ticket.
17385    #[serde(rename = "acctId")]
17386    pub acct_id: Option<String>,
17387    /// Instructs IB to execute the order  entirely or not execute at all.
17388    #[serde(rename = "allOrNone")]
17389    pub all_or_none: Option<bool>,
17390    /// Additional price value used in certain order types, such as stop orders.
17391    #[serde(rename = "auxPrice")]
17392    pub aux_price: Option<f64>,
17393    /// Client-configurable order identifier.
17394    #[serde(rename = "cOID")]
17395    pub c_oid: Option<String>,
17396    /// Quantity of currency used with cash quantity orders.
17397    #[serde(rename = "cashQty")]
17398    pub cash_qty: Option<f64>,
17399    /// IB contract ID of the instrument.
17400    pub conid: i32,
17401    /// Contract ID and routing destination together in format 123456@EXCHANGE.
17402    pub conidex: Option<String>,
17403    /// ExtOperator is used to identify external operator
17404    #[serde(rename = "extOperator")]
17405    pub ext_operator: Option<String>,
17406    /// Indicates that a forex order is for currency conversion and should not entail a virtual forex position in the account, where applicable.
17407    #[serde(rename = "isCcyConv")]
17408    pub is_ccy_conv: Option<bool>,
17409    /// Indicates that all orders in the containing array are to be treated as an OCA group.
17410    #[serde(rename = "isSingleGroup")]
17411    pub is_single_group: Option<bool>,
17412    #[serde(rename = "jsonPayload")]
17413    pub json_payload: Option<SingleOrderSubmissionRequestJsonPayload>,
17414    /// The listing exchange of the instrument.
17415    #[serde(rename = "listingExchange")]
17416    pub listing_exchange: Option<String>,
17417    /// For all orders for US Futures products, clients must submit this flag to indicate whether the order was originated manually (by a natural person) or automatically (by an automated trading system transmitting orders without human intervention). Submit a True value to indicate a manually originated order, and submit a False value to indicate an automated order. Orders for USFUT products that do not include this field will be rejected.
17418    #[serde(rename = "manualIndicator")]
17419    pub manual_indicator: Option<bool>,
17420    /// IB order type identifier.
17421    #[serde(rename = "orderType")]
17422    #[validate(length(min = 1u64))]
17423    pub order_type: String,
17424    /// Instructs IB to permit the order to execute outside of regular trading hours.
17425    #[serde(rename = "outsideRTH")]
17426    pub outside_rth: Option<bool>,
17427    /// If the order ticket is a child order in a bracket, the parentId field must be set equal to the cOID provided for the parent order.
17428    #[serde(rename = "parentId")]
17429    pub parent_id: Option<String>,
17430    /// Price of the order ticket, where applicable.
17431    pub price: Option<f64>,
17432    /// Quantity of the order ticket in units of the instrument.
17433    pub quantity: f64,
17434    /// IB internal identifier for order entry UI element.
17435    pub referrer: Option<String>,
17436    /// IB asset class identifier.
17437    #[serde(rename = "secType")]
17438    pub sec_type: Option<String>,
17439    /// Side of the order ticket.
17440    pub side: Side,
17441    /// The name of an execution algorithm.
17442    pub strategy: Option<String>,
17443    /// Parameters governing the selected algorithm, if applicable.
17444    #[serde(rename = "strategyParameters")]
17445    pub strategy_parameters: Option<SingleOrderSubmissionRequestStrategyParameters>,
17446    /// Identifies set of tax lots selected, for gains and losses management.
17447    #[serde(rename = "taxOptimizerId")]
17448    pub tax_optimizer_id: Option<String>,
17449    /// Ticker symbol of the instrument.
17450    pub ticker: Option<String>,
17451    /// Time in force of the order ticket.
17452    pub tif: OrderStatusTif,
17453    /// Offset used with Trailing orders.
17454    #[serde(rename = "trailingAmt")]
17455    pub trailing_amt: Option<f64>,
17456    /// Specifies the type of trailing used with a Trailing order.
17457    #[serde(rename = "trailingType")]
17458    pub trailing_type: Option<SingleOrderSubmissionRequestTrailingType>,
17459    /// Instructs IB to apply the Price Management Algo.
17460    #[serde(rename = "useAdaptive")]
17461    pub use_adaptive: Option<bool>,
17462}
17463#[serde_with::skip_serializing_none]
17464#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
17465pub struct SingleOrderSubmissionRequestJsonPayload {
17466    /// The assigned contents for how the order should be allocated amongst subaccount(s).
17467    pub allocation_profile: Option<SingleOrderSubmissionRequestJsonPayloadAllocationProfile>,
17468}
17469/// The assigned contents for how the order should be allocated amongst subaccount(s).
17470#[serde_with::skip_serializing_none]
17471#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
17472pub struct SingleOrderSubmissionRequestJsonPayloadAllocationProfile {
17473    /// The allocation type to define how shares should be distributed.  A warning message to be pre-approved.
17474    ///    * `SHARE` - Designate the allocation amounts as a quantity of shares.
17475    ///    * `CASH` - Designate the allocation amounts as a quantity of a cash quantity to allocate.
17476    pub alloc_type: Option<SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocType>,
17477    /// List of accounts to allocate a trade and the affiliated quantity.
17478    pub allocations:
17479        Option<Vec<SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocation>>,
17480}
17481/// The allocation type to define how shares should be distributed.  A warning message to be pre-approved.
17482///    * `SHARE` - Designate the allocation amounts as a quantity of shares.
17483///    * `CASH` - Designate the allocation amounts as a quantity of a cash quantity to allocate.
17484#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
17485pub enum SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocType {
17486    #[serde(rename = "SHARE")]
17487    #[default]
17488    Share,
17489    #[serde(rename = "CASH")]
17490    Cash,
17491}
17492impl core::fmt::Display for SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocType {
17493    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
17494        match self {
17495            Self::Share => write!(f, "SHARE"),
17496            Self::Cash => write!(f, "CASH"),
17497        }
17498    }
17499}
17500#[serde_with::skip_serializing_none]
17501#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
17502pub struct SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocation {
17503    /// Account to allocate trades to.
17504    pub account: Option<String>,
17505    /// Allocation to the given account based on the alloc_type.
17506    pub amount: Option<f64>,
17507}
17508/// Parameters governing the selected algorithm, if applicable.
17509#[serde_with::skip_serializing_none]
17510#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
17511pub struct SingleOrderSubmissionRequestStrategyParameters {
17512    /// Placeholder -- these vary by algo (and not always type string, sometimes bool)
17513    #[serde(rename = "PLACEHOLDER")]
17514    pub placeholder: Option<String>,
17515}
17516/// Specifies the type of trailing used with a Trailing order.
17517#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
17518pub enum SingleOrderSubmissionRequestTrailingType {
17519    #[serde(rename = "amt")]
17520    #[default]
17521    Amt,
17522    #[serde(rename = "%")]
17523    Unnamed,
17524}
17525impl core::fmt::Display for SingleOrderSubmissionRequestTrailingType {
17526    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
17527        match self {
17528            Self::Amt => write!(f, "amt"),
17529            Self::Unnamed => write!(f, "%"),
17530        }
17531    }
17532}
17533/// Object detailing a single watchlist.
17534#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17535pub struct SingleWatchlist {
17536    /// Internal use. Unique hash of the watchlist.
17537    pub hash: Option<String>,
17538    /// Identifier of the watchlist.
17539    pub id: Option<String>,
17540    /// Array of instruments contained in the watchlist.
17541    pub instruments: Option<Vec<SingleWatchlistEntry>>,
17542    /// Human-readable display name of the watchlist.
17543    pub name: Option<String>,
17544    /// Indicates whether the watchlist can be edited.
17545    #[serde(rename = "readOnly")]
17546    pub read_only: Option<bool>,
17547}
17548/// Object containing watchlist entry for a single instrument.
17549#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17550pub struct SingleWatchlistEntry {
17551    /// Instrument conid as a string.
17552    #[serde(rename = "C")]
17553    pub c: Option<String>,
17554    /// All-capital, shorthand security type identifier of the instrument.
17555    #[serde(rename = "ST")]
17556    pub st: Option<SingleWatchlistEntryAssetClass>,
17557    /// All-capital, shorthand security type identifier of the instrument.
17558    #[serde(rename = "assetClass")]
17559    pub asset_class: Option<SingleWatchlistEntryAssetClass>,
17560    /// Rendering of the instrument name in Chinese.
17561    #[serde(rename = "chineseName")]
17562    pub chinese_name: Option<String>,
17563    /// IB contract ID of the instrument.
17564    pub conid: Option<i32>,
17565    /// Full display presentation of the instrument symbol.
17566    #[serde(rename = "fullName")]
17567    pub full_name: Option<String>,
17568    /// Complete display name of the instrument.
17569    pub name: Option<String>,
17570    /// Symbol of the instrument.
17571    pub ticker: Option<String>,
17572}
17573/// All-capital, shorthand security type identifier of the instrument.
17574#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
17575pub enum SingleWatchlistEntryAssetClass {
17576    #[serde(rename = "STK")]
17577    #[default]
17578    Stk,
17579    #[serde(rename = "OPT")]
17580    Opt,
17581    #[serde(rename = "FUT")]
17582    Fut,
17583    #[serde(rename = "BOND")]
17584    Bond,
17585    #[serde(rename = "FUND")]
17586    Fund,
17587    #[serde(rename = "WAR")]
17588    War,
17589    #[serde(rename = "CASH")]
17590    Cash,
17591    #[serde(rename = "CRYPTO")]
17592    Crypto,
17593}
17594impl core::fmt::Display for SingleWatchlistEntryAssetClass {
17595    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
17596        match self {
17597            Self::Stk => write!(f, "STK"),
17598            Self::Opt => write!(f, "OPT"),
17599            Self::Fut => write!(f, "FUT"),
17600            Self::Bond => write!(f, "BOND"),
17601            Self::Fund => write!(f, "FUND"),
17602            Self::War => write!(f, "WAR"),
17603            Self::Cash => write!(f, "CASH"),
17604            Self::Crypto => write!(f, "CRYPTO"),
17605        }
17606    }
17607}
17608#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17609pub struct SsoValidateResponse {
17610    /// Returns the time of authentication in epoch time.
17611    #[serde(rename = "AUTH_TIME")]
17612    pub auth_time: Option<i32>,
17613    /// Returns the underlying username of the account.
17614    #[serde(rename = "CREDENTIAL")]
17615    pub credential: Option<String>,
17616    /// Returns the time until SSO session expiration in milliseconds.
17617    #[serde(rename = "EXPIRES")]
17618    pub expires: Option<i32>,
17619    /// Internal use only. Does not reflect the IP address of the user.
17620    #[serde(rename = "IP")]
17621    pub ip: Option<String>,
17622    /// Returns if the account is a trial account or a funded account.
17623    #[serde(rename = "IS_FREE_TRIAL")]
17624    pub is_free_trial: Option<bool>,
17625    /// Returns whether the account is a master account (true) or subaccount (false).
17626    #[serde(rename = "IS_MASTER")]
17627    pub is_master: Option<bool>,
17628    /// Used for Client Portal (Internal use only)
17629    #[serde(rename = "LANDING_APP")]
17630    pub landing_app: Option<String>,
17631    /// Returns the paper username for the account.
17632    #[serde(rename = "PAPER_USER_NAME")]
17633    pub paper_user_name: Option<String>,
17634    /// Returns if the customer requires two factor authentication.
17635    #[serde(rename = "QUALIFIED_FOR_MOBILE_AUTH")]
17636    pub qualified_for_mobile_auth: Option<bool>,
17637    /// Confirms if validation was successful. True if session was validated; false if not.
17638    #[serde(rename = "RESULT")]
17639    pub result: Option<bool>,
17640    /// (Internal use only)
17641    #[serde(rename = "SF_ENABLED")]
17642    pub sf_enabled: Option<bool>,
17643    /// Internal user identifier.
17644    #[serde(rename = "USER_ID")]
17645    pub user_id: Option<i32>,
17646    /// current username logged in for the session.
17647    #[serde(rename = "USER_NAME")]
17648    pub user_name: Option<String>,
17649    /// Returns supported features such as bonds and option trading.
17650    pub features: Option<SsoValidateResponseFeatures>,
17651    /// Returns the last time the user was accessed in epoch time.
17652    #[serde(rename = "lastAccessed")]
17653    pub last_accessed: Option<i32>,
17654    /// Returns the login type. 1 for Live, 2 for Paper
17655    #[serde(rename = "loginType")]
17656    pub login_type: Option<i32>,
17657    /// Returns the region connected to internally.
17658    pub region: Option<String>,
17659}
17660/// Returns supported features such as bonds and option trading.
17661#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17662pub struct SsoValidateResponseFeatures {
17663    /// Returns if bonds can be traded.
17664    pub bond: Option<bool>,
17665    /// Returns if trading calendars are enabled
17666    pub calendar: Option<bool>,
17667    /// Returns the connecting environment to distinguish production or paper.
17668    pub envs: Option<String>,
17669    /// Internal Use Only
17670    #[serde(rename = "newMf")]
17671    pub new_mf: Option<bool>,
17672    /// Returns if option chains can be retrieved in the account.
17673    #[serde(rename = "optionChains")]
17674    pub option_chains: Option<bool>,
17675    /// Returns if realtime market data is available
17676    pub realtime: Option<bool>,
17677    /// Internal Use Only
17678    pub wlms: Option<bool>,
17679}
17680#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17681pub struct StatusResponse {
17682    #[serde(rename = "dateSubmitted")]
17683    pub date_submitted: Option<chrono::DateTime<chrono::Utc>>,
17684    #[serde(rename = "fileData")]
17685    pub file_data: Option<FileData>,
17686    #[serde(rename = "requestId")]
17687    pub request_id: Option<i64>,
17688}
17689/// Confirms successful reply to the server prompt.
17690#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17691pub struct StatusResponse2 {
17692    /// Confirms the successful suppression of specified messageIds. Always returns "Submitted".
17693    pub status: Option<String>,
17694}
17695/// Confirms successful removal of suppression.
17696#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17697pub struct StatusResponse3 {
17698    /// Confirms the successful removal of suppression. Always returns "Submitted".
17699    pub status: Option<String>,
17700}
17701#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17702pub struct StatusResponse4 {
17703    /// Confirms that the logout action was performed successfully.
17704    pub status: Option<bool>,
17705}
17706#[serde_with::skip_serializing_none]
17707#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
17708#[serde(default)]
17709pub struct StmtRequest {
17710    /// account id
17711    #[serde(rename = "accountId")]
17712    #[validate(length(min = 1u64))]
17713    pub account_id: String,
17714    /// array of account id's
17715    /// - Example: `Some(vec!["U123", "U456"].to_string())`
17716    #[serde(rename = "accountIds")]
17717    pub account_ids: Option<Vec<String>>,
17718    /// crypto consolidate flag, If request contains any accounts with crypto segment, will turn request into Crypto Consolidated
17719    #[serde(rename = "cryptoConsolIfAvailable")]
17720    #[default(Some(false))]
17721    pub crypto_consol_if_available: Option<bool>,
17722    /// to date
17723    #[serde(rename = "endDate")]
17724    #[validate(length(min = 1u64))]
17725    pub end_date: String,
17726    /// to gzip the whole response pass true
17727    #[default(Some(false))]
17728    pub gzip: Option<bool>,
17729    /// two character ISO language code
17730    /// - Example: `Some("en, fr defaults to en (english)".to_string())`
17731    #[default(Some("en".to_string()))]
17732    pub language: Option<String>,
17733    /// output format
17734    /// - Example: `Some("application/pdf, text/html, or text/csv".to_string())`
17735    #[serde(rename = "mimeType")]
17736    pub mime_type: Option<String>,
17737    /// possible values are consolidate, concatenate, or customConsolidate
17738    #[serde(rename = "multiAccountFormat")]
17739    pub multi_account_format: Option<String>,
17740    /// from date
17741    #[serde(rename = "startDate")]
17742    #[validate(length(min = 1u64))]
17743    pub start_date: String,
17744}
17745#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17746pub struct Stocks {
17747    /// Additional properties not defined in the schema.
17748    #[serde(flatten)]
17749    pub additional_properties: std::collections::HashMap<String, Vec<serde_json::Value>>,
17750}
17751#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17752pub struct Strike200Response {
17753    /// Array containing a series of comma separated values representing potential call strikes for the instrument.
17754    pub call: Option<Vec<f64>>,
17755    /// Array containing a series of comma separated values representing potential put strikes for the instrument.
17756    pub put: Option<Vec<f64>>,
17757}
17758#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17759pub struct SubAccounts {
17760    /// An array containing all sub-accounts held by the advisor.
17761    pub accounts: Option<Vec<SubAccountsAccount>>,
17762}
17763#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17764pub struct SubAccountsAccount {
17765    /// Contains Net liquidation and available equity of the given account Id.
17766    pub data: Option<Vec<SubAccountsAccountDatum>>,
17767    /// Returns the account ID affiliated with the balance data.
17768    pub name: Option<String>,
17769}
17770#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17771pub struct SubAccountsAccountDatum {
17772    /// Defines the value of the object
17773    ///  * `AvailableEquity` - Indicates the value relates to the Available Equity held within the account
17774    ///  * `NetLiquidation` - Indicates the value relates to the Net Liquidation held within the account
17775    pub key: Option<SubAccountsAccountDatumKey>,
17776    /// Contains the price value affiliated with the key.
17777    pub value: Option<String>,
17778}
17779/// Defines the value of the object
17780///  * `AvailableEquity` - Indicates the value relates to the Available Equity held within the account
17781///  * `NetLiquidation` - Indicates the value relates to the Net Liquidation held within the account
17782#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
17783pub enum SubAccountsAccountDatumKey {
17784    #[default]
17785    AvailableEquity,
17786    NetLiquidation,
17787}
17788impl core::fmt::Display for SubAccountsAccountDatumKey {
17789    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
17790        match self {
17791            Self::AvailableEquity => write!(f, "AvailableEquity"),
17792            Self::NetLiquidation => write!(f, "NetLiquidation"),
17793        }
17794    }
17795}
17796#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
17797pub enum SubType {
17798    #[serde(rename = "ACATS")]
17799    #[default]
17800    Acats,
17801    #[serde(rename = "ATON")]
17802    Aton,
17803}
17804impl core::fmt::Display for SubType {
17805    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
17806        match self {
17807            Self::Acats => write!(f, "ACATS"),
17808            Self::Aton => write!(f, "ATON"),
17809        }
17810    }
17811}
17812pub type Subaccount200Response = Vec<AccountAttributes>;
17813#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17814pub struct Subaccounts2Response {
17815    /// Metadata container describing the subaccounts.
17816    pub metadata: Option<Subaccounts2ResponseMetadata>,
17817    /// List containing all subaccounts of the account structure.
17818    pub subaccounts: Option<Vec<AccountAttributes>>,
17819}
17820/// Metadata container describing the subaccounts.
17821#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17822pub struct Subaccounts2ResponseMetadata {
17823    /// The active page number.
17824    #[serde(rename = "pageNum")]
17825    pub page_num: Option<i32>,
17826    /// Items contained in the returning page.
17827    #[serde(rename = "pageSize")]
17828    pub page_size: Option<i32>,
17829    /// The total number of accounts returned for the page.
17830    pub total: Option<i32>,
17831}
17832/// Submit all pending orders to the models. This is similar to the Model page's Submit All Orders selection.
17833#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
17834pub struct SubmitModelOrdersRequest {
17835    pub body: TransferRequestBody,
17836}
17837impl SubmitModelOrdersRequest {
17838    /// Parse the HTTP response into the response enum.
17839    pub async fn parse_response(
17840        req: reqwest::Response,
17841    ) -> anyhow::Result<SubmitModelOrdersResponse> {
17842        let status = req.status();
17843        if status == http::StatusCode::OK {
17844            let data =
17845                oas3_gen_support::Diagnostics::<Transfer200Response>::json_with_diagnostics(req)
17846                    .await?;
17847            return Ok(SubmitModelOrdersResponse::Ok(data));
17848        }
17849        if status == http::StatusCode::UNAUTHORIZED {
17850            let _ = req.bytes().await?;
17851            return Ok(SubmitModelOrdersResponse::Unauthorized);
17852        }
17853        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
17854            let _ = req.bytes().await?;
17855            return Ok(SubmitModelOrdersResponse::InternalServerError);
17856        }
17857        if status == http::StatusCode::SERVICE_UNAVAILABLE {
17858            let _ = req.bytes().await?;
17859            return Ok(SubmitModelOrdersResponse::ServiceUnavailable);
17860        }
17861        let _ = req.bytes().await?;
17862        return Ok(SubmitModelOrdersResponse::Unknown);
17863    }
17864}
17865/// Response types for submitModelOrders
17866#[derive(Debug, Clone)]
17867pub enum SubmitModelOrdersResponse {
17868    ///200: Successfully transmit all orders.
17869    Ok(Transfer200Response),
17870    ///401: Invalid or expired access token
17871    Unauthorized,
17872    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
17873     */
17874    InternalServerError,
17875    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
17876     */
17877    ServiceUnavailable,
17878    ///default: Unknown response
17879    Unknown,
17880}
17881/// Submit a new order(s) ticket, bracket, or OCA group.
17882#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
17883pub struct SubmitNewOrderRequest {
17884    #[validate(nested)]
17885    pub path: SubmitNewOrderRequestPath,
17886    #[validate(nested)]
17887    pub body: OrdersSubmissionRequest,
17888}
17889impl SubmitNewOrderRequest {
17890    /// Parse the HTTP response into the response enum.
17891    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<SubmitNewOrderResponse> {
17892        let status = req.status();
17893        if status == http::StatusCode::OK {
17894            let data =
17895                oas3_gen_support::Diagnostics::<Order200Response3>::json_with_diagnostics(req)
17896                    .await?;
17897            return Ok(SubmitNewOrderResponse::Ok(data));
17898        }
17899        if status == http::StatusCode::UNAUTHORIZED {
17900            let _ = req.bytes().await?;
17901            return Ok(SubmitNewOrderResponse::Unauthorized);
17902        }
17903        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
17904            let _ = req.bytes().await?;
17905            return Ok(SubmitNewOrderResponse::InternalServerError);
17906        }
17907        if status == http::StatusCode::SERVICE_UNAVAILABLE {
17908            let _ = req.bytes().await?;
17909            return Ok(SubmitNewOrderResponse::ServiceUnavailable);
17910        }
17911        let _ = req.bytes().await?;
17912        return Ok(SubmitNewOrderResponse::Unknown);
17913    }
17914}
17915#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
17916pub struct SubmitNewOrderRequestPath {
17917    /// The account to which the order will clear.
17918    /// - Example: `"DU123456".to_string()`
17919    #[validate(length(min = 1u64))]
17920    pub account_id: String,
17921}
17922/// Response types for submitNewOrder
17923#[derive(Debug, Clone)]
17924pub enum SubmitNewOrderResponse {
17925    ///200: Order submission response (success, error, reply is required or order reject)
17926    Ok(Order200Response3),
17927    ///401: Invalid or expired access token
17928    Unauthorized,
17929    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
17930     */
17931    InternalServerError,
17932    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
17933     */
17934    ServiceUnavailable,
17935    ///default: Unknown response
17936    Unknown,
17937}
17938#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17939pub struct SuccessResponse {
17940    pub success: Option<bool>,
17941}
17942#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17943pub struct SuccessResponse2 {
17944    /// Signifies that the request was successfully submitted.
17945    pub success: Option<bool>,
17946}
17947/// Acknowledges a successful request.
17948#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17949pub struct SuccessResponse3 {
17950    /// The sole key 'success' will have boolean value true.
17951    pub success: Option<bool>,
17952}
17953#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17954pub struct SuccessfulTickleResponse {
17955    /// (Internal Use Only)
17956    pub collission: Option<bool>,
17957    /// Returns connection details for the historical market data server.
17958    pub hmds: Option<SuccessfulTickleResponseHmds>,
17959    pub iserver: Option<SuccessfulTickleResponseIserver>,
17960    /// Returns the session token of the contract.
17961    pub session: Option<String>,
17962    /// Returns the number of milliseconds until the current sso session expires.
17963    #[serde(rename = "ssoExpires")]
17964    pub sso_expires: Option<i32>,
17965    /// (Internal Use Only)
17966    #[serde(rename = "userId")]
17967    pub user_id: Option<i32>,
17968}
17969/// Returns connection details for the historical market data server.
17970#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17971pub struct SuccessfulTickleResponseHmds {
17972    /// Returns authentication details.
17973    #[serde(rename = "authStatus")]
17974    pub auth_status: Option<Vec<serde_json::Value>>,
17975    /// Relays any internal connection errors.
17976    pub error: Option<String>,
17977}
17978#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17979pub struct SuccessfulTickleResponseIserver {
17980    #[serde(rename = "authStatus")]
17981    pub auth_status: Option<BrokerageSessionStatus>,
17982}
17983#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17984pub struct SummaryMarketValueResponse {
17985    /// Returns an object containing market value details of the currency and positions held using that currency.
17986    pub currency: Option<SummaryMarketValueResponseCurrency>,
17987}
17988/// Returns an object containing market value details of the currency and positions held using that currency.
17989#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
17990pub struct SummaryMarketValueResponseCurrency {
17991    /// Total cash value of Cryptocurrencies held.
17992    #[serde(rename = "Cryptocurrency")]
17993    pub cryptocurrency: Option<String>,
17994    /// Exchange rate of the labeled currency to the base currency.
17995    #[serde(rename = "Exchange Rate")]
17996    pub exchange_rate: Option<String>,
17997    /// Total cash value of goverment bonds held.
17998    #[serde(rename = "Govt Bonds")]
17999    pub govt_bonds: Option<String>,
18000    /// Total Month-to-date interest.
18001    #[serde(rename = "MTD Interest")]
18002    pub mtd_interest: Option<String>,
18003    /// Total cash value of notional CFDs held.
18004    #[serde(rename = "Notional CFD")]
18005    pub notional_cfd: Option<String>,
18006    /// Total cash value of bonds held.
18007    pub bonds: Option<String>,
18008    /// Total cash value of CFDs held.
18009    pub cfd: Option<String>,
18010    /// Total cash value of commodities held.
18011    pub commodity: Option<String>,
18012    /// Total cash value of receivable dividends.
18013    pub dividends_receivable: Option<String>,
18014    /// Total cash value of funds held.
18015    pub funds: Option<String>,
18016    /// Total cash value of future options held.
18017    pub future_options: Option<String>,
18018    /// Total cash value of futures held.
18019    pub futures: Option<String>,
18020    /// Total cash value of issuer options held.
18021    pub issuer_option: Option<String>,
18022    /// Total cash value of money market securities held.
18023    pub money_market: Option<String>,
18024    /// Total cash value of mutual funds held.
18025    pub mutual_funds: Option<String>,
18026    /// Total cash value of your net liquidty.
18027    pub net_liquidation: Option<String>,
18028    /// Total cash value of options held.
18029    pub options: Option<String>,
18030    /// Total daily realized profit and loss.
18031    pub realized_pnl: Option<String>,
18032    /// Cash recognized at the time of settlement minus the purchases at time of trade, commissions, taxes, and fees.
18033    pub settled_cash: Option<String>,
18034    /// Total cash value of stocks held.
18035    pub stock: Option<String>,
18036    /// Total cash value of t-bill bonds held.
18037    pub t_bills: Option<String>,
18038    /// Lists the total cash held for the given currency.
18039    pub total_cash: Option<String>,
18040    /// Total daily unrealized profit and loss.
18041    pub unrealized_pnl: Option<String>,
18042    /// Total cash value of warrants held.
18043    pub warrants: Option<String>,
18044}
18045#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18046pub struct SummaryOfAccountBalancesResponse {
18047    /// Contains Commodity-specific balance details.
18048    pub commodities: Option<SummaryOfAccountBalancesResponseCommodities>,
18049    /// Contains Security-specific balance details.
18050    pub securities: Option<SummaryOfAccountBalancesResponseSecurities>,
18051    /// Contains total balance details for the account.
18052    pub total: Option<SummaryOfAccountBalancesResponseTotal>,
18053}
18054/// Contains Commodity-specific balance details.
18055#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18056pub struct SummaryOfAccountBalancesResponseCommodities {
18057    /// Total Month-to-date interest.
18058    #[serde(rename = "MTD Interest")]
18059    pub mtd_interest: Option<String>,
18060    /// Any pending charges for the IBKR debit account.
18061    #[serde(rename = "Pndng Dbt Crd Chrgs")]
18062    pub pndng_dbt_crd_chrgs: Option<String>,
18063    /// Total cash balance in the account
18064    pub cash: Option<String>,
18065    /// * `Cash Accounts` Settled cash
18066    ///  * `Margin Accounts` Total cash value + stock value + bond value + fund value + European & Asian options value.
18067    pub equity_with_loan: Option<String>,
18068    /// The basis for determining the price of the assets in your account.
18069    pub net_liquidation: Option<String>,
18070}
18071/// Contains Security-specific balance details.
18072#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18073pub struct SummaryOfAccountBalancesResponseSecurities {
18074    /// Total Month-to-date interest.
18075    #[serde(rename = "MTD Interest")]
18076    pub mtd_interest: Option<String>,
18077    /// Any pending charges for the IBKR debit account.
18078    #[serde(rename = "Pndng Dbt Crd Chrgs")]
18079    pub pndng_dbt_crd_chrgs: Option<String>,
18080    /// The accounts equity balance including loan value.
18081    #[serde(rename = "Prvs Dy Eqty Wth Ln Vl")]
18082    pub prvs_dy_eqty_wth_ln_vl: Option<String>,
18083    /// Total cash balance in the account
18084    pub cash: Option<String>,
18085    /// * `Cash Accounts` Settled cash
18086    ///  * `Margin Accounts` Total cash value + stock value + bond value + fund value + European & Asian options value.
18087    pub equity_with_loan: Option<String>,
18088    /// The basis for determining the price of the assets in your account.
18089    pub net_liquidation: Option<String>,
18090    /// Equals the sum of the absolute value of all positions except cash, index futures and US treasuries.
18091    pub sec_gross_pos_val: Option<String>,
18092}
18093/// Contains total balance details for the account.
18094#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18095pub struct SummaryOfAccountBalancesResponseTotal {
18096    /// Total Month-to-date interest.
18097    #[serde(rename = "MTD Interest")]
18098    pub mtd_interest: Option<String>,
18099    /// Displays the uncertainty of the Net Liquidating Value associated with after-hours price changes.
18100    #[serde(rename = "Nt Lqdtn Uncrtnty")]
18101    pub nt_lqdtn_uncrtnty: Option<String>,
18102    /// Any pending charges for the IBKR debit account.
18103    #[serde(rename = "Pndng Dbt Crd Chrgs")]
18104    pub pndng_dbt_crd_chrgs: Option<String>,
18105    /// The accounts equity balance including loan value.
18106    #[serde(rename = "Prvs Dy Eqty Wth Ln Vl")]
18107    pub prvs_dy_eqty_wth_ln_vl: Option<String>,
18108    /// Total cash balance in the account
18109    pub cash: Option<String>,
18110    /// * `Cash Accounts` Settled cash
18111    ///  * `Margin Accounts` Total cash value + stock value + bond value + fund value + European & Asian options value.
18112    pub equity_with_loan: Option<String>,
18113    /// The basis for determining the price of the assets in your account.
18114    pub net_liquidation: Option<String>,
18115    /// Equals the sum of the absolute value of all positions except cash, index futures and US treasuries.
18116    pub sec_gross_pos_val: Option<String>,
18117}
18118#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18119pub struct SummaryOfAccountMarginResponse {
18120    #[serde(rename = "Crypto at Paxos")]
18121    pub crypto_at_paxos: Option<SummaryOfAccountMarginResponseCryptoAtPaxos>,
18122    pub commodities: Option<SummaryOfAccountMarginResponseCommodities>,
18123    pub securities: Option<SummaryOfAccountMarginResponseSecurities>,
18124    pub total: Option<SummaryOfAccountMarginResponseCryptoAtPaxos>,
18125}
18126#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18127pub struct SummaryOfAccountMarginResponseCommodities {
18128    /// Provides a projected "at expiration" margin value based on the soon-to-expire contracts in your portfolio.
18129    #[serde(rename = "Prdctd Pst-xpry Mrgn @ Opn")]
18130    pub prdctd_pst_xpry_mrgn_opn: Option<String>,
18131    /// If it is 3:00 pm ET, the next calculation you're looking ahead to is after the close, or the Overnight Initial Margin. If it's 3:00 am ET, the next calculation will be at the market's open.
18132    ///  * `Securities` – Projected maintenance margin requirement as of next period's margin change, in the base currency of the account.
18133    ///  * `Commodities` – Maintenance margin requirement as of next period's margin change in the base currency of the account based on current margin requirements, which are subject to change. This value depends on when you are viewing your margin requirements.
18134    #[serde(rename = "Prjctd Lk Ahd Mntnnc Mrgn")]
18135    pub prjctd_lk_ahd_mntnnc_mrgn: Option<String>,
18136    /// Overnight refers to the window of time after the local market trading day is closed.
18137    ///   * `Securities` – Projected overnight maintenance margin requirement in the base currency of the account.
18138    ///   * `Commodities` – Overnight maintenance margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
18139    #[serde(rename = "Prjctd Ovrnght Mntnnc Mrgn")]
18140    pub prjctd_ovrnght_mntnnc_mrgn: Option<String>,
18141    /// The current RegT margin in use.
18142    #[serde(rename = "RegT Margin")]
18143    pub reg_t_margin: Option<String>,
18144    /// The minimum amount required to open a new position.
18145    pub current_initial: Option<String>,
18146    /// The amount of equity required to maintain your positions.
18147    pub current_maint: Option<String>,
18148    /// Provides a projected "liquid" initial margin value based on account liquidation value.
18149    pub projected_liquidity_inital_margin: Option<String>,
18150    /// Overnight refers to the window of time after the local market trading day is closed.
18151    ///   * Securities – Projected overnight initial margin requirement in the base currency of the account.
18152    ///   * Commodities – Overnight initial margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
18153    pub projected_overnight_initial_margin: Option<String>,
18154}
18155#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18156pub struct SummaryOfAccountMarginResponseCryptoAtPaxos {
18157    /// Provides a projected "at expiration" margin value based on the soon-to-expire contracts in your portfolio.
18158    #[serde(rename = "Prdctd Pst-xpry Mrgn @ Opn")]
18159    pub prdctd_pst_xpry_mrgn_opn: Option<String>,
18160    /// If it is 3:00 pm ET, the next calculation you're looking ahead to is after the close, or the Overnight Initial Margin. If it's 3:00 am ET, the next calculation will be at the market's open.
18161    ///  * `Securities` – Projected maintenance margin requirement as of next period's margin change, in the base currency of the account.
18162    ///  * `Commodities` – Maintenance margin requirement as of next period's margin change in the base currency of the account based on current margin requirements, which are subject to change. This value depends on when you are viewing your margin requirements.
18163    #[serde(rename = "Prjctd Lk Ahd Mntnnc Mrgn")]
18164    pub prjctd_lk_ahd_mntnnc_mrgn: Option<String>,
18165    /// Overnight refers to the window of time after the local market trading day is closed.
18166    ///   * `Securities` – Projected overnight maintenance margin requirement in the base currency of the account.
18167    ///   * `Commodities` – Overnight maintenance margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
18168    #[serde(rename = "Prjctd Ovrnght Mntnnc Mrgn")]
18169    pub prjctd_ovrnght_mntnnc_mrgn: Option<String>,
18170    /// The minimum amount required to open a new position.
18171    pub current_initial: Option<String>,
18172    /// The amount of equity required to maintain your positions.
18173    pub current_maint: Option<String>,
18174    /// Provides a projected "liquid" initial margin value based on account liquidation value.
18175    pub projected_liquidity_inital_margin: Option<String>,
18176    /// Overnight refers to the window of time after the local market trading day is closed.
18177    ///   * Securities – Projected overnight initial margin requirement in the base currency of the account.
18178    ///   * Commodities – Overnight initial margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
18179    pub projected_overnight_initial_margin: Option<String>,
18180}
18181#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18182pub struct SummaryOfAccountMarginResponseSecurities {
18183    /// Provides a projected "at expiration" margin value based on the soon-to-expire contracts in your portfolio.
18184    #[serde(rename = "Prdctd Pst-xpry Mrgn @ Opn")]
18185    pub prdctd_pst_xpry_mrgn_opn: Option<String>,
18186    /// If it is 3:00 pm ET, the next calculation you're looking ahead to is after the close, or the Overnight Initial Margin. If it's 3:00 am ET, the next calculation will be at the market's open.
18187    ///  * `Securities` – Projected maintenance margin requirement as of next period's margin change, in the base currency of the account.
18188    ///  * `Commodities` – Maintenance margin requirement as of next period's margin change in the base currency of the account based on current margin requirements, which are subject to change. This value depends on when you are viewing your margin requirements.
18189    #[serde(rename = "Prjctd Lk Ahd Mntnnc Mrgn")]
18190    pub prjctd_lk_ahd_mntnnc_mrgn: Option<String>,
18191    /// Overnight refers to the window of time after the local market trading day is closed.
18192    ///   * `Securities` – Projected overnight maintenance margin requirement in the base currency of the account.
18193    ///   * `Commodities` – Overnight maintenance margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
18194    #[serde(rename = "Prjctd Ovrnght Mntnnc Mrgn")]
18195    pub prjctd_ovrnght_mntnnc_mrgn: Option<String>,
18196    /// The minimum amount required to open a new position.
18197    pub current_initial: Option<String>,
18198    /// The amount of equity required to maintain your positions.
18199    pub current_maint: Option<String>,
18200    /// Provides a projected "liquid" initial margin value based on account liquidation value.
18201    pub projected_liquidity_inital_margin: Option<String>,
18202    /// Overnight refers to the window of time after the local market trading day is closed.
18203    ///   * Securities – Projected overnight initial margin requirement in the base currency of the account.
18204    ///   * Commodities – Overnight initial margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
18205    pub projected_overnight_initial_margin: Option<String>,
18206}
18207#[serde_with::skip_serializing_none]
18208#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18209pub struct SummaryRequestBody {
18210    /// Name of your model.
18211    /// - Example: `Some("Sample-Model".to_string())`
18212    pub model: Option<String>,
18213    /// Request identifier to uniquely track a request.
18214    /// - Example: `Some(540_609i32)`
18215    #[serde(rename = "reqID")]
18216    pub req_id: Option<i32>,
18217}
18218/// Suppress the specified order reply messages for the duration of the brokerage session.
18219#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
18220pub struct SuppressOrderRepliesRequest {
18221    pub body: MessageIdRequestBody,
18222}
18223impl SuppressOrderRepliesRequest {
18224    /// Parse the HTTP response into the response enum.
18225    pub async fn parse_response(
18226        req: reqwest::Response,
18227    ) -> anyhow::Result<SuppressOrderRepliesResponse> {
18228        let status = req.status();
18229        if status == http::StatusCode::OK {
18230            let data = oas3_gen_support::Diagnostics::<StatusResponse2>::json_with_diagnostics(req)
18231                .await?;
18232            return Ok(SuppressOrderRepliesResponse::Ok(data));
18233        }
18234        if status == http::StatusCode::UNAUTHORIZED {
18235            let _ = req.bytes().await?;
18236            return Ok(SuppressOrderRepliesResponse::Unauthorized);
18237        }
18238        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
18239            let _ = req.bytes().await?;
18240            return Ok(SuppressOrderRepliesResponse::InternalServerError);
18241        }
18242        if status == http::StatusCode::SERVICE_UNAVAILABLE {
18243            let _ = req.bytes().await?;
18244            return Ok(SuppressOrderRepliesResponse::ServiceUnavailable);
18245        }
18246        let _ = req.bytes().await?;
18247        return Ok(SuppressOrderRepliesResponse::Unknown);
18248    }
18249}
18250/// Response types for suppressOrderReplies
18251#[derive(Debug, Clone)]
18252pub enum SuppressOrderRepliesResponse {
18253    ///200: Request's status
18254    Ok(StatusResponse2),
18255    ///401: Invalid or expired access token
18256    Unauthorized,
18257    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
18258     */
18259    InternalServerError,
18260    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
18261     */
18262    ServiceUnavailable,
18263    ///default: Unknown response
18264    Unknown,
18265}
18266#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18267pub struct SynchronousInstructionResponse {
18268    #[serde(rename = "instructionResult")]
18269    pub instruction_result: Option<InstructionResult>,
18270    /// - Example: `-1988905739.0`
18271    #[serde(rename = "instructionSetId")]
18272    pub instruction_set_id: f64,
18273    /// - Example: `202.0`
18274    pub status: f64,
18275}
18276#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18277#[serde(untagged)]
18278pub enum Task200Response {
18279    #[default]
18280    Registration(RegistrationTasksResponse),
18281    Pending(PendingTasksResponse),
18282}
18283impl Task200Response {
18284    pub fn registration() -> Self {
18285        Self::Registration(RegistrationTasksResponse::default())
18286    }
18287    pub fn pending() -> Self {
18288        Self::Pending(PendingTasksResponse::default())
18289    }
18290}
18291pub type Task200Response2 = Vec<TaskActionResponse>;
18292#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18293pub struct TaskActionResponse {
18294    #[serde(rename = "accountId")]
18295    pub account_id: Option<String>,
18296    #[serde(rename = "formNumber")]
18297    pub form_number: Option<i32>,
18298    pub message: Option<String>,
18299    pub status: Option<String>,
18300}
18301#[serde_with::skip_serializing_none]
18302#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
18303#[serde(default)]
18304pub struct TaxFormRequest {
18305    /// Account id
18306    /// - Example: `"UXXXX".to_string()`
18307    #[serde(rename = "accountId")]
18308    #[validate(length(min = 1u64))]
18309    pub account_id: String,
18310    /// format
18311    /// - Example: `"HTML,CSV,PDF".to_string()`
18312    #[validate(length(min = 1u64))]
18313    pub format: String,
18314    /// to gzip the whole response pass true
18315    #[default(Some(false))]
18316    pub gzip: Option<bool>,
18317    /// Tax Form Type (can retrieve available tax documents via /api/v1/tax-documents/available)
18318    /// - Example: `"ALL,1099,1099R,1042S,8949".to_string()`
18319    #[serde(rename = "type")]
18320    #[validate(length(min = 1u64))]
18321    pub r#type: String,
18322    /// Tax Year
18323    /// - Example: `2_023i32`
18324    pub year: i32,
18325}
18326#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18327pub struct TaxFormResponse {
18328    pub data: Option<ResponseData>,
18329}
18330#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18331pub struct TaxFormType {
18332    /// available tax form formats
18333    pub formats: Option<Vec<String>>,
18334    #[serde(rename = "isForm")]
18335    pub is_form: Option<bool>,
18336    /// - Example: `Some("1099".to_string())`
18337    #[serde(rename = "taxFormName")]
18338    pub tax_form_name: Option<String>,
18339}
18340#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18341#[serde(untagged)]
18342pub enum TickleResponse {
18343    #[default]
18344    Successful(SuccessfulTickleResponse),
18345    Failed(FailedTickleResponse),
18346}
18347impl TickleResponse {
18348    pub fn successful() -> Self {
18349        Self::Successful(SuccessfulTickleResponse::default())
18350    }
18351    pub fn failed(error: Option<String>) -> Self {
18352        Self::Failed(FailedTickleResponse {
18353            error,
18354            ..Default::default()
18355        })
18356    }
18357}
18358#[serde_with::skip_serializing_none]
18359#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18360pub struct TokenRequest {
18361    #[serde(rename = "clientAssertion")]
18362    pub client_assertion: Option<String>,
18363    #[serde(rename = "clientAssertionType")]
18364    pub client_assertion_type: Option<String>,
18365    #[serde(rename = "clientAuthenticationMethod")]
18366    pub client_authentication_method: Option<TokenRequestClientAuthenticationMethod>,
18367    #[serde(rename = "clientId")]
18368    pub client_id: Option<String>,
18369    #[serde(rename = "clientSecret")]
18370    pub client_secret: Option<String>,
18371}
18372#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
18373pub enum TokenRequestClientAuthenticationMethod {
18374    #[serde(rename = "private_key_jwt")]
18375    #[default]
18376    PrivateKeyJwt,
18377    #[serde(rename = "client_secret_basic")]
18378    ClientSecretBasic,
18379    #[serde(rename = "client_secret_post")]
18380    ClientSecretPost,
18381}
18382impl core::fmt::Display for TokenRequestClientAuthenticationMethod {
18383    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18384        match self {
18385            Self::PrivateKeyJwt => write!(f, "private_key_jwt"),
18386            Self::ClientSecretBasic => write!(f, "client_secret_basic"),
18387            Self::ClientSecretPost => write!(f, "client_secret_post"),
18388        }
18389    }
18390}
18391#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18392pub struct TokenResponse {
18393    /// The serialized access token
18394    pub access_token: Option<String>,
18395    /// The number of seconds from now until the access token expires
18396    pub expires_in: Option<i64>,
18397    /// The serialized ID token if applicable
18398    pub id_token: Option<String>,
18399    /// The serialized refresh token if applicable
18400    pub refresh_token: Option<String>,
18401    /// The space-delimited list of granted scopes
18402    pub scope: Option<String>,
18403    /// The token type (e.g., Bearer)
18404    pub token_type: Option<String>,
18405}
18406#[serde_with::skip_serializing_none]
18407#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
18408pub struct TradeConfirmationRequest {
18409    /// accound id
18410    /// - Example: `"UXXXX".to_string()`
18411    #[serde(rename = "accountId")]
18412    #[validate(length(min = 1u64))]
18413    pub account_id: String,
18414    /// to date
18415    /// - Example: `"20230115".to_string()`
18416    #[serde(rename = "endDate")]
18417    #[validate(length(min = 1u64))]
18418    pub end_date: String,
18419    /// output format
18420    /// - Example: `Some("application/pdf".to_string())`
18421    #[serde(rename = "mimeType")]
18422    pub mime_type: Option<String>,
18423    /// from date
18424    /// - Example: `"20230102".to_string()`
18425    #[serde(rename = "startDate")]
18426    #[validate(length(min = 1u64))]
18427    pub start_date: String,
18428}
18429#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18430pub struct TradeConfirmationResponse {
18431    pub data: Option<ResponseData>,
18432}
18433/// Array of objects representing executions.
18434pub type TradesResponse = Vec<TradesResponseTradesResponse>;
18435/// Object containing details of a single execution.
18436#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18437pub struct TradesResponseTradesResponse {
18438    /// The IB account ID of the account that received the execution.
18439    pub account: Option<String>,
18440    /// The IB account ID of the account that received the execution.
18441    #[serde(rename = "accountCode")]
18442    pub account_code: Option<String>,
18443    /// The IB account ID of the account that received the execution.
18444    pub account_allocation_name: Option<String>,
18445    /// Identifier of the firm clearing the trade. Value is "IB" if account is cleared by Interactive Brokers.
18446    pub clearing_id: Option<String>,
18447    /// Name of the firm clearing the trade. Value is "IB" if account is cleared by Interactive Brokers.
18448    pub clearing_name: Option<String>,
18449    /// Commissions incurred by the execution. May also include
18450    pub commission: Option<String>,
18451    /// Name of business associated with instrument, or otherwise description of instrument.
18452    pub company_name: Option<String>,
18453    /// Contract ID of the order's instrument.
18454    pub conid: Option<String>,
18455    /// Contract ID and routing destination in format 123456@EXCHANGE.
18456    #[serde(rename = "conidEx")]
18457    pub conid_ex: Option<String>,
18458    /// Human-readable description of the order's instrument.
18459    pub contract_description_1: Option<String>,
18460    /// The exchange or other venue on which the execution occurred.
18461    pub exchange: Option<String>,
18462    /// IB-assigned execution identifier.
18463    pub execution_id: Option<String>,
18464    /// Indicates whether the order ticket is an Event Trading order.
18465    pub is_event_trading: Option<AlertActivationRequestAlertActive>,
18466    /// Indicates whether the trade is the result of a liquidiation by IB.
18467    pub liquidation_trade: Option<AlertActivationRequestAlertActive>,
18468    /// The primary exchange on which the instrument is listed.
18469    pub listing_exchange: Option<String>,
18470    /// net_amount
18471    pub net_amount: Option<f64>,
18472    /// Human-readable description of the outcome of the execution.
18473    pub order_description: Option<String>,
18474    /// Order ID
18475    pub order_id: Option<f64>,
18476    /// The client-provided customer order identifier. Specified via cOID during order submission in the Web API.
18477    pub order_ref: Option<String>,
18478    /// The price at which the execution occurred.
18479    pub price: Option<String>,
18480    /// IB asset class identifier.
18481    pub sec_type: Option<OrderStatusSecType>,
18482    /// Side of the execution.
18483    pub side: Option<TradesResponseTradesResponseSide>,
18484    /// The size of the execution in units of the instrument.
18485    pub size: Option<f64>,
18486    /// The IB username that originated the order ticket against which the execution occurred.
18487    pub submitter: Option<String>,
18488    /// Indicates whether the order is supported by IB's Tax Optimization tool.
18489    pub supports_tax_opt: Option<AlertActivationRequestAlertActive>,
18490    /// Symbol of the instrument involved in the execution.
18491    pub symbol: Option<String>,
18492    /// UTC date and time of the execution in format YYYYMMDD-hh:mm:ss.
18493    pub trade_time: Option<String>,
18494    /// Unix timestamp of the execution time in milliseconds.
18495    pub trade_time_r: Option<i64>,
18496}
18497/// Side of the execution.
18498#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
18499pub enum TradesResponseTradesResponseSide {
18500    #[default]
18501    B,
18502    S,
18503}
18504impl core::fmt::Display for TradesResponseTradesResponseSide {
18505    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18506        match self {
18507            Self::B => write!(f, "B"),
18508            Self::S => write!(f, "S"),
18509        }
18510    }
18511}
18512#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18513#[serde(untagged)]
18514pub enum TradingInstrument {
18515    #[default]
18516    Variant0(TradingInstrumentVariant0),
18517    TradingInstrumentDescription(TradingInstrumentTradingInstrumentDescription),
18518}
18519impl TradingInstrument {
18520    pub fn variant0(conid: f64) -> Self {
18521        Self::Variant0(TradingInstrumentVariant0 {
18522            conid,
18523            ..Default::default()
18524        })
18525    }
18526    pub fn description(
18527        trading_instrument_description: TradingInstrumentTradingInstrumentDescriptionDescription,
18528    ) -> Self {
18529        Self::TradingInstrumentDescription(TradingInstrumentTradingInstrumentDescription {
18530            trading_instrument_description,
18531            ..Default::default()
18532        })
18533    }
18534}
18535#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
18536pub struct TradingInstrumentTradingInstrumentDescription {
18537    #[serde(rename = "tradingInstrumentDescription")]
18538    #[validate(nested)]
18539    pub trading_instrument_description: TradingInstrumentTradingInstrumentDescriptionDescription,
18540}
18541#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
18542pub struct TradingInstrumentTradingInstrumentDescriptionDescription {
18543    /// - Example: `"STK"`
18544    #[serde(rename = "assetType")]
18545    pub asset_type: TradingInstrumentTradingInstrumentDescriptionDescriptionAssetType,
18546    /// - Example: `"459200101".to_string()`
18547    #[serde(rename = "securityId")]
18548    #[validate(length(min = 1u64))]
18549    pub security_id: String,
18550    /// - Example: `"ISIN"`
18551    #[serde(rename = "securityIdType")]
18552    pub security_id_type: TradingInstrumentTradingInstrumentDescriptionDescriptionSecurityIdType,
18553}
18554#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
18555pub enum TradingInstrumentTradingInstrumentDescriptionDescriptionAssetType {
18556    #[serde(rename = "STK")]
18557    #[default]
18558    Stk,
18559    #[serde(rename = "CASH")]
18560    Cash,
18561    #[serde(rename = "UNKNOWN")]
18562    Unknown,
18563    #[serde(rename = "BILL")]
18564    Bill,
18565    #[serde(rename = "BOND")]
18566    Bond,
18567    #[serde(rename = "FUND")]
18568    Fund,
18569    #[serde(rename = "OPT")]
18570    Opt,
18571    #[serde(rename = "WAR")]
18572    War,
18573}
18574impl core::fmt::Display for TradingInstrumentTradingInstrumentDescriptionDescriptionAssetType {
18575    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18576        match self {
18577            Self::Stk => write!(f, "STK"),
18578            Self::Cash => write!(f, "CASH"),
18579            Self::Unknown => write!(f, "UNKNOWN"),
18580            Self::Bill => write!(f, "BILL"),
18581            Self::Bond => write!(f, "BOND"),
18582            Self::Fund => write!(f, "FUND"),
18583            Self::Opt => write!(f, "OPT"),
18584            Self::War => write!(f, "WAR"),
18585        }
18586    }
18587}
18588#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
18589pub enum TradingInstrumentTradingInstrumentDescriptionDescriptionSecurityIdType {
18590    #[serde(rename = "CUSIP")]
18591    #[default]
18592    Cusip,
18593    #[serde(rename = "ISIN")]
18594    Isin,
18595    #[serde(rename = "CASH")]
18596    Cash,
18597}
18598impl core::fmt::Display for TradingInstrumentTradingInstrumentDescriptionDescriptionSecurityIdType {
18599    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18600        match self {
18601            Self::Cusip => write!(f, "CUSIP"),
18602            Self::Isin => write!(f, "ISIN"),
18603            Self::Cash => write!(f, "CASH"),
18604        }
18605    }
18606}
18607#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18608pub struct TradingInstrumentVariant0 {
18609    /// - Example: `459200101.0`
18610    pub conid: f64,
18611}
18612/// trading's schedules
18613pub type TradingSchedule = Vec<TradingScheduleTradingSchedule>;
18614#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18615pub struct TradingScheduleTradingSchedule {
18616    /// exchange description
18617    pub description: Option<String>,
18618    /// short exchange name
18619    pub exchange: Option<String>,
18620    /// Exchange parameter id
18621    pub id: Option<String>,
18622    /// Always contains at least one 'tradingTime' and zero or more 'sessionTime' tags
18623    pub schedules: Option<Vec<TradingScheduleTradingScheduleSchedule>>,
18624    /// References the time zone corresponding to the listed dates and times.
18625    pub timezone: Option<String>,
18626    /// Reference on a trade venue of given exchange parameter
18627    #[serde(rename = "tradeVenueId")]
18628    pub trade_venue_id: Option<String>,
18629}
18630#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18631pub struct TradingScheduleTradingScheduleSchedule {
18632    /// End time of clearing cycle.
18633    #[serde(rename = "clearingCycleEndTime")]
18634    pub clearing_cycle_end_time: Option<String>,
18635    /// Lists the avialble trading sessions. This displays the regular trading hours. If the LIQUID hours differs from the total trading day then a separate 'session' tag is returned.
18636    pub sessions: Option<Vec<TradingScheduleTradingScheduleScheduleSession>>,
18637    /// Date of the clearing schedule. 20000101 stands for any Sat, 20000102 stands for any Sun, … 20000107 stands for any Fri.  Any other date stands for itself.
18638    #[serde(rename = "tradingScheduleDate")]
18639    pub trading_schedule_date: Option<String>,
18640    /// Object containing trading times.
18641    #[serde(rename = "tradingTimes")]
18642    pub trading_times: Option<Vec<TradingScheduleTradingScheduleScheduleTime>>,
18643}
18644#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18645pub struct TradingScheduleTradingScheduleScheduleSession {
18646    /// Closing date time of the sesion.
18647    #[serde(rename = "closingTime")]
18648    pub closing_time: Option<String>,
18649    /// Opening date time of the session.
18650    #[serde(rename = "openingTime")]
18651    pub opening_time: Option<String>,
18652    /// If the whole trading day is considered LIQUID then the value 'LIQUID' is returned.
18653    /// - Example: `Some("LIQUID".to_string())`
18654    pub prop: Option<String>,
18655}
18656#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18657pub struct TradingScheduleTradingScheduleScheduleTime {
18658    /// Cancel time for day orders.
18659    /// - Example: `Some("Y".to_string())`
18660    #[serde(rename = "cancelDayOrders")]
18661    pub cancel_day_orders: Option<String>,
18662    /// Closing time of the trading day.
18663    #[serde(rename = "closingTime")]
18664    pub closing_time: Option<String>,
18665    /// Opening time of the trading day.
18666    #[serde(rename = "openingTime")]
18667    pub opening_time: Option<String>,
18668    /// - Example: `Some("LIQUID".to_string())`
18669    pub prop: Option<String>,
18670}
18671#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
18672pub struct TraditionalBankInstructionVerification {
18673    /// - Example: `"U453454".to_string()`
18674    #[serde(rename = "accountId")]
18675    #[validate(length(min = 1u64, max = 32u64))]
18676    pub account_id: String,
18677    /// - Example: `"ACHUS"`
18678    #[serde(rename = "bankInstructionCode")]
18679    pub bank_instruction_code: TraditionalBankInstructionVerificationBankInstructionCode,
18680    /// - Example: `"TestInstr".to_string()`
18681    #[serde(rename = "bankInstructionName")]
18682    #[validate(length(min = 1u64, max = 100u64))]
18683    pub bank_instruction_name: String,
18684    /// - Example: `1012983.0`
18685    #[serde(rename = "clientInstructionId")]
18686    pub client_instruction_id: f64,
18687    /// - Example: `1.0`
18688    #[serde(rename = "creditAmount1")]
18689    pub credit_amount1: f64,
18690    /// - Example: `2.0`
18691    #[serde(rename = "creditAmount2")]
18692    pub credit_amount2: f64,
18693    /// - Example: `35354345.0`
18694    #[serde(rename = "pendingInstructionId")]
18695    pub pending_instruction_id: f64,
18696}
18697#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
18698pub enum TraditionalBankInstructionVerificationBankInstructionCode {
18699    #[serde(rename = "USACH")]
18700    #[default]
18701    Usach,
18702    #[serde(rename = "CAACH")]
18703    Caach,
18704    #[serde(rename = "ACHUS")]
18705    Achus,
18706    #[serde(rename = "WIRE")]
18707    Wire,
18708}
18709impl core::fmt::Display for TraditionalBankInstructionVerificationBankInstructionCode {
18710    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18711        match self {
18712            Self::Usach => write!(f, "USACH"),
18713            Self::Caach => write!(f, "CAACH"),
18714            Self::Achus => write!(f, "ACHUS"),
18715            Self::Wire => write!(f, "WIRE"),
18716        }
18717    }
18718}
18719#[serde_with::skip_serializing_none]
18720#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18721#[serde(default)]
18722pub struct TransactionRequestBody {
18723    #[serde(rename = "acctIds")]
18724    pub acct_ids: Option<Vec<String>>,
18725    pub conids: Option<Vec<i32>>,
18726    /// Define the currency to display price amounts with.
18727    #[default(Some("USD".to_string()))]
18728    pub currency: Option<String>,
18729    /// Specify the number of days to receive transaction data for.
18730    #[default(Some(90i32))]
18731    pub days: Option<i32>,
18732}
18733#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18734pub struct TransactionsResponse {
18735    /// Returns the currency the account is traded in.
18736    pub currency: Option<String>,
18737    /// Returns the epoch time for the start of requests.
18738    pub from: Option<i32>,
18739    /// Returns the request identifier, getTransactions.
18740    pub id: Option<String>,
18741    /// Returns if the trades are up to date or not.
18742    #[serde(rename = "includesRealTime")]
18743    pub includes_real_time: Option<bool>,
18744    /// Client portal use only
18745    pub nd: Option<i32>,
18746    /// Client portal use only
18747    pub rc: Option<i32>,
18748    /// Returns the object containing the realized pnl for the contract on the date.
18749    pub rpnl: Option<TransactionsResponseRpnl>,
18750    /// Returns the epoch time for the end of requests.
18751    pub to: Option<i32>,
18752    /// Lists all supported transaction values.
18753    pub transactions: Option<Vec<TransactionsResponseTransaction>>,
18754}
18755/// Returns the object containing the realized pnl for the contract on the date.
18756#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18757pub struct TransactionsResponseRpnl {
18758    /// Provides the total amount gained or lost from all days returned
18759    pub amt: Option<String>,
18760    /// Returns an array of realized pnl objects.
18761    pub data: Option<Vec<serde_json::Value>>,
18762    pub items: Option<TransactionsResponseRpnlItems>,
18763}
18764#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18765pub struct TransactionsResponseRpnlItems {
18766    /// Returns the account ID the trade transacted on.
18767    pub acctid: Option<String>,
18768    /// Returns the amount gained or lost on the day.
18769    pub amt: Option<String>,
18770    /// Returns the contract ID of the transaction.
18771    pub conid: Option<String>,
18772    /// Specifies the currency of the realized value.
18773    pub cur: Option<String>,
18774    /// Specifies the date for the transaction.
18775    pub date: Option<String>,
18776    /// Returns the foreign exchnage rate.
18777    #[serde(rename = "fxRate")]
18778    pub fx_rate: Option<i32>,
18779    /// Determines if the day was a loss or gain * `L` - LOSS * `G` - GAIN
18780    pub side: Option<TransactionsResponseRpnlItemsSide>,
18781}
18782/// Determines if the day was a loss or gain * `L` - LOSS * `G` - GAIN
18783#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
18784pub enum TransactionsResponseRpnlItemsSide {
18785    #[default]
18786    L,
18787    G,
18788}
18789impl core::fmt::Display for TransactionsResponseRpnlItemsSide {
18790    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18791        match self {
18792            Self::L => write!(f, "L"),
18793            Self::G => write!(f, "G"),
18794        }
18795    }
18796}
18797#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18798pub struct TransactionsResponseTransaction {
18799    /// Returns the account which made the transaction.
18800    pub acctid: Option<String>,
18801    /// Returns the total value of the trade.
18802    pub amt: Option<f64>,
18803    /// Returns the contract identifier.
18804    pub conid: Option<i32>,
18805    /// Returns the currency of the traded insturment.
18806    pub cur: Option<String>,
18807    /// Reutrns the human-readable datetime of the transaction.
18808    pub date: Option<String>,
18809    /// Returns the long name for the company.
18810    pub desc: Option<String>,
18811    /// Returns the forex conversion rate.
18812    #[serde(rename = "fxRate")]
18813    pub fx_rate: Option<i32>,
18814    /// Returns the price per share of the transaction.
18815    pub pr: Option<f64>,
18816    /// Returns the total quantity traded. Will display a negative value for sell orders, and a positive value for buy orders.
18817    pub qty: Option<i32>,
18818    /// Returns the order side.
18819    #[serde(rename = "type")]
18820    pub r#type: Option<String>,
18821}
18822#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18823pub struct Transfer200Response {
18824    /// Request identifier to uniquely track a request.
18825    /// - Example: `Some(540_608i32)`
18826    #[serde(rename = "reqID")]
18827    pub req_id: Option<i32>,
18828    /// Signifies that the request was successfully submitted.
18829    pub success: Option<bool>,
18830}
18831#[serde_with::skip_serializing_none]
18832#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18833pub struct TransferRequestBody {
18834    /// Order identifier to monitor the order transmissions. Will be set to a valid id if and only if any transfers are present in the response. Otherwise, -1 is returned.
18835    #[serde(rename = "fpOrderId")]
18836    pub fp_order_id: Option<i32>,
18837    /// Request identifier to uniquely track a request.
18838    #[serde(rename = "reqID")]
18839    pub req_id: Option<i32>,
18840}
18841#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18842pub struct TransferRequestBody2 {
18843    pub instruction: TransferRequestBody2Instruction,
18844    #[serde(rename = "instructionType")]
18845    pub instruction_type: TransferRequestBody2InstructionType,
18846}
18847#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18848#[serde(untagged)]
18849pub enum TransferRequestBody2Instruction {
18850    #[default]
18851    FopInstruction(FopInstruction),
18852    DwacInstruction(DwacInstruction),
18853    ComplexAssetTransferInstruction(ComplexAssetTransferInstruction),
18854    ExternalPositionTransfer(ExternalPositionTransfer),
18855}
18856#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
18857pub enum TransferRequestBody2InstructionType {
18858    #[serde(rename = "DWAC")]
18859    #[default]
18860    Dwac,
18861    #[serde(rename = "FOP")]
18862    Fop,
18863    #[serde(rename = "COMPLEX_ASSET_TRANSFER")]
18864    ComplexAssetTransfer,
18865    #[serde(rename = "EXTERNAL_POSITION_TRANSFER")]
18866    ExternalPositionTransfer,
18867}
18868impl core::fmt::Display for TransferRequestBody2InstructionType {
18869    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18870        match self {
18871            Self::Dwac => write!(f, "DWAC"),
18872            Self::Fop => write!(f, "FOP"),
18873            Self::ComplexAssetTransfer => write!(f, "COMPLEX_ASSET_TRANSFER"),
18874            Self::ExternalPositionTransfer => write!(f, "EXTERNAL_POSITION_TRANSFER"),
18875        }
18876    }
18877}
18878#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18879pub struct TransferRequestBody3 {
18880    pub instruction: TransferRequestBody3Instruction,
18881    #[serde(rename = "instructionType")]
18882    pub instruction_type: TransferRequestBody3InstructionType,
18883}
18884#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
18885#[serde(untagged)]
18886pub enum TransferRequestBody3Instruction {
18887    #[default]
18888    Deposit(DepositFundsInstruction),
18889    Withdraw(WithdrawFundsInstruction),
18890}
18891#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
18892pub enum TransferRequestBody3InstructionType {
18893    #[serde(rename = "DEPOSIT")]
18894    #[default]
18895    Deposit,
18896    #[serde(rename = "WITHDRAWAL")]
18897    Withdrawal,
18898}
18899impl core::fmt::Display for TransferRequestBody3InstructionType {
18900    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
18901        match self {
18902            Self::Deposit => write!(f, "DEPOSIT"),
18903            Self::Withdrawal => write!(f, "WITHDRAWAL"),
18904        }
18905    }
18906}
18907#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
18908#[serde(default)]
18909pub struct TransferRequestBody4 {
18910    #[validate(nested)]
18911    pub instruction: InternalPositionTransferInstruction,
18912    #[serde(rename = "instructionType")]
18913    #[default("INTERNAL_POSITION_TRANSFER".to_string())]
18914    pub instruction_type: String,
18915}
18916#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
18917#[serde(default)]
18918pub struct TransferRequestBody5 {
18919    #[validate(nested)]
18920    pub instruction: InternalCashTransferInstruction,
18921    #[serde(rename = "instructionType")]
18922    #[default("INTERNAL_CASH_TRANSFER".to_string())]
18923    pub instruction_type: String,
18924}
18925/// a contract's security definition
18926#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18927pub struct TrsrvSecDefResponse {
18928    pub secdef: Option<Vec<TrsrvSecDefResponseSecdef>>,
18929}
18930#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
18931pub struct TrsrvSecDefResponseSecdef {
18932    /// A series of exchanges the given symbol can trade on.
18933    #[serde(rename = "allExchanges")]
18934    pub all_exchanges: Option<String>,
18935    /// The asset class or security type of the contract.
18936    #[serde(rename = "assetClass")]
18937    pub asset_class: Option<String>,
18938    /// The Chinese characters for the symbol.
18939    #[serde(rename = "chineseName")]
18940    pub chinese_name: Option<String>,
18941    /// The conID
18942    pub conid: Option<i32>,
18943    /// The country code the contract is traded on.
18944    #[serde(rename = "countryCode")]
18945    pub country_code: Option<String>,
18946    /// The traded currency for the contract.
18947    pub currency: Option<String>,
18948    /// Returns rules regarding incrementation for order placement. Not functional for all exchanges. Please see /iserver/contract/rules for more accurate rule details.
18949    #[serde(rename = "displayRule")]
18950    pub display_rule: Option<Vec<TrsrvSecDefResponseSecdefDisplayRule>>,
18951    /// The expiry of the contract. Returns null for non-expiry instruments.
18952    pub expiry: Option<String>,
18953    /// Returns symbol name for requested contract.
18954    #[serde(rename = "fullName")]
18955    pub full_name: Option<String>,
18956    /// The group or industry the contract is affilated with.
18957    pub group: Option<String>,
18958    /// contract has tradable options contracts.
18959    #[serde(rename = "hasOptions")]
18960    pub has_options: Option<bool>,
18961    /// Indicates increment rule values including lowerEdge and increment value.
18962    #[serde(rename = "incrementRules")]
18963    pub increment_rules: Option<Vec<TrsrvSecDefResponseSecdefIncrementRule>>,
18964    /// The contract is an event contract or not.
18965    #[serde(rename = "isEventContract")]
18966    pub is_event_contract: Option<bool>,
18967    /// The contract is US based or not.
18968    #[serde(rename = "isUS")]
18969    pub is_us: Option<bool>,
18970    /// The last trading day of the contract.
18971    #[serde(rename = "lastTradingDay")]
18972    pub last_trading_day: Option<String>,
18973    /// The primary or listing exchange the contract is hosted on.
18974    #[serde(rename = "listingExchange")]
18975    pub listing_exchange: Option<String>,
18976    /// The contract multiplier.
18977    pub multiplier: Option<f64>,
18978    /// The company name.
18979    pub name: Option<String>,
18980    /// Returns the content size of the request.
18981    #[serde(rename = "pageSize")]
18982    pub page_size: Option<i32>,
18983    /// a Put or Call option.
18984    #[serde(rename = "putOrCall")]
18985    pub put_or_call: Option<String>,
18986    /// The contract's sector.
18987    pub sector: Option<String>,
18988    /// The sector's group.
18989    #[serde(rename = "sectorGroup")]
18990    pub sector_group: Option<String>,
18991    /// The strike of the contract.
18992    pub strike: Option<String>,
18993    /// The ticker symbol of the traded contract.
18994    pub ticker: Option<String>,
18995    /// Amount of time in ms to generate the data.
18996    pub time: Option<i32>,
18997    /// Stock type.
18998    #[serde(rename = "type")]
18999    pub r#type: Option<String>,
19000    /// The contract's underlyer.
19001    #[serde(rename = "undConid")]
19002    pub und_conid: Option<i32>,
19003}
19004#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19005pub struct TrsrvSecDefResponseSecdefDisplayRule {
19006    #[serde(rename = "displayRuleStep")]
19007    pub display_rule_step: Option<Vec<TrsrvSecDefResponseSecdefDisplayRuleDisplayRuleStep>>,
19008    /// If the displayed contract information is multiplied based on a given magnitude, the value will be reflected here.
19009    pub magnification: Option<i32>,
19010}
19011#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19012pub struct TrsrvSecDefResponseSecdefDisplayRuleDisplayRuleStep {
19013    /// Displays the total number of digits used after the decimal value.
19014    #[serde(rename = "decimalDigits")]
19015    pub decimal_digits: Option<i32>,
19016    /// The lowerEdge display value to correspond to increment rules.
19017    #[serde(rename = "lowerEdge")]
19018    pub lower_edge: Option<f64>,
19019    /// Displays valid display prices for before and after the decimal value.
19020    #[serde(rename = "wholeDigits")]
19021    pub whole_digits: Option<i32>,
19022}
19023#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19024pub struct TrsrvSecDefResponseSecdefIncrementRule {
19025    /// The price of the instrument must be submitted as a mulitple of the increment value.
19026    /// - Example: `Some(0.0)`
19027    pub increment: Option<f64>,
19028    /// If the current mark price of the instrument is at or above the lower edge, the given increment value is used for order prices.
19029    /// - Example: `Some(0.0)`
19030    #[serde(rename = "lowerEdge")]
19031    pub lower_edge: Option<f64>,
19032}
19033/// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
19034///   * `BA` - Borrow Availability
19035///   * `CA` - Comparable Algo
19036///   * `DA` - Dividends Advisory
19037///   * `EA` - Upcoming Earnings
19038///   * `MF` - Mutual Fund Advisory
19039///   * `OE` - Option Expiration
19040///   * `PR` - Portfolio Builder Rebalance
19041///   * `SE` - Suspend Order on Economic Event
19042///   * `SG` - Short Term Gain turning Long Term
19043///   * `SM` - System Messages
19044///   * `T2` - Assignment Realizing Long-Term Gains
19045///   * `TO` - Takeover
19046///   * `UA` - User Alert
19047///   * `M8` - M871 Trades
19048///   * `PS` - Platform Use Suggestions
19049///   * `DL` - Unexercised Option Loss Prevention Reminder
19050///   * `PT` - Position Transfer
19051///   * `CB` - Missing Cost Basis
19052///   * `MS` - Milestones
19053///   * `TD` - MiFID || 10% Deprecation Notice
19054///   * `ST` - Save Taxes
19055///   * `TI` - Trade Idea
19056///   * `CT` - Cash Transfer
19057#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
19058pub enum Typecodes {
19059    #[serde(rename = "BA")]
19060    #[default]
19061    Ba,
19062    #[serde(rename = "CA")]
19063    Ca,
19064    #[serde(rename = "DA")]
19065    Da,
19066    #[serde(rename = "EA")]
19067    Ea,
19068    #[serde(rename = "MF")]
19069    Mf,
19070    #[serde(rename = "OE")]
19071    Oe,
19072    #[serde(rename = "PR")]
19073    Pr,
19074    #[serde(rename = "SE")]
19075    Se,
19076    #[serde(rename = "SG")]
19077    Sg,
19078    #[serde(rename = "SM")]
19079    Sm,
19080    T2,
19081    #[serde(rename = "TO")]
19082    To,
19083    #[serde(rename = "UA")]
19084    Ua,
19085    M8,
19086    #[serde(rename = "PS")]
19087    Ps,
19088    #[serde(rename = "DL")]
19089    Dl,
19090    #[serde(rename = "PT")]
19091    Pt,
19092    #[serde(rename = "CB")]
19093    Cb,
19094    #[serde(rename = "MS")]
19095    Ms,
19096    #[serde(rename = "TD")]
19097    Td,
19098    #[serde(rename = "ST")]
19099    St,
19100    #[serde(rename = "TI")]
19101    Ti,
19102    #[serde(rename = "CT")]
19103    Ct,
19104}
19105impl core::fmt::Display for Typecodes {
19106    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
19107        match self {
19108            Self::Ba => write!(f, "BA"),
19109            Self::Ca => write!(f, "CA"),
19110            Self::Da => write!(f, "DA"),
19111            Self::Ea => write!(f, "EA"),
19112            Self::Mf => write!(f, "MF"),
19113            Self::Oe => write!(f, "OE"),
19114            Self::Pr => write!(f, "PR"),
19115            Self::Se => write!(f, "SE"),
19116            Self::Sg => write!(f, "SG"),
19117            Self::Sm => write!(f, "SM"),
19118            Self::T2 => write!(f, "T2"),
19119            Self::To => write!(f, "TO"),
19120            Self::Ua => write!(f, "UA"),
19121            Self::M8 => write!(f, "M8"),
19122            Self::Ps => write!(f, "PS"),
19123            Self::Dl => write!(f, "DL"),
19124            Self::Pt => write!(f, "PT"),
19125            Self::Cb => write!(f, "CB"),
19126            Self::Ms => write!(f, "MS"),
19127            Self::Td => write!(f, "TD"),
19128            Self::St => write!(f, "ST"),
19129            Self::Ti => write!(f, "TI"),
19130            Self::Ct => write!(f, "CT"),
19131        }
19132    }
19133}
19134/// Indicates a successful request to unsubscribe all streams.
19135#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19136pub struct UnsubscribedResponse {
19137    /// The sole key 'unsubscribed' will have boolean value true.
19138    pub unsubscribed: Option<bool>,
19139}
19140#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19141pub struct User {
19142    /// Provide information about the particular entity
19143    pub entity: Option<UserEntity>,
19144    /// Internally used
19145    #[serde(rename = "hasRightCodeInd")]
19146    pub has_right_code_ind: Option<bool>,
19147    /// The role of the username as it relates to the account
19148    #[serde(rename = "roleId")]
19149    pub role_id: Option<String>,
19150    /// Identifies the username for the designated entity.
19151    #[serde(rename = "userName")]
19152    pub user_name: Option<String>,
19153}
19154#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19155pub struct UserAccountsResponse {
19156    /// Returns an array of all accessible accountIds.
19157    pub accounts: Option<Vec<String>>,
19158    /// Returns an json object for each accessible account's properties.
19159    #[serde(rename = "acctProps")]
19160    pub acct_props: Option<UserAccountsResponseAcctProps>,
19161    pub aliases: Option<UserAccountsResponseAliases>,
19162    #[serde(rename = "allowFeatures")]
19163    pub allow_features: Option<UserAccountsResponseAllowFeatures>,
19164    #[serde(rename = "chartPeriods")]
19165    pub chart_periods: Option<UserAccountsResponseChartPeriods>,
19166    pub groups: Option<Vec<String>>,
19167    #[serde(rename = "isFt")]
19168    pub is_ft: Option<bool>,
19169    #[serde(rename = "isPaper")]
19170    pub is_paper: Option<bool>,
19171    pub profiles: Option<Vec<String>>,
19172    #[serde(rename = "selectedAccount")]
19173    pub selected_account: Option<String>,
19174    #[serde(rename = "serverInfo")]
19175    pub server_info: Option<UserAccountsResponseServerInfo>,
19176    #[serde(rename = "sessionId")]
19177    pub session_id: Option<String>,
19178}
19179/// Returns an json object for each accessible account's properties.
19180#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19181pub struct UserAccountsResponseAcctProps {
19182    #[serde(rename = "U1234567")]
19183    pub u1234567: Option<UserAccountsResponseAcctPropsU1234567>,
19184}
19185#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19186pub struct UserAccountsResponseAcctPropsU1234567 {
19187    #[serde(rename = "allowCustomerTime")]
19188    pub allow_customer_time: Option<bool>,
19189    #[serde(rename = "autoFx")]
19190    pub auto_fx: Option<bool>,
19191    #[serde(rename = "hasChildAccounts")]
19192    pub has_child_accounts: Option<bool>,
19193    #[serde(rename = "isProp")]
19194    pub is_prop: Option<bool>,
19195    #[serde(rename = "liteUnderPro")]
19196    pub lite_under_pro: Option<bool>,
19197    #[serde(rename = "noFXConv")]
19198    pub no_fxconv: Option<bool>,
19199    #[serde(rename = "supportsCashQty")]
19200    pub supports_cash_qty: Option<bool>,
19201    #[serde(rename = "supportsFractions")]
19202    pub supports_fractions: Option<bool>,
19203}
19204#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19205pub struct UserAccountsResponseAliases {
19206    #[serde(rename = "U1234567")]
19207    pub u1234567: Option<String>,
19208}
19209#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19210pub struct UserAccountsResponseAllowFeatures {
19211    #[serde(rename = "allowCrypto")]
19212    pub allow_crypto: Option<bool>,
19213    #[serde(rename = "allowDynAccount")]
19214    pub allow_dyn_account: Option<bool>,
19215    #[serde(rename = "allowEventContract")]
19216    pub allow_event_contract: Option<bool>,
19217    #[serde(rename = "allowEventTrading")]
19218    pub allow_event_trading: Option<bool>,
19219    #[serde(rename = "allowFXConv")]
19220    pub allow_fxconv: Option<bool>,
19221    #[serde(rename = "allowFinancialLens")]
19222    pub allow_financial_lens: Option<bool>,
19223    #[serde(rename = "allowMTA")]
19224    pub allow_mta: Option<bool>,
19225    #[serde(rename = "allowTypeAhead")]
19226    pub allow_type_ahead: Option<bool>,
19227    #[serde(rename = "allowedAssetTypes")]
19228    pub allowed_asset_types: Option<String>,
19229    #[serde(rename = "debugPnl")]
19230    pub debug_pnl: Option<bool>,
19231    #[serde(rename = "liteUser")]
19232    pub lite_user: Option<bool>,
19233    pub research: Option<bool>,
19234    #[serde(rename = "restrictTradeSubscription")]
19235    pub restrict_trade_subscription: Option<bool>,
19236    #[serde(rename = "showEUCostReport")]
19237    pub show_eucost_report: Option<bool>,
19238    #[serde(rename = "showGFIS")]
19239    pub show_gfis: Option<bool>,
19240    #[serde(rename = "showImpactDashboard")]
19241    pub show_impact_dashboard: Option<bool>,
19242    #[serde(rename = "showTaxOpt")]
19243    pub show_tax_opt: Option<bool>,
19244    #[serde(rename = "showUkUserLabels")]
19245    pub show_uk_user_labels: Option<bool>,
19246    #[serde(rename = "showWebNews")]
19247    pub show_web_news: Option<bool>,
19248    #[serde(rename = "sideBySide")]
19249    pub side_by_side: Option<bool>,
19250    /// - Example: `Some(30i64)`
19251    #[serde(rename = "snapshotRefreshTimeout")]
19252    pub snapshot_refresh_timeout: Option<i64>,
19253}
19254#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19255pub struct UserAccountsResponseChartPeriods {
19256    #[serde(rename = "BOND")]
19257    pub bond: Option<Vec<String>>,
19258    #[serde(rename = "CASH")]
19259    pub cash: Option<Vec<String>>,
19260    #[serde(rename = "CFD")]
19261    pub cfd: Option<Vec<String>>,
19262    #[serde(rename = "CMDTY")]
19263    pub cmdty: Option<Vec<String>>,
19264    #[serde(rename = "CRYPTO")]
19265    pub crypto: Option<Vec<String>>,
19266    #[serde(rename = "FOP")]
19267    pub fop: Option<Vec<String>>,
19268    #[serde(rename = "FUND")]
19269    pub fund: Option<Vec<String>>,
19270    #[serde(rename = "FUT")]
19271    pub fut: Option<Vec<String>>,
19272    #[serde(rename = "IND")]
19273    pub ind: Option<Vec<String>>,
19274    #[serde(rename = "IOPT")]
19275    pub iopt: Option<Vec<String>>,
19276    #[serde(rename = "OPT")]
19277    pub opt: Option<Vec<String>>,
19278    #[serde(rename = "PHYSS")]
19279    pub physs: Option<Vec<String>>,
19280    #[serde(rename = "STK")]
19281    pub stk: Option<Vec<String>>,
19282    #[serde(rename = "WAR")]
19283    pub war: Option<Vec<String>>,
19284}
19285#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19286pub struct UserAccountsResponseServerInfo {
19287    #[serde(rename = "serverName")]
19288    pub server_name: Option<String>,
19289    #[serde(rename = "serverVersion")]
19290    pub server_version: Option<String>,
19291}
19292/// Provide information about the particular entity
19293#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19294pub struct UserEntity {
19295    /// The full entity's name, concatenating the first and last name fields
19296    #[serde(rename = "entityName")]
19297    pub entity_name: Option<String>,
19298    /// The type of entity assigned to the user
19299    #[serde(rename = "entityType")]
19300    pub entity_type: Option<UserEntityEntityType>,
19301    /// The first name of the user
19302    #[serde(rename = "firstName")]
19303    pub first_name: Option<String>,
19304    /// The last name of the user
19305    #[serde(rename = "lastName")]
19306    pub last_name: Option<String>,
19307}
19308/// The type of entity assigned to the user
19309#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
19310pub enum UserEntityEntityType {
19311    #[serde(rename = "INDIVIDUAL")]
19312    #[default]
19313    Individual,
19314    Joint,
19315    #[serde(rename = "ORG")]
19316    Org,
19317}
19318impl core::fmt::Display for UserEntityEntityType {
19319    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
19320        match self {
19321            Self::Individual => write!(f, "INDIVIDUAL"),
19322            Self::Joint => write!(f, "Joint"),
19323            Self::Org => write!(f, "ORG"),
19324        }
19325    }
19326}
19327#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19328pub struct UserNameAvailableResponse {
19329    pub error: Option<Box<ErrorResponse>>,
19330    #[serde(rename = "errorDescription")]
19331    pub error_description: Option<String>,
19332    #[serde(rename = "hasError")]
19333    pub has_error: Option<bool>,
19334    #[serde(rename = "isAvailable")]
19335    pub is_available: Option<bool>,
19336    #[serde(rename = "isValid")]
19337    pub is_valid: Option<bool>,
19338    #[serde(rename = "suggestedUserName")]
19339    pub suggested_user_name: Option<Vec<String>>,
19340}
19341/// UTC datetime string in format YYYYMMDD-hh:mm:ss.
19342pub type UtcDateTime = String;
19343/// Validates CSV structure, restriction names, and rule parameters without applying changes. Must be called before /csv/v2/apply with the same requestId.<br><br>**Scope**: `restrictions.write`<br>**Security Policy**: `Signed JWT`
19344#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
19345pub struct VerifyCsvRequest {
19346    #[validate(nested)]
19347    pub header: VerifyCsvRequestHeader,
19348    /// JSON with userName, requestId, and Base64-encoded CSV payload
19349    #[validate(nested)]
19350    pub body: VerifyRequest,
19351}
19352impl VerifyCsvRequest {
19353    /// Parse the HTTP response into the response enum.
19354    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ApplyCsvResponse> {
19355        let status = req.status();
19356        if status == http::StatusCode::OK {
19357            let data =
19358                oas3_gen_support::Diagnostics::<CSVResponse>::json_with_diagnostics(req).await?;
19359            return Ok(ApplyCsvResponse::Ok(data));
19360        }
19361        if status == http::StatusCode::BAD_REQUEST {
19362            let _ = req.bytes().await?;
19363            return Ok(ApplyCsvResponse::BadRequest);
19364        }
19365        if status == http::StatusCode::UNAUTHORIZED {
19366            let _ = req.bytes().await?;
19367            return Ok(ApplyCsvResponse::Unauthorized);
19368        }
19369        if status == http::StatusCode::FORBIDDEN {
19370            let _ = req.bytes().await?;
19371            return Ok(ApplyCsvResponse::Forbidden);
19372        }
19373        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
19374            let _ = req.bytes().await?;
19375            return Ok(ApplyCsvResponse::InternalServerError);
19376        }
19377        let _ = req.bytes().await?;
19378        return Ok(ApplyCsvResponse::Unknown);
19379    }
19380}
19381#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
19382pub struct VerifyCsvRequestHeader {
19383    /// OAuth 2.0 Bearer token. Format: Bearer {access_token}. Token contains accountId claim. Validity: ~50 minutes.
19384    /// - Example: `"Bearer eyJ0eXAiOiJhdCtKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjFkOTEx...".to_string()`
19385    #[validate(length(min = 1u64))]
19386    pub authorization: String,
19387}
19388impl core::convert::TryFrom<&VerifyCsvRequestHeader> for http::HeaderMap {
19389    type Error = http::header::InvalidHeaderValue;
19390    fn try_from(headers: &VerifyCsvRequestHeader) -> core::result::Result<Self, Self::Error> {
19391        let mut map = http::HeaderMap::with_capacity(1usize);
19392        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
19393        map.insert(AUTHORIZATION, header_value);
19394        Ok(map)
19395    }
19396}
19397impl core::convert::TryFrom<VerifyCsvRequestHeader> for http::HeaderMap {
19398    type Error = http::header::InvalidHeaderValue;
19399    fn try_from(headers: VerifyCsvRequestHeader) -> core::result::Result<Self, Self::Error> {
19400        http::HeaderMap::try_from(&headers)
19401    }
19402}
19403#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
19404pub struct VerifyRequest {
19405    /// Base64-encoded CSV content. Supported operations: RESTR_ADD, RESTR_DELETE, RESTR_ASSOC_ADD, RESTR_ASSOC_DELETE. Account ID extracted from OAuth token - do NOT include masterAcctId.
19406    pub payload: Vec<u8>,
19407    /// Unique request identifier
19408    /// - Example: `127i32`
19409    #[serde(rename = "requestId")]
19410    #[validate(range(min = 1i32))]
19411    pub request_id: i32,
19412    /// IBKR username
19413    /// - Example: `"hatty597".to_string()`
19414    #[serde(rename = "userName")]
19415    #[validate(length(min = 1u64, max = 64u64))]
19416    pub user_name: String,
19417}
19418#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19419pub struct Watchlist200Response {
19420    /// IB's internal hash of the submitted watchlist.
19421    pub hash: Option<String>,
19422    /// The submitted watchlist ID.
19423    pub id: Option<String>,
19424    /// Array will always be empty. Contents can be queried via `GET /iserver/watchlist?id=`
19425    pub instruments: Option<Vec<serde_json::Value>>,
19426    /// The submitted human-readable watchlist name.
19427    pub name: Option<String>,
19428    /// Indicates whether watchlist is write-restricted. User-created watchlists will always show false.
19429    #[serde(rename = "readOnly")]
19430    pub read_only: Option<bool>,
19431}
19432/// Object detailing the successful deletion of a watchlist.
19433#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19434#[serde(default)]
19435pub struct WatchlistDeleteSuccess {
19436    /// Internal use. Number of times endpoint has been visited during session.
19437    #[serde(rename = "MID")]
19438    pub mid: Option<String>,
19439    /// Internal use. Always has value 'context'.
19440    #[default(Some("context".to_string()))]
19441    pub action: Option<String>,
19442    pub data: Option<WatchlistDeleteSuccessData>,
19443}
19444#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19445pub struct WatchlistDeleteSuccessData {
19446    /// Watchlist ID of the deleted watchlist.
19447    pub deleted: Option<String>,
19448}
19449#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
19450pub struct WatchlistRequestBody {
19451    /// Must be a number, digits 0-9 only. Must be unique relative to other watchlist IDs.
19452    #[validate(length(min = 1u64))]
19453    pub id: String,
19454    /// Arbitrary human-readable name to be displayed in TWS and Client Portal.
19455    #[validate(length(min = 1u64))]
19456    pub name: String,
19457    /// Array of JSON objects corresponding to watchlist rows, one per instruments.
19458    pub rows: Vec<WatchlistRequestBodyRow>,
19459}
19460#[serde_with::skip_serializing_none]
19461#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
19462pub struct WatchlistRequestBodyRow {
19463    /// Conid as string.
19464    #[serde(rename = "C")]
19465    pub c: Option<String>,
19466}
19467/// Object containing a successful query for watchlists saved for the username in use in the current Web API session.
19468#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19469#[serde(default)]
19470pub struct WatchlistsResponse {
19471    /// Internal use. Number of times endpoint has been visited during session.
19472    #[serde(rename = "MID")]
19473    pub mid: Option<String>,
19474    /// Internal use. Always has value 'content'.
19475    #[default(Some("content".to_string()))]
19476    pub action: Option<String>,
19477    /// Contains the watchlist query results.
19478    pub data: Option<WatchlistsResponseData>,
19479}
19480/// Contains the watchlist query results.
19481#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19482pub struct WatchlistsResponseData {
19483    /// Indicates if username's watchlists can be bulk-deleted.
19484    pub bulk_delete: Option<bool>,
19485    /// Indicates if query results contain only market scanners.
19486    pub scanners_only: Option<bool>,
19487    /// Indicates if market scanners are included in query results.
19488    pub show_scanners: Option<bool>,
19489    /// Array of objects detailing the watchlists saved for the username in use in the current Web API session.
19490    pub user_lists: Option<Vec<WatchlistsResponseDataUserList>>,
19491}
19492/// Details of a single watchlist.
19493#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
19494#[serde(default)]
19495pub struct WatchlistsResponseDataUserList {
19496    /// Watchlist ID of the watchlist.
19497    pub id: Option<String>,
19498    /// Internal use. Indicates if the watchlist is currently in use.
19499    pub is_open: Option<bool>,
19500    /// Unix timestamp in milliseconds of the last modification of the watchlist.
19501    pub modified: Option<i32>,
19502    /// Display name of the watchlist.
19503    pub name: Option<String>,
19504    /// Indicates if the watchlist can be edited.
19505    pub read_only: Option<bool>,
19506    /// Always has value 'watchlist'.
19507    #[serde(rename = "type")]
19508    #[default(Some("watchlist".to_string()))]
19509    pub r#type: Option<String>,
19510}
19511#[serde_with::skip_serializing_none]
19512#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
19513pub struct WithdrawFundsInstruction {
19514    /// - Example: `"U46377".to_string()`
19515    #[serde(rename = "accountId")]
19516    #[validate(length(min = 1u64, max = 32u64))]
19517    pub account_id: String,
19518    /// - Example: `100.0`
19519    pub amount: f64,
19520    /// - Example: `"WIRE"`
19521    #[serde(rename = "bankInstructionMethod")]
19522    pub bank_instruction_method: WithdrawFundsInstructionBankInstructionMethod,
19523    /// - Example: `"Instruction".to_string()`
19524    #[serde(rename = "bankInstructionName")]
19525    #[validate(length(min = 1u64, max = 150u64))]
19526    pub bank_instruction_name: String,
19527    /// - Example: `1012983.0`
19528    #[serde(rename = "clientInstructionId")]
19529    pub client_instruction_id: f64,
19530    /// - Example: `"USD".to_string()`
19531    #[validate(length(min = 1u64, max = 3u64))]
19532    pub currency: String,
19533    #[serde(rename = "dateTimeToOccur")]
19534    pub date_time_to_occur: Option<chrono::DateTime<chrono::Utc>>,
19535    #[serde(rename = "iraWithdrawalDetail")]
19536    #[validate(nested)]
19537    pub ira_withdrawal_detail: Option<WithdrawFundsInstructionIraWithdrawalDetail>,
19538    #[serde(rename = "recurringInstructionDetail")]
19539    #[validate(nested)]
19540    pub recurring_instruction_detail: Option<RecurringInstructionDetail>,
19541}
19542#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
19543pub enum WithdrawFundsInstructionBankInstructionMethod {
19544    #[serde(rename = "ACH")]
19545    #[default]
19546    Ach,
19547    #[serde(rename = "WIRE")]
19548    Wire,
19549    #[serde(rename = "SEPA")]
19550    Sepa,
19551}
19552impl core::fmt::Display for WithdrawFundsInstructionBankInstructionMethod {
19553    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
19554        match self {
19555            Self::Ach => write!(f, "ACH"),
19556            Self::Wire => write!(f, "WIRE"),
19557            Self::Sepa => write!(f, "SEPA"),
19558        }
19559    }
19560}
19561#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
19562pub struct WithdrawFundsInstructionIraWithdrawalDetail {
19563    /// - Example: `12.0`
19564    #[serde(rename = "fedIncomeTaxPercentage")]
19565    pub fed_income_tax_percentage: f64,
19566    /// - Example: `"NORMAL"`
19567    #[serde(rename = "iraWithholdType")]
19568    pub ira_withhold_type: WithdrawFundsInstructionIraWithdrawalDetailIraWithholdType,
19569    /// - Example: `"TE".to_string()`
19570    #[serde(rename = "stateCd")]
19571    #[validate(length(min = 1u64, max = 2u64))]
19572    pub state_cd: String,
19573    /// - Example: `10.0`
19574    #[serde(rename = "stateIncomeTaxPercentage")]
19575    pub state_income_tax_percentage: f64,
19576}
19577#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
19578pub enum WithdrawFundsInstructionIraWithdrawalDetailIraWithholdType {
19579    #[serde(rename = "DIRECT_ROLLOVER")]
19580    #[default]
19581    DirectRollover,
19582    #[serde(rename = "ROTH_DISTRIBUTION")]
19583    RothDistribution,
19584    #[serde(rename = "NORMAL")]
19585    Normal,
19586    #[serde(rename = "EARLY")]
19587    Early,
19588    #[serde(rename = "DEATH")]
19589    Death,
19590    #[serde(rename = "EXCESS_CY")]
19591    ExcessCy,
19592    #[serde(rename = "EXCESS_PY")]
19593    ExcessPy,
19594    #[serde(rename = "EXCESS_SC")]
19595    ExcessSc,
19596}
19597impl core::fmt::Display for WithdrawFundsInstructionIraWithdrawalDetailIraWithholdType {
19598    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
19599        match self {
19600            Self::DirectRollover => write!(f, "DIRECT_ROLLOVER"),
19601            Self::RothDistribution => write!(f, "ROTH_DISTRIBUTION"),
19602            Self::Normal => write!(f, "NORMAL"),
19603            Self::Early => write!(f, "EARLY"),
19604            Self::Death => write!(f, "DEATH"),
19605            Self::ExcessCy => write!(f, "EXCESS_CY"),
19606            Self::ExcessPy => write!(f, "EXCESS_PY"),
19607            Self::ExcessSc => write!(f, "EXCESS_SC"),
19608        }
19609    }
19610}