1#[allow(unused_imports)]
4use super::*;
5#[allow(unused_imports)]
6use crate::ids::*;
7#[allow(unused_imports)]
8use crate::timestamp::Timestamp;
9#[allow(unused_imports)]
10use rust_decimal::Decimal;
11#[allow(unused_imports)]
12use serde::{Deserialize, Serialize};
13
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
16#[serde(rename_all = "camelCase")]
17pub struct CreateTransaction {
18 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
20 pub id: Option<TransactionID>,
21 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
23 pub time: Option<Timestamp>,
24 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
26 pub user_id: Option<i64>,
27 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
29 pub account_id: Option<AccountID>,
30 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
33 pub batch_id: Option<TransactionID>,
34 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
36 pub request_id: Option<RequestID>,
37 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
39 pub r#type: Option<TransactionType>,
40 #[serde(
42 rename = "divisionID",
43 default,
44 skip_serializing_if = "Option::is_none"
45 )]
46 pub division_id: Option<i64>,
47 #[serde(rename = "siteID", default, skip_serializing_if = "Option::is_none")]
49 pub site_id: Option<i64>,
50 #[serde(
52 rename = "accountUserID",
53 default,
54 skip_serializing_if = "Option::is_none"
55 )]
56 pub account_user_id: Option<i64>,
57 #[serde(
59 rename = "accountNumber",
60 default,
61 skip_serializing_if = "Option::is_none"
62 )]
63 pub account_number: Option<i64>,
64 #[serde(
66 rename = "homeCurrency",
67 default,
68 skip_serializing_if = "Option::is_none"
69 )]
70 pub home_currency: Option<Currency>,
71}
72
73#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
75#[serde(rename_all = "camelCase")]
76pub struct CloseTransaction {
77 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
79 pub id: Option<TransactionID>,
80 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
82 pub time: Option<Timestamp>,
83 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
85 pub user_id: Option<i64>,
86 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
88 pub account_id: Option<AccountID>,
89 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
92 pub batch_id: Option<TransactionID>,
93 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
95 pub request_id: Option<RequestID>,
96 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
98 pub r#type: Option<TransactionType>,
99}
100
101#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
103#[serde(rename_all = "camelCase")]
104pub struct ReopenTransaction {
105 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
107 pub id: Option<TransactionID>,
108 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
110 pub time: Option<Timestamp>,
111 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
113 pub user_id: Option<i64>,
114 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
116 pub account_id: Option<AccountID>,
117 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
120 pub batch_id: Option<TransactionID>,
121 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
123 pub request_id: Option<RequestID>,
124 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
126 pub r#type: Option<TransactionType>,
127}
128
129#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
131#[serde(rename_all = "camelCase")]
132pub struct ClientConfigureTransaction {
133 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
135 pub id: Option<TransactionID>,
136 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
138 pub time: Option<Timestamp>,
139 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
141 pub user_id: Option<i64>,
142 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
144 pub account_id: Option<AccountID>,
145 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
148 pub batch_id: Option<TransactionID>,
149 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
151 pub request_id: Option<RequestID>,
152 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
154 pub r#type: Option<TransactionType>,
155 #[serde(rename = "alias", default, skip_serializing_if = "Option::is_none")]
157 pub alias: Option<String>,
158 #[serde(
160 rename = "marginRate",
161 default,
162 skip_serializing_if = "Option::is_none"
163 )]
164 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
165 pub margin_rate: Option<Decimal>,
166}
167
168#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
170#[serde(rename_all = "camelCase")]
171pub struct ClientConfigureRejectTransaction {
172 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
174 pub id: Option<TransactionID>,
175 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
177 pub time: Option<Timestamp>,
178 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
180 pub user_id: Option<i64>,
181 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
183 pub account_id: Option<AccountID>,
184 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
187 pub batch_id: Option<TransactionID>,
188 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
190 pub request_id: Option<RequestID>,
191 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
194 pub r#type: Option<TransactionType>,
195 #[serde(rename = "alias", default, skip_serializing_if = "Option::is_none")]
197 pub alias: Option<String>,
198 #[serde(
200 rename = "marginRate",
201 default,
202 skip_serializing_if = "Option::is_none"
203 )]
204 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
205 pub margin_rate: Option<Decimal>,
206 #[serde(
208 rename = "rejectReason",
209 default,
210 skip_serializing_if = "Option::is_none"
211 )]
212 pub reject_reason: Option<TransactionRejectReason>,
213}
214
215#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
217#[serde(rename_all = "camelCase")]
218pub struct TransferFundsTransaction {
219 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
221 pub id: Option<TransactionID>,
222 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
224 pub time: Option<Timestamp>,
225 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
227 pub user_id: Option<i64>,
228 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
230 pub account_id: Option<AccountID>,
231 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
234 pub batch_id: Option<TransactionID>,
235 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
237 pub request_id: Option<RequestID>,
238 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
240 pub r#type: Option<TransactionType>,
241 #[serde(rename = "amount", default, skip_serializing_if = "Option::is_none")]
244 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
245 pub amount: Option<Decimal>,
246 #[serde(
248 rename = "fundingReason",
249 default,
250 skip_serializing_if = "Option::is_none"
251 )]
252 pub funding_reason: Option<FundingReason>,
253 #[serde(rename = "comment", default, skip_serializing_if = "Option::is_none")]
255 pub comment: Option<String>,
256 #[serde(
258 rename = "accountBalance",
259 default,
260 skip_serializing_if = "Option::is_none"
261 )]
262 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
263 pub account_balance: Option<Decimal>,
264}
265
266#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
268#[serde(rename_all = "camelCase")]
269pub struct TransferFundsRejectTransaction {
270 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
272 pub id: Option<TransactionID>,
273 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
275 pub time: Option<Timestamp>,
276 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
278 pub user_id: Option<i64>,
279 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
281 pub account_id: Option<AccountID>,
282 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
285 pub batch_id: Option<TransactionID>,
286 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
288 pub request_id: Option<RequestID>,
289 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
291 pub r#type: Option<TransactionType>,
292 #[serde(rename = "amount", default, skip_serializing_if = "Option::is_none")]
295 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
296 pub amount: Option<Decimal>,
297 #[serde(
299 rename = "fundingReason",
300 default,
301 skip_serializing_if = "Option::is_none"
302 )]
303 pub funding_reason: Option<FundingReason>,
304 #[serde(rename = "comment", default, skip_serializing_if = "Option::is_none")]
306 pub comment: Option<String>,
307 #[serde(
309 rename = "rejectReason",
310 default,
311 skip_serializing_if = "Option::is_none"
312 )]
313 pub reject_reason: Option<TransactionRejectReason>,
314}
315
316#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
321#[serde(rename_all = "camelCase")]
322pub struct MarketOrderTransaction {
323 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
325 pub id: Option<TransactionID>,
326 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
328 pub time: Option<Timestamp>,
329 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
331 pub user_id: Option<i64>,
332 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
334 pub account_id: Option<AccountID>,
335 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
338 pub batch_id: Option<TransactionID>,
339 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
341 pub request_id: Option<RequestID>,
342 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
344 pub r#type: Option<TransactionType>,
345 #[serde(rename = "instrument")]
347 pub instrument: InstrumentName,
348 #[serde(rename = "units")]
351 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
352 pub units: Decimal,
353 #[serde(rename = "timeInForce")]
355 pub time_in_force: TimeInForce,
356 #[serde(
358 rename = "priceBound",
359 default,
360 skip_serializing_if = "Option::is_none"
361 )]
362 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
363 pub price_bound: Option<Decimal>,
364 #[serde(rename = "positionFill")]
366 pub position_fill: OrderPositionFill,
367 #[serde(
370 rename = "tradeClose",
371 default,
372 skip_serializing_if = "Option::is_none"
373 )]
374 pub trade_close: Option<MarketOrderTradeClose>,
375 #[serde(
378 rename = "longPositionCloseout",
379 default,
380 skip_serializing_if = "Option::is_none"
381 )]
382 pub long_position_closeout: Option<MarketOrderPositionCloseout>,
383 #[serde(
386 rename = "shortPositionCloseout",
387 default,
388 skip_serializing_if = "Option::is_none"
389 )]
390 pub short_position_closeout: Option<MarketOrderPositionCloseout>,
391 #[serde(
393 rename = "marginCloseout",
394 default,
395 skip_serializing_if = "Option::is_none"
396 )]
397 pub margin_closeout: Option<MarketOrderMarginCloseout>,
398 #[serde(
400 rename = "delayedTradeClose",
401 default,
402 skip_serializing_if = "Option::is_none"
403 )]
404 pub delayed_trade_close: Option<MarketOrderDelayedTradeClose>,
405 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
407 pub reason: Option<MarketOrderReason>,
408 #[serde(
411 rename = "clientExtensions",
412 default,
413 skip_serializing_if = "Option::is_none"
414 )]
415 pub client_extensions: Option<ClientExtensions>,
416 #[serde(
419 rename = "takeProfitOnFill",
420 default,
421 skip_serializing_if = "Option::is_none"
422 )]
423 pub take_profit_on_fill: Option<TakeProfitDetails>,
424 #[serde(
427 rename = "stopLossOnFill",
428 default,
429 skip_serializing_if = "Option::is_none"
430 )]
431 pub stop_loss_on_fill: Option<StopLossDetails>,
432 #[serde(
435 rename = "trailingStopLossOnFill",
436 default,
437 skip_serializing_if = "Option::is_none"
438 )]
439 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
440 #[serde(
443 rename = "guaranteedStopLossOnFill",
444 default,
445 skip_serializing_if = "Option::is_none"
446 )]
447 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
448 #[serde(
451 rename = "tradeClientExtensions",
452 default,
453 skip_serializing_if = "Option::is_none"
454 )]
455 pub trade_client_extensions: Option<ClientExtensions>,
456}
457
458#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
460#[serde(rename_all = "camelCase")]
461pub struct MarketOrderRejectTransaction {
462 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
464 pub id: Option<TransactionID>,
465 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
467 pub time: Option<Timestamp>,
468 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
470 pub user_id: Option<i64>,
471 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
473 pub account_id: Option<AccountID>,
474 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
477 pub batch_id: Option<TransactionID>,
478 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
480 pub request_id: Option<RequestID>,
481 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
483 pub r#type: Option<TransactionType>,
484 #[serde(rename = "instrument")]
486 pub instrument: InstrumentName,
487 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
495 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
496 pub units: Option<Decimal>,
497 #[serde(rename = "timeInForce")]
499 pub time_in_force: TimeInForce,
500 #[serde(
502 rename = "priceBound",
503 default,
504 skip_serializing_if = "Option::is_none"
505 )]
506 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
507 pub price_bound: Option<Decimal>,
508 #[serde(rename = "positionFill")]
510 pub position_fill: OrderPositionFill,
511 #[serde(
514 rename = "tradeClose",
515 default,
516 skip_serializing_if = "Option::is_none"
517 )]
518 pub trade_close: Option<MarketOrderTradeClose>,
519 #[serde(
522 rename = "longPositionCloseout",
523 default,
524 skip_serializing_if = "Option::is_none"
525 )]
526 pub long_position_closeout: Option<MarketOrderPositionCloseout>,
527 #[serde(
530 rename = "shortPositionCloseout",
531 default,
532 skip_serializing_if = "Option::is_none"
533 )]
534 pub short_position_closeout: Option<MarketOrderPositionCloseout>,
535 #[serde(
537 rename = "marginCloseout",
538 default,
539 skip_serializing_if = "Option::is_none"
540 )]
541 pub margin_closeout: Option<MarketOrderMarginCloseout>,
542 #[serde(
544 rename = "delayedTradeClose",
545 default,
546 skip_serializing_if = "Option::is_none"
547 )]
548 pub delayed_trade_close: Option<MarketOrderDelayedTradeClose>,
549 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
551 pub reason: Option<MarketOrderReason>,
552 #[serde(
555 rename = "clientExtensions",
556 default,
557 skip_serializing_if = "Option::is_none"
558 )]
559 pub client_extensions: Option<ClientExtensions>,
560 #[serde(
563 rename = "takeProfitOnFill",
564 default,
565 skip_serializing_if = "Option::is_none"
566 )]
567 pub take_profit_on_fill: Option<TakeProfitDetails>,
568 #[serde(
571 rename = "stopLossOnFill",
572 default,
573 skip_serializing_if = "Option::is_none"
574 )]
575 pub stop_loss_on_fill: Option<StopLossDetails>,
576 #[serde(
579 rename = "trailingStopLossOnFill",
580 default,
581 skip_serializing_if = "Option::is_none"
582 )]
583 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
584 #[serde(
587 rename = "guaranteedStopLossOnFill",
588 default,
589 skip_serializing_if = "Option::is_none"
590 )]
591 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
592 #[serde(
595 rename = "tradeClientExtensions",
596 default,
597 skip_serializing_if = "Option::is_none"
598 )]
599 pub trade_client_extensions: Option<ClientExtensions>,
600 #[serde(
602 rename = "rejectReason",
603 default,
604 skip_serializing_if = "Option::is_none"
605 )]
606 pub reject_reason: Option<TransactionRejectReason>,
607}
608
609#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
612#[serde(rename_all = "camelCase")]
613pub struct FixedPriceOrderTransaction {
614 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
616 pub id: Option<TransactionID>,
617 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
619 pub time: Option<Timestamp>,
620 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
622 pub user_id: Option<i64>,
623 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
625 pub account_id: Option<AccountID>,
626 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
629 pub batch_id: Option<TransactionID>,
630 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
632 pub request_id: Option<RequestID>,
633 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
635 pub r#type: Option<TransactionType>,
636 #[serde(rename = "instrument")]
638 pub instrument: InstrumentName,
639 #[serde(rename = "units")]
642 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
643 pub units: Decimal,
644 #[serde(rename = "price")]
647 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
648 pub price: Decimal,
649 #[serde(rename = "positionFill")]
651 pub position_fill: OrderPositionFill,
652 #[serde(rename = "tradeState")]
654 pub trade_state: String,
655 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
657 pub reason: Option<FixedPriceOrderReason>,
658 #[serde(
660 rename = "clientExtensions",
661 default,
662 skip_serializing_if = "Option::is_none"
663 )]
664 pub client_extensions: Option<ClientExtensions>,
665 #[serde(
668 rename = "takeProfitOnFill",
669 default,
670 skip_serializing_if = "Option::is_none"
671 )]
672 pub take_profit_on_fill: Option<TakeProfitDetails>,
673 #[serde(
676 rename = "stopLossOnFill",
677 default,
678 skip_serializing_if = "Option::is_none"
679 )]
680 pub stop_loss_on_fill: Option<StopLossDetails>,
681 #[serde(
684 rename = "trailingStopLossOnFill",
685 default,
686 skip_serializing_if = "Option::is_none"
687 )]
688 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
689 #[serde(
692 rename = "guaranteedStopLossOnFill",
693 default,
694 skip_serializing_if = "Option::is_none"
695 )]
696 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
697 #[serde(
700 rename = "tradeClientExtensions",
701 default,
702 skip_serializing_if = "Option::is_none"
703 )]
704 pub trade_client_extensions: Option<ClientExtensions>,
705}
706
707#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
709#[serde(rename_all = "camelCase")]
710pub struct LimitOrderTransaction {
711 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
713 pub id: Option<TransactionID>,
714 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
716 pub time: Option<Timestamp>,
717 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
719 pub user_id: Option<i64>,
720 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
722 pub account_id: Option<AccountID>,
723 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
726 pub batch_id: Option<TransactionID>,
727 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
729 pub request_id: Option<RequestID>,
730 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
732 pub r#type: Option<TransactionType>,
733 #[serde(rename = "instrument")]
735 pub instrument: InstrumentName,
736 #[serde(rename = "units")]
739 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
740 pub units: Decimal,
741 #[serde(rename = "price")]
744 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
745 pub price: Decimal,
746 #[serde(rename = "timeInForce")]
748 pub time_in_force: TimeInForce,
749 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
751 pub gtd_time: Option<Timestamp>,
752 #[serde(rename = "positionFill")]
754 pub position_fill: OrderPositionFill,
755 #[serde(rename = "triggerCondition")]
768 pub trigger_condition: OrderTriggerCondition,
769 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
771 pub reason: Option<LimitOrderReason>,
772 #[serde(
775 rename = "clientExtensions",
776 default,
777 skip_serializing_if = "Option::is_none"
778 )]
779 pub client_extensions: Option<ClientExtensions>,
780 #[serde(
783 rename = "takeProfitOnFill",
784 default,
785 skip_serializing_if = "Option::is_none"
786 )]
787 pub take_profit_on_fill: Option<TakeProfitDetails>,
788 #[serde(
791 rename = "stopLossOnFill",
792 default,
793 skip_serializing_if = "Option::is_none"
794 )]
795 pub stop_loss_on_fill: Option<StopLossDetails>,
796 #[serde(
799 rename = "trailingStopLossOnFill",
800 default,
801 skip_serializing_if = "Option::is_none"
802 )]
803 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
804 #[serde(
807 rename = "guaranteedStopLossOnFill",
808 default,
809 skip_serializing_if = "Option::is_none"
810 )]
811 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
812 #[serde(
815 rename = "tradeClientExtensions",
816 default,
817 skip_serializing_if = "Option::is_none"
818 )]
819 pub trade_client_extensions: Option<ClientExtensions>,
820 #[serde(
822 rename = "replacesOrderID",
823 default,
824 skip_serializing_if = "Option::is_none"
825 )]
826 pub replaces_order_id: Option<OrderID>,
827 #[serde(
830 rename = "cancellingTransactionID",
831 default,
832 skip_serializing_if = "Option::is_none"
833 )]
834 pub cancelling_transaction_id: Option<TransactionID>,
835}
836
837#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
839#[serde(rename_all = "camelCase")]
840pub struct LimitOrderRejectTransaction {
841 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
843 pub id: Option<TransactionID>,
844 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
846 pub time: Option<Timestamp>,
847 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
849 pub user_id: Option<i64>,
850 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
852 pub account_id: Option<AccountID>,
853 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
856 pub batch_id: Option<TransactionID>,
857 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
859 pub request_id: Option<RequestID>,
860 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
862 pub r#type: Option<TransactionType>,
863 #[serde(rename = "instrument")]
865 pub instrument: InstrumentName,
866 #[serde(rename = "units")]
869 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
870 pub units: Decimal,
871 #[serde(rename = "price")]
874 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
875 pub price: Decimal,
876 #[serde(rename = "timeInForce")]
878 pub time_in_force: TimeInForce,
879 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
881 pub gtd_time: Option<Timestamp>,
882 #[serde(rename = "positionFill")]
884 pub position_fill: OrderPositionFill,
885 #[serde(rename = "triggerCondition")]
898 pub trigger_condition: OrderTriggerCondition,
899 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
901 pub reason: Option<LimitOrderReason>,
902 #[serde(
905 rename = "clientExtensions",
906 default,
907 skip_serializing_if = "Option::is_none"
908 )]
909 pub client_extensions: Option<ClientExtensions>,
910 #[serde(
913 rename = "takeProfitOnFill",
914 default,
915 skip_serializing_if = "Option::is_none"
916 )]
917 pub take_profit_on_fill: Option<TakeProfitDetails>,
918 #[serde(
921 rename = "stopLossOnFill",
922 default,
923 skip_serializing_if = "Option::is_none"
924 )]
925 pub stop_loss_on_fill: Option<StopLossDetails>,
926 #[serde(
929 rename = "trailingStopLossOnFill",
930 default,
931 skip_serializing_if = "Option::is_none"
932 )]
933 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
934 #[serde(
937 rename = "guaranteedStopLossOnFill",
938 default,
939 skip_serializing_if = "Option::is_none"
940 )]
941 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
942 #[serde(
945 rename = "tradeClientExtensions",
946 default,
947 skip_serializing_if = "Option::is_none"
948 )]
949 pub trade_client_extensions: Option<ClientExtensions>,
950 #[serde(
953 rename = "intendedReplacesOrderID",
954 default,
955 skip_serializing_if = "Option::is_none"
956 )]
957 pub intended_replaces_order_id: Option<OrderID>,
958 #[serde(
960 rename = "rejectReason",
961 default,
962 skip_serializing_if = "Option::is_none"
963 )]
964 pub reject_reason: Option<TransactionRejectReason>,
965}
966
967#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
969#[serde(rename_all = "camelCase")]
970pub struct StopOrderTransaction {
971 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
973 pub id: Option<TransactionID>,
974 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
976 pub time: Option<Timestamp>,
977 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
979 pub user_id: Option<i64>,
980 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
982 pub account_id: Option<AccountID>,
983 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
986 pub batch_id: Option<TransactionID>,
987 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
989 pub request_id: Option<RequestID>,
990 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
992 pub r#type: Option<TransactionType>,
993 #[serde(rename = "instrument")]
995 pub instrument: InstrumentName,
996 #[serde(rename = "units")]
999 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1000 pub units: Decimal,
1001 #[serde(rename = "price")]
1004 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1005 pub price: Decimal,
1006 #[serde(
1009 rename = "priceBound",
1010 default,
1011 skip_serializing_if = "Option::is_none"
1012 )]
1013 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1014 pub price_bound: Option<Decimal>,
1015 #[serde(rename = "timeInForce")]
1017 pub time_in_force: TimeInForce,
1018 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1020 pub gtd_time: Option<Timestamp>,
1021 #[serde(rename = "positionFill")]
1023 pub position_fill: OrderPositionFill,
1024 #[serde(rename = "triggerCondition")]
1037 pub trigger_condition: OrderTriggerCondition,
1038 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1040 pub reason: Option<StopOrderReason>,
1041 #[serde(
1044 rename = "clientExtensions",
1045 default,
1046 skip_serializing_if = "Option::is_none"
1047 )]
1048 pub client_extensions: Option<ClientExtensions>,
1049 #[serde(
1052 rename = "takeProfitOnFill",
1053 default,
1054 skip_serializing_if = "Option::is_none"
1055 )]
1056 pub take_profit_on_fill: Option<TakeProfitDetails>,
1057 #[serde(
1060 rename = "stopLossOnFill",
1061 default,
1062 skip_serializing_if = "Option::is_none"
1063 )]
1064 pub stop_loss_on_fill: Option<StopLossDetails>,
1065 #[serde(
1068 rename = "trailingStopLossOnFill",
1069 default,
1070 skip_serializing_if = "Option::is_none"
1071 )]
1072 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
1073 #[serde(
1076 rename = "guaranteedStopLossOnFill",
1077 default,
1078 skip_serializing_if = "Option::is_none"
1079 )]
1080 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
1081 #[serde(
1084 rename = "tradeClientExtensions",
1085 default,
1086 skip_serializing_if = "Option::is_none"
1087 )]
1088 pub trade_client_extensions: Option<ClientExtensions>,
1089 #[serde(
1091 rename = "replacesOrderID",
1092 default,
1093 skip_serializing_if = "Option::is_none"
1094 )]
1095 pub replaces_order_id: Option<OrderID>,
1096 #[serde(
1099 rename = "cancellingTransactionID",
1100 default,
1101 skip_serializing_if = "Option::is_none"
1102 )]
1103 pub cancelling_transaction_id: Option<TransactionID>,
1104}
1105
1106#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1108#[serde(rename_all = "camelCase")]
1109pub struct StopOrderRejectTransaction {
1110 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1112 pub id: Option<TransactionID>,
1113 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1115 pub time: Option<Timestamp>,
1116 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1118 pub user_id: Option<i64>,
1119 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1121 pub account_id: Option<AccountID>,
1122 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1125 pub batch_id: Option<TransactionID>,
1126 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1128 pub request_id: Option<RequestID>,
1129 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1131 pub r#type: Option<TransactionType>,
1132 #[serde(rename = "instrument")]
1134 pub instrument: InstrumentName,
1135 #[serde(rename = "units")]
1138 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1139 pub units: Decimal,
1140 #[serde(rename = "price")]
1143 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1144 pub price: Decimal,
1145 #[serde(
1148 rename = "priceBound",
1149 default,
1150 skip_serializing_if = "Option::is_none"
1151 )]
1152 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1153 pub price_bound: Option<Decimal>,
1154 #[serde(rename = "timeInForce")]
1156 pub time_in_force: TimeInForce,
1157 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1159 pub gtd_time: Option<Timestamp>,
1160 #[serde(rename = "positionFill")]
1162 pub position_fill: OrderPositionFill,
1163 #[serde(rename = "triggerCondition")]
1176 pub trigger_condition: OrderTriggerCondition,
1177 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1179 pub reason: Option<StopOrderReason>,
1180 #[serde(
1183 rename = "clientExtensions",
1184 default,
1185 skip_serializing_if = "Option::is_none"
1186 )]
1187 pub client_extensions: Option<ClientExtensions>,
1188 #[serde(
1191 rename = "takeProfitOnFill",
1192 default,
1193 skip_serializing_if = "Option::is_none"
1194 )]
1195 pub take_profit_on_fill: Option<TakeProfitDetails>,
1196 #[serde(
1199 rename = "stopLossOnFill",
1200 default,
1201 skip_serializing_if = "Option::is_none"
1202 )]
1203 pub stop_loss_on_fill: Option<StopLossDetails>,
1204 #[serde(
1207 rename = "trailingStopLossOnFill",
1208 default,
1209 skip_serializing_if = "Option::is_none"
1210 )]
1211 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
1212 #[serde(
1215 rename = "guaranteedStopLossOnFill",
1216 default,
1217 skip_serializing_if = "Option::is_none"
1218 )]
1219 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
1220 #[serde(
1223 rename = "tradeClientExtensions",
1224 default,
1225 skip_serializing_if = "Option::is_none"
1226 )]
1227 pub trade_client_extensions: Option<ClientExtensions>,
1228 #[serde(
1231 rename = "intendedReplacesOrderID",
1232 default,
1233 skip_serializing_if = "Option::is_none"
1234 )]
1235 pub intended_replaces_order_id: Option<OrderID>,
1236 #[serde(
1238 rename = "rejectReason",
1239 default,
1240 skip_serializing_if = "Option::is_none"
1241 )]
1242 pub reject_reason: Option<TransactionRejectReason>,
1243}
1244
1245#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1248#[serde(rename_all = "camelCase")]
1249pub struct MarketIfTouchedOrderTransaction {
1250 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1252 pub id: Option<TransactionID>,
1253 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1255 pub time: Option<Timestamp>,
1256 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1258 pub user_id: Option<i64>,
1259 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1261 pub account_id: Option<AccountID>,
1262 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1265 pub batch_id: Option<TransactionID>,
1266 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1268 pub request_id: Option<RequestID>,
1269 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1272 pub r#type: Option<TransactionType>,
1273 #[serde(rename = "instrument")]
1275 pub instrument: InstrumentName,
1276 #[serde(rename = "units")]
1279 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1280 pub units: Decimal,
1281 #[serde(rename = "price")]
1286 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1287 pub price: Decimal,
1288 #[serde(
1290 rename = "priceBound",
1291 default,
1292 skip_serializing_if = "Option::is_none"
1293 )]
1294 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1295 pub price_bound: Option<Decimal>,
1296 #[serde(rename = "timeInForce")]
1299 pub time_in_force: TimeInForce,
1300 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1302 pub gtd_time: Option<Timestamp>,
1303 #[serde(rename = "positionFill")]
1305 pub position_fill: OrderPositionFill,
1306 #[serde(rename = "triggerCondition")]
1319 pub trigger_condition: OrderTriggerCondition,
1320 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1322 pub reason: Option<MarketIfTouchedOrderReason>,
1323 #[serde(
1326 rename = "clientExtensions",
1327 default,
1328 skip_serializing_if = "Option::is_none"
1329 )]
1330 pub client_extensions: Option<ClientExtensions>,
1331 #[serde(
1334 rename = "takeProfitOnFill",
1335 default,
1336 skip_serializing_if = "Option::is_none"
1337 )]
1338 pub take_profit_on_fill: Option<TakeProfitDetails>,
1339 #[serde(
1342 rename = "stopLossOnFill",
1343 default,
1344 skip_serializing_if = "Option::is_none"
1345 )]
1346 pub stop_loss_on_fill: Option<StopLossDetails>,
1347 #[serde(
1350 rename = "trailingStopLossOnFill",
1351 default,
1352 skip_serializing_if = "Option::is_none"
1353 )]
1354 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
1355 #[serde(
1358 rename = "guaranteedStopLossOnFill",
1359 default,
1360 skip_serializing_if = "Option::is_none"
1361 )]
1362 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
1363 #[serde(
1366 rename = "tradeClientExtensions",
1367 default,
1368 skip_serializing_if = "Option::is_none"
1369 )]
1370 pub trade_client_extensions: Option<ClientExtensions>,
1371 #[serde(
1373 rename = "replacesOrderID",
1374 default,
1375 skip_serializing_if = "Option::is_none"
1376 )]
1377 pub replaces_order_id: Option<OrderID>,
1378 #[serde(
1381 rename = "cancellingTransactionID",
1382 default,
1383 skip_serializing_if = "Option::is_none"
1384 )]
1385 pub cancelling_transaction_id: Option<TransactionID>,
1386}
1387
1388#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1391#[serde(rename_all = "camelCase")]
1392pub struct MarketIfTouchedOrderRejectTransaction {
1393 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1395 pub id: Option<TransactionID>,
1396 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1398 pub time: Option<Timestamp>,
1399 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1401 pub user_id: Option<i64>,
1402 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1404 pub account_id: Option<AccountID>,
1405 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1408 pub batch_id: Option<TransactionID>,
1409 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1411 pub request_id: Option<RequestID>,
1412 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1415 pub r#type: Option<TransactionType>,
1416 #[serde(rename = "instrument")]
1418 pub instrument: InstrumentName,
1419 #[serde(rename = "units")]
1422 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1423 pub units: Decimal,
1424 #[serde(rename = "price")]
1429 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1430 pub price: Decimal,
1431 #[serde(
1433 rename = "priceBound",
1434 default,
1435 skip_serializing_if = "Option::is_none"
1436 )]
1437 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1438 pub price_bound: Option<Decimal>,
1439 #[serde(rename = "timeInForce")]
1442 pub time_in_force: TimeInForce,
1443 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1445 pub gtd_time: Option<Timestamp>,
1446 #[serde(rename = "positionFill")]
1448 pub position_fill: OrderPositionFill,
1449 #[serde(rename = "triggerCondition")]
1462 pub trigger_condition: OrderTriggerCondition,
1463 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1465 pub reason: Option<MarketIfTouchedOrderReason>,
1466 #[serde(
1469 rename = "clientExtensions",
1470 default,
1471 skip_serializing_if = "Option::is_none"
1472 )]
1473 pub client_extensions: Option<ClientExtensions>,
1474 #[serde(
1477 rename = "takeProfitOnFill",
1478 default,
1479 skip_serializing_if = "Option::is_none"
1480 )]
1481 pub take_profit_on_fill: Option<TakeProfitDetails>,
1482 #[serde(
1485 rename = "stopLossOnFill",
1486 default,
1487 skip_serializing_if = "Option::is_none"
1488 )]
1489 pub stop_loss_on_fill: Option<StopLossDetails>,
1490 #[serde(
1493 rename = "trailingStopLossOnFill",
1494 default,
1495 skip_serializing_if = "Option::is_none"
1496 )]
1497 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
1498 #[serde(
1501 rename = "guaranteedStopLossOnFill",
1502 default,
1503 skip_serializing_if = "Option::is_none"
1504 )]
1505 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
1506 #[serde(
1509 rename = "tradeClientExtensions",
1510 default,
1511 skip_serializing_if = "Option::is_none"
1512 )]
1513 pub trade_client_extensions: Option<ClientExtensions>,
1514 #[serde(
1517 rename = "intendedReplacesOrderID",
1518 default,
1519 skip_serializing_if = "Option::is_none"
1520 )]
1521 pub intended_replaces_order_id: Option<OrderID>,
1522 #[serde(
1524 rename = "rejectReason",
1525 default,
1526 skip_serializing_if = "Option::is_none"
1527 )]
1528 pub reject_reason: Option<TransactionRejectReason>,
1529}
1530
1531#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1533#[serde(rename_all = "camelCase")]
1534pub struct TakeProfitOrderTransaction {
1535 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1537 pub id: Option<TransactionID>,
1538 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1540 pub time: Option<Timestamp>,
1541 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1543 pub user_id: Option<i64>,
1544 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1546 pub account_id: Option<AccountID>,
1547 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1550 pub batch_id: Option<TransactionID>,
1551 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1553 pub request_id: Option<RequestID>,
1554 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1556 pub r#type: Option<TransactionType>,
1557 #[serde(rename = "tradeID")]
1559 pub trade_id: TradeID,
1560 #[serde(
1562 rename = "clientTradeID",
1563 default,
1564 skip_serializing_if = "Option::is_none"
1565 )]
1566 pub client_trade_id: Option<ClientID>,
1567 #[serde(rename = "price")]
1570 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1571 pub price: Decimal,
1572 #[serde(rename = "timeInForce")]
1575 pub time_in_force: TimeInForce,
1576 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1578 pub gtd_time: Option<Timestamp>,
1579 #[serde(rename = "triggerCondition")]
1592 pub trigger_condition: OrderTriggerCondition,
1593 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1595 pub reason: Option<TakeProfitOrderReason>,
1596 #[serde(
1599 rename = "clientExtensions",
1600 default,
1601 skip_serializing_if = "Option::is_none"
1602 )]
1603 pub client_extensions: Option<ClientExtensions>,
1604 #[serde(
1607 rename = "orderFillTransactionID",
1608 default,
1609 skip_serializing_if = "Option::is_none"
1610 )]
1611 pub order_fill_transaction_id: Option<TransactionID>,
1612 #[serde(
1614 rename = "replacesOrderID",
1615 default,
1616 skip_serializing_if = "Option::is_none"
1617 )]
1618 pub replaces_order_id: Option<OrderID>,
1619 #[serde(
1622 rename = "cancellingTransactionID",
1623 default,
1624 skip_serializing_if = "Option::is_none"
1625 )]
1626 pub cancelling_transaction_id: Option<TransactionID>,
1627}
1628
1629#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1631#[serde(rename_all = "camelCase")]
1632pub struct TakeProfitOrderRejectTransaction {
1633 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1635 pub id: Option<TransactionID>,
1636 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1638 pub time: Option<Timestamp>,
1639 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1641 pub user_id: Option<i64>,
1642 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1644 pub account_id: Option<AccountID>,
1645 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1648 pub batch_id: Option<TransactionID>,
1649 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1651 pub request_id: Option<RequestID>,
1652 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1655 pub r#type: Option<TransactionType>,
1656 #[serde(rename = "tradeID")]
1658 pub trade_id: TradeID,
1659 #[serde(
1661 rename = "clientTradeID",
1662 default,
1663 skip_serializing_if = "Option::is_none"
1664 )]
1665 pub client_trade_id: Option<ClientID>,
1666 #[serde(rename = "price")]
1669 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1670 pub price: Decimal,
1671 #[serde(rename = "timeInForce")]
1674 pub time_in_force: TimeInForce,
1675 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1677 pub gtd_time: Option<Timestamp>,
1678 #[serde(rename = "triggerCondition")]
1691 pub trigger_condition: OrderTriggerCondition,
1692 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1694 pub reason: Option<TakeProfitOrderReason>,
1695 #[serde(
1698 rename = "clientExtensions",
1699 default,
1700 skip_serializing_if = "Option::is_none"
1701 )]
1702 pub client_extensions: Option<ClientExtensions>,
1703 #[serde(
1706 rename = "orderFillTransactionID",
1707 default,
1708 skip_serializing_if = "Option::is_none"
1709 )]
1710 pub order_fill_transaction_id: Option<TransactionID>,
1711 #[serde(
1714 rename = "intendedReplacesOrderID",
1715 default,
1716 skip_serializing_if = "Option::is_none"
1717 )]
1718 pub intended_replaces_order_id: Option<OrderID>,
1719 #[serde(
1721 rename = "rejectReason",
1722 default,
1723 skip_serializing_if = "Option::is_none"
1724 )]
1725 pub reject_reason: Option<TransactionRejectReason>,
1726}
1727
1728#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1730#[serde(rename_all = "camelCase")]
1731pub struct StopLossOrderTransaction {
1732 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1734 pub id: Option<TransactionID>,
1735 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1737 pub time: Option<Timestamp>,
1738 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1740 pub user_id: Option<i64>,
1741 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1743 pub account_id: Option<AccountID>,
1744 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1747 pub batch_id: Option<TransactionID>,
1748 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1750 pub request_id: Option<RequestID>,
1751 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1753 pub r#type: Option<TransactionType>,
1754 #[serde(rename = "tradeID")]
1756 pub trade_id: TradeID,
1757 #[serde(
1759 rename = "clientTradeID",
1760 default,
1761 skip_serializing_if = "Option::is_none"
1762 )]
1763 pub client_trade_id: Option<ClientID>,
1764 #[serde(rename = "price")]
1767 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1768 pub price: Decimal,
1769 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
1772 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1773 pub distance: Option<Decimal>,
1774 #[serde(rename = "timeInForce")]
1777 pub time_in_force: TimeInForce,
1778 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1780 pub gtd_time: Option<Timestamp>,
1781 #[serde(rename = "triggerCondition")]
1794 pub trigger_condition: OrderTriggerCondition,
1795 #[serde(
1799 rename = "guaranteed",
1800 default,
1801 skip_serializing_if = "Option::is_none"
1802 )]
1803 pub guaranteed: Option<bool>,
1804 #[serde(
1808 rename = "guaranteedExecutionPremium",
1809 default,
1810 skip_serializing_if = "Option::is_none"
1811 )]
1812 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1813 pub guaranteed_execution_premium: Option<Decimal>,
1814 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1816 pub reason: Option<StopLossOrderReason>,
1817 #[serde(
1820 rename = "clientExtensions",
1821 default,
1822 skip_serializing_if = "Option::is_none"
1823 )]
1824 pub client_extensions: Option<ClientExtensions>,
1825 #[serde(
1828 rename = "orderFillTransactionID",
1829 default,
1830 skip_serializing_if = "Option::is_none"
1831 )]
1832 pub order_fill_transaction_id: Option<TransactionID>,
1833 #[serde(
1835 rename = "replacesOrderID",
1836 default,
1837 skip_serializing_if = "Option::is_none"
1838 )]
1839 pub replaces_order_id: Option<OrderID>,
1840 #[serde(
1843 rename = "cancellingTransactionID",
1844 default,
1845 skip_serializing_if = "Option::is_none"
1846 )]
1847 pub cancelling_transaction_id: Option<TransactionID>,
1848}
1849
1850#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1852#[serde(rename_all = "camelCase")]
1853pub struct StopLossOrderRejectTransaction {
1854 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1856 pub id: Option<TransactionID>,
1857 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1859 pub time: Option<Timestamp>,
1860 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1862 pub user_id: Option<i64>,
1863 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1865 pub account_id: Option<AccountID>,
1866 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1869 pub batch_id: Option<TransactionID>,
1870 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1872 pub request_id: Option<RequestID>,
1873 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1875 pub r#type: Option<TransactionType>,
1876 #[serde(rename = "tradeID")]
1878 pub trade_id: TradeID,
1879 #[serde(
1881 rename = "clientTradeID",
1882 default,
1883 skip_serializing_if = "Option::is_none"
1884 )]
1885 pub client_trade_id: Option<ClientID>,
1886 #[serde(rename = "price")]
1889 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1890 pub price: Decimal,
1891 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
1894 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1895 pub distance: Option<Decimal>,
1896 #[serde(rename = "timeInForce")]
1899 pub time_in_force: TimeInForce,
1900 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1902 pub gtd_time: Option<Timestamp>,
1903 #[serde(rename = "triggerCondition")]
1916 pub trigger_condition: OrderTriggerCondition,
1917 #[serde(
1921 rename = "guaranteed",
1922 default,
1923 skip_serializing_if = "Option::is_none"
1924 )]
1925 pub guaranteed: Option<bool>,
1926 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1928 pub reason: Option<StopLossOrderReason>,
1929 #[serde(
1932 rename = "clientExtensions",
1933 default,
1934 skip_serializing_if = "Option::is_none"
1935 )]
1936 pub client_extensions: Option<ClientExtensions>,
1937 #[serde(
1940 rename = "orderFillTransactionID",
1941 default,
1942 skip_serializing_if = "Option::is_none"
1943 )]
1944 pub order_fill_transaction_id: Option<TransactionID>,
1945 #[serde(
1948 rename = "intendedReplacesOrderID",
1949 default,
1950 skip_serializing_if = "Option::is_none"
1951 )]
1952 pub intended_replaces_order_id: Option<OrderID>,
1953 #[serde(
1955 rename = "rejectReason",
1956 default,
1957 skip_serializing_if = "Option::is_none"
1958 )]
1959 pub reject_reason: Option<TransactionRejectReason>,
1960}
1961
1962#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1965#[serde(rename_all = "camelCase")]
1966pub struct GuaranteedStopLossOrderTransaction {
1967 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1969 pub id: Option<TransactionID>,
1970 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1972 pub time: Option<Timestamp>,
1973 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1975 pub user_id: Option<i64>,
1976 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1978 pub account_id: Option<AccountID>,
1979 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1982 pub batch_id: Option<TransactionID>,
1983 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1985 pub request_id: Option<RequestID>,
1986 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1989 pub r#type: Option<TransactionType>,
1990 #[serde(rename = "tradeID")]
1992 pub trade_id: TradeID,
1993 #[serde(
1995 rename = "clientTradeID",
1996 default,
1997 skip_serializing_if = "Option::is_none"
1998 )]
1999 pub client_trade_id: Option<ClientID>,
2000 #[serde(rename = "price")]
2003 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
2004 pub price: Decimal,
2005 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
2009 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2010 pub distance: Option<Decimal>,
2011 #[serde(rename = "timeInForce")]
2014 pub time_in_force: TimeInForce,
2015 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
2017 pub gtd_time: Option<Timestamp>,
2018 #[serde(rename = "triggerCondition")]
2031 pub trigger_condition: OrderTriggerCondition,
2032 #[serde(
2036 rename = "guaranteedExecutionPremium",
2037 default,
2038 skip_serializing_if = "Option::is_none"
2039 )]
2040 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2041 pub guaranteed_execution_premium: Option<Decimal>,
2042 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2044 pub reason: Option<GuaranteedStopLossOrderReason>,
2045 #[serde(
2048 rename = "clientExtensions",
2049 default,
2050 skip_serializing_if = "Option::is_none"
2051 )]
2052 pub client_extensions: Option<ClientExtensions>,
2053 #[serde(
2056 rename = "orderFillTransactionID",
2057 default,
2058 skip_serializing_if = "Option::is_none"
2059 )]
2060 pub order_fill_transaction_id: Option<TransactionID>,
2061 #[serde(
2063 rename = "replacesOrderID",
2064 default,
2065 skip_serializing_if = "Option::is_none"
2066 )]
2067 pub replaces_order_id: Option<OrderID>,
2068 #[serde(
2071 rename = "cancellingTransactionID",
2072 default,
2073 skip_serializing_if = "Option::is_none"
2074 )]
2075 pub cancelling_transaction_id: Option<TransactionID>,
2076}
2077
2078#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2081#[serde(rename_all = "camelCase")]
2082pub struct GuaranteedStopLossOrderRejectTransaction {
2083 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2085 pub id: Option<TransactionID>,
2086 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2088 pub time: Option<Timestamp>,
2089 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2091 pub user_id: Option<i64>,
2092 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2094 pub account_id: Option<AccountID>,
2095 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2098 pub batch_id: Option<TransactionID>,
2099 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2101 pub request_id: Option<RequestID>,
2102 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2105 pub r#type: Option<TransactionType>,
2106 #[serde(rename = "tradeID")]
2108 pub trade_id: TradeID,
2109 #[serde(
2111 rename = "clientTradeID",
2112 default,
2113 skip_serializing_if = "Option::is_none"
2114 )]
2115 pub client_trade_id: Option<ClientID>,
2116 #[serde(rename = "price")]
2119 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
2120 pub price: Decimal,
2121 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
2125 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2126 pub distance: Option<Decimal>,
2127 #[serde(rename = "timeInForce")]
2130 pub time_in_force: TimeInForce,
2131 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
2133 pub gtd_time: Option<Timestamp>,
2134 #[serde(rename = "triggerCondition")]
2147 pub trigger_condition: OrderTriggerCondition,
2148 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2150 pub reason: Option<GuaranteedStopLossOrderReason>,
2151 #[serde(
2154 rename = "clientExtensions",
2155 default,
2156 skip_serializing_if = "Option::is_none"
2157 )]
2158 pub client_extensions: Option<ClientExtensions>,
2159 #[serde(
2162 rename = "orderFillTransactionID",
2163 default,
2164 skip_serializing_if = "Option::is_none"
2165 )]
2166 pub order_fill_transaction_id: Option<TransactionID>,
2167 #[serde(
2170 rename = "intendedReplacesOrderID",
2171 default,
2172 skip_serializing_if = "Option::is_none"
2173 )]
2174 pub intended_replaces_order_id: Option<OrderID>,
2175 #[serde(
2177 rename = "rejectReason",
2178 default,
2179 skip_serializing_if = "Option::is_none"
2180 )]
2181 pub reject_reason: Option<TransactionRejectReason>,
2182}
2183
2184#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2187#[serde(rename_all = "camelCase")]
2188pub struct TrailingStopLossOrderTransaction {
2189 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2191 pub id: Option<TransactionID>,
2192 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2194 pub time: Option<Timestamp>,
2195 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2197 pub user_id: Option<i64>,
2198 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2200 pub account_id: Option<AccountID>,
2201 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2204 pub batch_id: Option<TransactionID>,
2205 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2207 pub request_id: Option<RequestID>,
2208 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2211 pub r#type: Option<TransactionType>,
2212 #[serde(rename = "tradeID")]
2214 pub trade_id: TradeID,
2215 #[serde(
2217 rename = "clientTradeID",
2218 default,
2219 skip_serializing_if = "Option::is_none"
2220 )]
2221 pub client_trade_id: Option<ClientID>,
2222 #[serde(rename = "distance")]
2224 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
2225 pub distance: Decimal,
2226 #[serde(rename = "timeInForce")]
2229 pub time_in_force: TimeInForce,
2230 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
2232 pub gtd_time: Option<Timestamp>,
2233 #[serde(rename = "triggerCondition")]
2246 pub trigger_condition: OrderTriggerCondition,
2247 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2249 pub reason: Option<TrailingStopLossOrderReason>,
2250 #[serde(
2253 rename = "clientExtensions",
2254 default,
2255 skip_serializing_if = "Option::is_none"
2256 )]
2257 pub client_extensions: Option<ClientExtensions>,
2258 #[serde(
2261 rename = "orderFillTransactionID",
2262 default,
2263 skip_serializing_if = "Option::is_none"
2264 )]
2265 pub order_fill_transaction_id: Option<TransactionID>,
2266 #[serde(
2268 rename = "replacesOrderID",
2269 default,
2270 skip_serializing_if = "Option::is_none"
2271 )]
2272 pub replaces_order_id: Option<OrderID>,
2273 #[serde(
2276 rename = "cancellingTransactionID",
2277 default,
2278 skip_serializing_if = "Option::is_none"
2279 )]
2280 pub cancelling_transaction_id: Option<TransactionID>,
2281}
2282
2283#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2286#[serde(rename_all = "camelCase")]
2287pub struct TrailingStopLossOrderRejectTransaction {
2288 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2290 pub id: Option<TransactionID>,
2291 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2293 pub time: Option<Timestamp>,
2294 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2296 pub user_id: Option<i64>,
2297 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2299 pub account_id: Option<AccountID>,
2300 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2303 pub batch_id: Option<TransactionID>,
2304 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2306 pub request_id: Option<RequestID>,
2307 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2310 pub r#type: Option<TransactionType>,
2311 #[serde(rename = "tradeID")]
2313 pub trade_id: TradeID,
2314 #[serde(
2316 rename = "clientTradeID",
2317 default,
2318 skip_serializing_if = "Option::is_none"
2319 )]
2320 pub client_trade_id: Option<ClientID>,
2321 #[serde(rename = "distance")]
2323 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
2324 pub distance: Decimal,
2325 #[serde(rename = "timeInForce")]
2328 pub time_in_force: TimeInForce,
2329 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
2331 pub gtd_time: Option<Timestamp>,
2332 #[serde(rename = "triggerCondition")]
2345 pub trigger_condition: OrderTriggerCondition,
2346 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2348 pub reason: Option<TrailingStopLossOrderReason>,
2349 #[serde(
2352 rename = "clientExtensions",
2353 default,
2354 skip_serializing_if = "Option::is_none"
2355 )]
2356 pub client_extensions: Option<ClientExtensions>,
2357 #[serde(
2360 rename = "orderFillTransactionID",
2361 default,
2362 skip_serializing_if = "Option::is_none"
2363 )]
2364 pub order_fill_transaction_id: Option<TransactionID>,
2365 #[serde(
2368 rename = "intendedReplacesOrderID",
2369 default,
2370 skip_serializing_if = "Option::is_none"
2371 )]
2372 pub intended_replaces_order_id: Option<OrderID>,
2373 #[serde(
2375 rename = "rejectReason",
2376 default,
2377 skip_serializing_if = "Option::is_none"
2378 )]
2379 pub reject_reason: Option<TransactionRejectReason>,
2380}
2381
2382#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2384#[serde(rename_all = "camelCase")]
2385pub struct OrderFillTransaction {
2386 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2388 pub id: Option<TransactionID>,
2389 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2391 pub time: Option<Timestamp>,
2392 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2394 pub user_id: Option<i64>,
2395 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2397 pub account_id: Option<AccountID>,
2398 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2401 pub batch_id: Option<TransactionID>,
2402 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2404 pub request_id: Option<RequestID>,
2405 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2407 pub r#type: Option<TransactionType>,
2408 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2410 pub order_id: Option<OrderID>,
2411 #[serde(
2413 rename = "clientOrderID",
2414 default,
2415 skip_serializing_if = "Option::is_none"
2416 )]
2417 pub client_order_id: Option<ClientID>,
2418 #[serde(
2420 rename = "instrument",
2421 default,
2422 skip_serializing_if = "Option::is_none"
2423 )]
2424 pub instrument: Option<InstrumentName>,
2425 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
2427 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2428 pub units: Option<Decimal>,
2429 #[serde(
2434 rename = "requestedUnits",
2435 default,
2436 skip_serializing_if = "Option::is_none"
2437 )]
2438 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2439 pub requested_units: Option<Decimal>,
2440 #[serde(
2444 rename = "gainQuoteHomeConversionFactor",
2445 default,
2446 skip_serializing_if = "Option::is_none"
2447 )]
2448 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2449 pub gain_quote_home_conversion_factor: Option<Decimal>,
2450 #[serde(
2454 rename = "lossQuoteHomeConversionFactor",
2455 default,
2456 skip_serializing_if = "Option::is_none"
2457 )]
2458 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2459 pub loss_quote_home_conversion_factor: Option<Decimal>,
2460 #[serde(
2462 rename = "homeConversionFactors",
2463 default,
2464 skip_serializing_if = "Option::is_none"
2465 )]
2466 pub home_conversion_factors: Option<HomeConversionFactors>,
2467 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
2471 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2472 pub price: Option<Decimal>,
2473 #[serde(rename = "fullVWAP", default, skip_serializing_if = "Option::is_none")]
2479 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2480 pub full_vwap: Option<Decimal>,
2481 #[serde(rename = "fullPrice", default, skip_serializing_if = "Option::is_none")]
2483 pub full_price: Option<ClientPrice>,
2484 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2486 pub reason: Option<OrderFillReason>,
2487 #[serde(rename = "pl", default, skip_serializing_if = "Option::is_none")]
2489 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2490 pub pl: Option<Decimal>,
2491 #[serde(rename = "quotePL", default, skip_serializing_if = "Option::is_none")]
2493 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2494 pub quote_pl: Option<Decimal>,
2495 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
2497 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2498 pub financing: Option<Decimal>,
2499 #[serde(
2501 rename = "baseFinancing",
2502 default,
2503 skip_serializing_if = "Option::is_none"
2504 )]
2505 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2506 pub base_financing: Option<Decimal>,
2507 #[serde(
2509 rename = "quoteFinancing",
2510 default,
2511 skip_serializing_if = "Option::is_none"
2512 )]
2513 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2514 pub quote_financing: Option<Decimal>,
2515 #[serde(
2519 rename = "commission",
2520 default,
2521 skip_serializing_if = "Option::is_none"
2522 )]
2523 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2524 pub commission: Option<Decimal>,
2525 #[serde(
2528 rename = "guaranteedExecutionFee",
2529 default,
2530 skip_serializing_if = "Option::is_none"
2531 )]
2532 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2533 pub guaranteed_execution_fee: Option<Decimal>,
2534 #[serde(
2537 rename = "quoteGuaranteedExecutionFee",
2538 default,
2539 skip_serializing_if = "Option::is_none"
2540 )]
2541 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2542 pub quote_guaranteed_execution_fee: Option<Decimal>,
2543 #[serde(
2545 rename = "accountBalance",
2546 default,
2547 skip_serializing_if = "Option::is_none"
2548 )]
2549 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2550 pub account_balance: Option<Decimal>,
2551 #[serde(
2554 rename = "tradeOpened",
2555 default,
2556 skip_serializing_if = "Option::is_none"
2557 )]
2558 pub trade_opened: Option<TradeOpen>,
2559 #[serde(
2562 rename = "tradesClosed",
2563 default,
2564 skip_serializing_if = "Option::is_none"
2565 )]
2566 pub trades_closed: Option<Vec<TradeReduce>>,
2567 #[serde(
2570 rename = "tradeReduced",
2571 default,
2572 skip_serializing_if = "Option::is_none"
2573 )]
2574 pub trade_reduced: Option<TradeReduce>,
2575 #[serde(
2579 rename = "halfSpreadCost",
2580 default,
2581 skip_serializing_if = "Option::is_none"
2582 )]
2583 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2584 pub half_spread_cost: Option<Decimal>,
2585 #[serde(
2591 rename = "plHomeConversionCost",
2592 default,
2593 skip_serializing_if = "Option::is_none"
2594 )]
2595 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2596 pub pl_home_conversion_cost: Option<Decimal>,
2597 #[serde(
2602 rename = "baseFinancingHomeConversionCost",
2603 default,
2604 skip_serializing_if = "Option::is_none"
2605 )]
2606 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2607 pub base_financing_home_conversion_cost: Option<Decimal>,
2608 #[serde(
2613 rename = "guaranteedExecutionFeeHomeConversionCost",
2614 default,
2615 skip_serializing_if = "Option::is_none"
2616 )]
2617 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2618 pub guaranteed_execution_fee_home_conversion_cost: Option<Decimal>,
2619 #[serde(
2624 rename = "homeConversionCost",
2625 default,
2626 skip_serializing_if = "Option::is_none"
2627 )]
2628 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2629 pub home_conversion_cost: Option<Decimal>,
2630}
2631
2632#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2634#[serde(rename_all = "camelCase")]
2635pub struct OrderCancelTransaction {
2636 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2638 pub id: Option<TransactionID>,
2639 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2641 pub time: Option<Timestamp>,
2642 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2644 pub user_id: Option<i64>,
2645 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2647 pub account_id: Option<AccountID>,
2648 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2651 pub batch_id: Option<TransactionID>,
2652 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2654 pub request_id: Option<RequestID>,
2655 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2657 pub r#type: Option<TransactionType>,
2658 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2660 pub order_id: Option<OrderID>,
2661 #[serde(
2663 rename = "clientOrderID",
2664 default,
2665 skip_serializing_if = "Option::is_none"
2666 )]
2667 pub client_order_id: Option<OrderID>,
2668 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2670 pub reason: Option<OrderCancelReason>,
2671 #[serde(
2673 rename = "replacedByOrderID",
2674 default,
2675 skip_serializing_if = "Option::is_none"
2676 )]
2677 pub replaced_by_order_id: Option<OrderID>,
2678}
2679
2680#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2683#[serde(rename_all = "camelCase")]
2684pub struct OrderCancelRejectTransaction {
2685 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2687 pub id: Option<TransactionID>,
2688 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2690 pub time: Option<Timestamp>,
2691 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2693 pub user_id: Option<i64>,
2694 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2696 pub account_id: Option<AccountID>,
2697 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2700 pub batch_id: Option<TransactionID>,
2701 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2703 pub request_id: Option<RequestID>,
2704 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2706 pub r#type: Option<TransactionType>,
2707 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2709 pub order_id: Option<OrderID>,
2710 #[serde(
2712 rename = "clientOrderID",
2713 default,
2714 skip_serializing_if = "Option::is_none"
2715 )]
2716 pub client_order_id: Option<OrderID>,
2717 #[serde(
2719 rename = "rejectReason",
2720 default,
2721 skip_serializing_if = "Option::is_none"
2722 )]
2723 pub reject_reason: Option<TransactionRejectReason>,
2724}
2725
2726#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2728#[serde(rename_all = "camelCase")]
2729pub struct OrderClientExtensionsModifyTransaction {
2730 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2732 pub id: Option<TransactionID>,
2733 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2735 pub time: Option<Timestamp>,
2736 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2738 pub user_id: Option<i64>,
2739 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2741 pub account_id: Option<AccountID>,
2742 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2745 pub batch_id: Option<TransactionID>,
2746 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2748 pub request_id: Option<RequestID>,
2749 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2752 pub r#type: Option<TransactionType>,
2753 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2755 pub order_id: Option<OrderID>,
2756 #[serde(
2758 rename = "clientOrderID",
2759 default,
2760 skip_serializing_if = "Option::is_none"
2761 )]
2762 pub client_order_id: Option<ClientID>,
2763 #[serde(
2765 rename = "clientExtensionsModify",
2766 default,
2767 skip_serializing_if = "Option::is_none"
2768 )]
2769 pub client_extensions_modify: Option<ClientExtensions>,
2770 #[serde(
2772 rename = "tradeClientExtensionsModify",
2773 default,
2774 skip_serializing_if = "Option::is_none"
2775 )]
2776 pub trade_client_extensions_modify: Option<ClientExtensions>,
2777}
2778
2779#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2782#[serde(rename_all = "camelCase")]
2783pub struct OrderClientExtensionsModifyRejectTransaction {
2784 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2786 pub id: Option<TransactionID>,
2787 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2789 pub time: Option<Timestamp>,
2790 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2792 pub user_id: Option<i64>,
2793 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2795 pub account_id: Option<AccountID>,
2796 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2799 pub batch_id: Option<TransactionID>,
2800 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2802 pub request_id: Option<RequestID>,
2803 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2806 pub r#type: Option<TransactionType>,
2807 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2809 pub order_id: Option<OrderID>,
2810 #[serde(
2812 rename = "clientOrderID",
2813 default,
2814 skip_serializing_if = "Option::is_none"
2815 )]
2816 pub client_order_id: Option<ClientID>,
2817 #[serde(
2819 rename = "clientExtensionsModify",
2820 default,
2821 skip_serializing_if = "Option::is_none"
2822 )]
2823 pub client_extensions_modify: Option<ClientExtensions>,
2824 #[serde(
2826 rename = "tradeClientExtensionsModify",
2827 default,
2828 skip_serializing_if = "Option::is_none"
2829 )]
2830 pub trade_client_extensions_modify: Option<ClientExtensions>,
2831 #[serde(
2833 rename = "rejectReason",
2834 default,
2835 skip_serializing_if = "Option::is_none"
2836 )]
2837 pub reject_reason: Option<TransactionRejectReason>,
2838}
2839
2840#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2842#[serde(rename_all = "camelCase")]
2843pub struct TradeClientExtensionsModifyTransaction {
2844 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2846 pub id: Option<TransactionID>,
2847 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2849 pub time: Option<Timestamp>,
2850 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2852 pub user_id: Option<i64>,
2853 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2855 pub account_id: Option<AccountID>,
2856 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2859 pub batch_id: Option<TransactionID>,
2860 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2862 pub request_id: Option<RequestID>,
2863 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2866 pub r#type: Option<TransactionType>,
2867 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
2869 pub trade_id: Option<TradeID>,
2870 #[serde(
2872 rename = "clientTradeID",
2873 default,
2874 skip_serializing_if = "Option::is_none"
2875 )]
2876 pub client_trade_id: Option<ClientID>,
2877 #[serde(
2879 rename = "tradeClientExtensionsModify",
2880 default,
2881 skip_serializing_if = "Option::is_none"
2882 )]
2883 pub trade_client_extensions_modify: Option<ClientExtensions>,
2884}
2885
2886#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2889#[serde(rename_all = "camelCase")]
2890pub struct TradeClientExtensionsModifyRejectTransaction {
2891 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2893 pub id: Option<TransactionID>,
2894 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2896 pub time: Option<Timestamp>,
2897 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2899 pub user_id: Option<i64>,
2900 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2902 pub account_id: Option<AccountID>,
2903 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2906 pub batch_id: Option<TransactionID>,
2907 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2909 pub request_id: Option<RequestID>,
2910 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2913 pub r#type: Option<TransactionType>,
2914 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
2916 pub trade_id: Option<TradeID>,
2917 #[serde(
2919 rename = "clientTradeID",
2920 default,
2921 skip_serializing_if = "Option::is_none"
2922 )]
2923 pub client_trade_id: Option<ClientID>,
2924 #[serde(
2926 rename = "tradeClientExtensionsModify",
2927 default,
2928 skip_serializing_if = "Option::is_none"
2929 )]
2930 pub trade_client_extensions_modify: Option<ClientExtensions>,
2931 #[serde(
2933 rename = "rejectReason",
2934 default,
2935 skip_serializing_if = "Option::is_none"
2936 )]
2937 pub reject_reason: Option<TransactionRejectReason>,
2938}
2939
2940#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2942#[serde(rename_all = "camelCase")]
2943pub struct MarginCallEnterTransaction {
2944 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2946 pub id: Option<TransactionID>,
2947 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2949 pub time: Option<Timestamp>,
2950 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2952 pub user_id: Option<i64>,
2953 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2955 pub account_id: Option<AccountID>,
2956 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2959 pub batch_id: Option<TransactionID>,
2960 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2962 pub request_id: Option<RequestID>,
2963 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2965 pub r#type: Option<TransactionType>,
2966}
2967
2968#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2970#[serde(rename_all = "camelCase")]
2971pub struct MarginCallExtendTransaction {
2972 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2974 pub id: Option<TransactionID>,
2975 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2977 pub time: Option<Timestamp>,
2978 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2980 pub user_id: Option<i64>,
2981 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2983 pub account_id: Option<AccountID>,
2984 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2987 pub batch_id: Option<TransactionID>,
2988 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2990 pub request_id: Option<RequestID>,
2991 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2993 pub r#type: Option<TransactionType>,
2994 #[serde(
2997 rename = "extensionNumber",
2998 default,
2999 skip_serializing_if = "Option::is_none"
3000 )]
3001 pub extension_number: Option<i64>,
3002}
3003
3004#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3006#[serde(rename_all = "camelCase")]
3007pub struct MarginCallExitTransaction {
3008 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
3010 pub id: Option<TransactionID>,
3011 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
3013 pub time: Option<Timestamp>,
3014 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
3016 pub user_id: Option<i64>,
3017 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
3019 pub account_id: Option<AccountID>,
3020 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
3023 pub batch_id: Option<TransactionID>,
3024 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
3026 pub request_id: Option<RequestID>,
3027 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3029 pub r#type: Option<TransactionType>,
3030}
3031
3032#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3036#[serde(rename_all = "camelCase")]
3037pub struct DelayedTradeClosureTransaction {
3038 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
3040 pub id: Option<TransactionID>,
3041 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
3043 pub time: Option<Timestamp>,
3044 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
3046 pub user_id: Option<i64>,
3047 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
3049 pub account_id: Option<AccountID>,
3050 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
3053 pub batch_id: Option<TransactionID>,
3054 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
3056 pub request_id: Option<RequestID>,
3057 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3059 pub r#type: Option<TransactionType>,
3060 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
3062 pub reason: Option<MarketOrderReason>,
3063 #[serde(rename = "tradeIDs", default, skip_serializing_if = "Option::is_none")]
3066 pub trade_ids: Option<TradeID>,
3067}
3068
3069#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3071#[serde(rename_all = "camelCase")]
3072pub struct DailyFinancingTransaction {
3073 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
3075 pub id: Option<TransactionID>,
3076 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
3078 pub time: Option<Timestamp>,
3079 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
3081 pub user_id: Option<i64>,
3082 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
3084 pub account_id: Option<AccountID>,
3085 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
3088 pub batch_id: Option<TransactionID>,
3089 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
3091 pub request_id: Option<RequestID>,
3092 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3094 pub r#type: Option<TransactionType>,
3095 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
3097 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3098 pub financing: Option<Decimal>,
3099 #[serde(
3101 rename = "accountBalance",
3102 default,
3103 skip_serializing_if = "Option::is_none"
3104 )]
3105 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3106 pub account_balance: Option<Decimal>,
3107 #[serde(
3111 rename = "accountFinancingMode",
3112 default,
3113 skip_serializing_if = "Option::is_none"
3114 )]
3115 pub account_financing_mode: Option<AccountFinancingMode>,
3116 #[serde(
3118 rename = "positionFinancings",
3119 default,
3120 skip_serializing_if = "Option::is_none"
3121 )]
3122 pub position_financings: Option<Vec<PositionFinancing>>,
3123}
3124
3125#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3128#[serde(rename_all = "camelCase")]
3129pub struct DividendAdjustmentTransaction {
3130 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
3132 pub id: Option<TransactionID>,
3133 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
3135 pub time: Option<Timestamp>,
3136 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
3138 pub user_id: Option<i64>,
3139 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
3141 pub account_id: Option<AccountID>,
3142 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
3145 pub batch_id: Option<TransactionID>,
3146 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
3148 pub request_id: Option<RequestID>,
3149 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3151 pub r#type: Option<TransactionType>,
3152 #[serde(
3154 rename = "instrument",
3155 default,
3156 skip_serializing_if = "Option::is_none"
3157 )]
3158 pub instrument: Option<InstrumentName>,
3159 #[serde(
3163 rename = "dividendAdjustment",
3164 default,
3165 skip_serializing_if = "Option::is_none"
3166 )]
3167 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3168 pub dividend_adjustment: Option<Decimal>,
3169 #[serde(
3173 rename = "quoteDividendAdjustment",
3174 default,
3175 skip_serializing_if = "Option::is_none"
3176 )]
3177 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3178 pub quote_dividend_adjustment: Option<Decimal>,
3179 #[serde(
3181 rename = "homeConversionFactors",
3182 default,
3183 skip_serializing_if = "Option::is_none"
3184 )]
3185 pub home_conversion_factors: Option<HomeConversionFactors>,
3186 #[serde(
3188 rename = "accountBalance",
3189 default,
3190 skip_serializing_if = "Option::is_none"
3191 )]
3192 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3193 pub account_balance: Option<Decimal>,
3194 #[serde(
3197 rename = "openTradeDividendAdjustments",
3198 default,
3199 skip_serializing_if = "Option::is_none"
3200 )]
3201 pub open_trade_dividend_adjustments: Option<Vec<OpenTradeDividendAdjustment>>,
3202}
3203
3204#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3206#[serde(rename_all = "camelCase")]
3207pub struct ResetResettablePLTransaction {
3208 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
3210 pub id: Option<TransactionID>,
3211 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
3213 pub time: Option<Timestamp>,
3214 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
3216 pub user_id: Option<i64>,
3217 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
3219 pub account_id: Option<AccountID>,
3220 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
3223 pub batch_id: Option<TransactionID>,
3224 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
3226 pub request_id: Option<RequestID>,
3227 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3229 pub r#type: Option<TransactionType>,
3230}
3231
3232#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3234#[non_exhaustive]
3235pub enum TransactionType {
3236 Create,
3238 Close,
3240 Reopen,
3242 ClientConfigure,
3244 ClientConfigureReject,
3246 TransferFunds,
3248 TransferFundsReject,
3250 MarketOrder,
3252 MarketOrderReject,
3254 FixedPriceOrder,
3256 LimitOrder,
3258 LimitOrderReject,
3260 StopOrder,
3262 StopOrderReject,
3264 MarketIfTouchedOrder,
3266 MarketIfTouchedOrderReject,
3268 TakeProfitOrder,
3270 TakeProfitOrderReject,
3272 StopLossOrder,
3274 StopLossOrderReject,
3276 GuaranteedStopLossOrder,
3278 GuaranteedStopLossOrderReject,
3280 TrailingStopLossOrder,
3282 TrailingStopLossOrderReject,
3284 OrderFill,
3286 OrderCancel,
3288 OrderCancelReject,
3290 OrderClientExtensionsModify,
3292 OrderClientExtensionsModifyReject,
3294 TradeClientExtensionsModify,
3296 TradeClientExtensionsModifyReject,
3298 MarginCallEnter,
3300 MarginCallExtend,
3302 MarginCallExit,
3304 DelayedTradeClosure,
3306 DailyFinancing,
3308 DividendAdjustment,
3310 ResetResettablePl,
3312 Unknown(String),
3314}
3315
3316impl TransactionType {
3317 pub fn as_str(&self) -> &str {
3319 match self {
3320 Self::Create => "CREATE",
3321 Self::Close => "CLOSE",
3322 Self::Reopen => "REOPEN",
3323 Self::ClientConfigure => "CLIENT_CONFIGURE",
3324 Self::ClientConfigureReject => "CLIENT_CONFIGURE_REJECT",
3325 Self::TransferFunds => "TRANSFER_FUNDS",
3326 Self::TransferFundsReject => "TRANSFER_FUNDS_REJECT",
3327 Self::MarketOrder => "MARKET_ORDER",
3328 Self::MarketOrderReject => "MARKET_ORDER_REJECT",
3329 Self::FixedPriceOrder => "FIXED_PRICE_ORDER",
3330 Self::LimitOrder => "LIMIT_ORDER",
3331 Self::LimitOrderReject => "LIMIT_ORDER_REJECT",
3332 Self::StopOrder => "STOP_ORDER",
3333 Self::StopOrderReject => "STOP_ORDER_REJECT",
3334 Self::MarketIfTouchedOrder => "MARKET_IF_TOUCHED_ORDER",
3335 Self::MarketIfTouchedOrderReject => "MARKET_IF_TOUCHED_ORDER_REJECT",
3336 Self::TakeProfitOrder => "TAKE_PROFIT_ORDER",
3337 Self::TakeProfitOrderReject => "TAKE_PROFIT_ORDER_REJECT",
3338 Self::StopLossOrder => "STOP_LOSS_ORDER",
3339 Self::StopLossOrderReject => "STOP_LOSS_ORDER_REJECT",
3340 Self::GuaranteedStopLossOrder => "GUARANTEED_STOP_LOSS_ORDER",
3341 Self::GuaranteedStopLossOrderReject => "GUARANTEED_STOP_LOSS_ORDER_REJECT",
3342 Self::TrailingStopLossOrder => "TRAILING_STOP_LOSS_ORDER",
3343 Self::TrailingStopLossOrderReject => "TRAILING_STOP_LOSS_ORDER_REJECT",
3344 Self::OrderFill => "ORDER_FILL",
3345 Self::OrderCancel => "ORDER_CANCEL",
3346 Self::OrderCancelReject => "ORDER_CANCEL_REJECT",
3347 Self::OrderClientExtensionsModify => "ORDER_CLIENT_EXTENSIONS_MODIFY",
3348 Self::OrderClientExtensionsModifyReject => "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT",
3349 Self::TradeClientExtensionsModify => "TRADE_CLIENT_EXTENSIONS_MODIFY",
3350 Self::TradeClientExtensionsModifyReject => "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT",
3351 Self::MarginCallEnter => "MARGIN_CALL_ENTER",
3352 Self::MarginCallExtend => "MARGIN_CALL_EXTEND",
3353 Self::MarginCallExit => "MARGIN_CALL_EXIT",
3354 Self::DelayedTradeClosure => "DELAYED_TRADE_CLOSURE",
3355 Self::DailyFinancing => "DAILY_FINANCING",
3356 Self::DividendAdjustment => "DIVIDEND_ADJUSTMENT",
3357 Self::ResetResettablePl => "RESET_RESETTABLE_PL",
3358 Self::Unknown(value) => value,
3359 }
3360 }
3361}
3362
3363impl Serialize for TransactionType {
3364 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3365 serializer.serialize_str(self.as_str())
3366 }
3367}
3368
3369impl<'de> Deserialize<'de> for TransactionType {
3370 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3371 let value = String::deserialize(deserializer)?;
3372 Ok(match value.as_str() {
3373 "CREATE" => Self::Create,
3374 "CLOSE" => Self::Close,
3375 "REOPEN" => Self::Reopen,
3376 "CLIENT_CONFIGURE" => Self::ClientConfigure,
3377 "CLIENT_CONFIGURE_REJECT" => Self::ClientConfigureReject,
3378 "TRANSFER_FUNDS" => Self::TransferFunds,
3379 "TRANSFER_FUNDS_REJECT" => Self::TransferFundsReject,
3380 "MARKET_ORDER" => Self::MarketOrder,
3381 "MARKET_ORDER_REJECT" => Self::MarketOrderReject,
3382 "FIXED_PRICE_ORDER" => Self::FixedPriceOrder,
3383 "LIMIT_ORDER" => Self::LimitOrder,
3384 "LIMIT_ORDER_REJECT" => Self::LimitOrderReject,
3385 "STOP_ORDER" => Self::StopOrder,
3386 "STOP_ORDER_REJECT" => Self::StopOrderReject,
3387 "MARKET_IF_TOUCHED_ORDER" => Self::MarketIfTouchedOrder,
3388 "MARKET_IF_TOUCHED_ORDER_REJECT" => Self::MarketIfTouchedOrderReject,
3389 "TAKE_PROFIT_ORDER" => Self::TakeProfitOrder,
3390 "TAKE_PROFIT_ORDER_REJECT" => Self::TakeProfitOrderReject,
3391 "STOP_LOSS_ORDER" => Self::StopLossOrder,
3392 "STOP_LOSS_ORDER_REJECT" => Self::StopLossOrderReject,
3393 "GUARANTEED_STOP_LOSS_ORDER" => Self::GuaranteedStopLossOrder,
3394 "GUARANTEED_STOP_LOSS_ORDER_REJECT" => Self::GuaranteedStopLossOrderReject,
3395 "TRAILING_STOP_LOSS_ORDER" => Self::TrailingStopLossOrder,
3396 "TRAILING_STOP_LOSS_ORDER_REJECT" => Self::TrailingStopLossOrderReject,
3397 "ORDER_FILL" => Self::OrderFill,
3398 "ORDER_CANCEL" => Self::OrderCancel,
3399 "ORDER_CANCEL_REJECT" => Self::OrderCancelReject,
3400 "ORDER_CLIENT_EXTENSIONS_MODIFY" => Self::OrderClientExtensionsModify,
3401 "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT" => Self::OrderClientExtensionsModifyReject,
3402 "TRADE_CLIENT_EXTENSIONS_MODIFY" => Self::TradeClientExtensionsModify,
3403 "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT" => Self::TradeClientExtensionsModifyReject,
3404 "MARGIN_CALL_ENTER" => Self::MarginCallEnter,
3405 "MARGIN_CALL_EXTEND" => Self::MarginCallExtend,
3406 "MARGIN_CALL_EXIT" => Self::MarginCallExit,
3407 "DELAYED_TRADE_CLOSURE" => Self::DelayedTradeClosure,
3408 "DAILY_FINANCING" => Self::DailyFinancing,
3409 "DIVIDEND_ADJUSTMENT" => Self::DividendAdjustment,
3410 "RESET_RESETTABLE_PL" => Self::ResetResettablePl,
3411 _ => Self::Unknown(value),
3412 })
3413 }
3414}
3415
3416#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3418#[non_exhaustive]
3419pub enum FundingReason {
3420 ClientFunding,
3422 AccountTransfer,
3424 DivisionMigration,
3426 SiteMigration,
3428 Adjustment,
3430 Unknown(String),
3432}
3433
3434impl FundingReason {
3435 pub fn as_str(&self) -> &str {
3437 match self {
3438 Self::ClientFunding => "CLIENT_FUNDING",
3439 Self::AccountTransfer => "ACCOUNT_TRANSFER",
3440 Self::DivisionMigration => "DIVISION_MIGRATION",
3441 Self::SiteMigration => "SITE_MIGRATION",
3442 Self::Adjustment => "ADJUSTMENT",
3443 Self::Unknown(value) => value,
3444 }
3445 }
3446}
3447
3448impl Serialize for FundingReason {
3449 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3450 serializer.serialize_str(self.as_str())
3451 }
3452}
3453
3454impl<'de> Deserialize<'de> for FundingReason {
3455 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3456 let value = String::deserialize(deserializer)?;
3457 Ok(match value.as_str() {
3458 "CLIENT_FUNDING" => Self::ClientFunding,
3459 "ACCOUNT_TRANSFER" => Self::AccountTransfer,
3460 "DIVISION_MIGRATION" => Self::DivisionMigration,
3461 "SITE_MIGRATION" => Self::SiteMigration,
3462 "ADJUSTMENT" => Self::Adjustment,
3463 _ => Self::Unknown(value),
3464 })
3465 }
3466}
3467
3468#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3470#[non_exhaustive]
3471pub enum MarketOrderReason {
3472 ClientOrder,
3474 TradeClose,
3476 PositionCloseout,
3478 MarginCloseout,
3480 DelayedTradeClose,
3482 Unknown(String),
3484}
3485
3486impl MarketOrderReason {
3487 pub fn as_str(&self) -> &str {
3489 match self {
3490 Self::ClientOrder => "CLIENT_ORDER",
3491 Self::TradeClose => "TRADE_CLOSE",
3492 Self::PositionCloseout => "POSITION_CLOSEOUT",
3493 Self::MarginCloseout => "MARGIN_CLOSEOUT",
3494 Self::DelayedTradeClose => "DELAYED_TRADE_CLOSE",
3495 Self::Unknown(value) => value,
3496 }
3497 }
3498}
3499
3500impl Serialize for MarketOrderReason {
3501 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3502 serializer.serialize_str(self.as_str())
3503 }
3504}
3505
3506impl<'de> Deserialize<'de> for MarketOrderReason {
3507 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3508 let value = String::deserialize(deserializer)?;
3509 Ok(match value.as_str() {
3510 "CLIENT_ORDER" => Self::ClientOrder,
3511 "TRADE_CLOSE" => Self::TradeClose,
3512 "POSITION_CLOSEOUT" => Self::PositionCloseout,
3513 "MARGIN_CLOSEOUT" => Self::MarginCloseout,
3514 "DELAYED_TRADE_CLOSE" => Self::DelayedTradeClose,
3515 _ => Self::Unknown(value),
3516 })
3517 }
3518}
3519
3520#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3522#[non_exhaustive]
3523pub enum FixedPriceOrderReason {
3524 PlatformAccountMigration,
3526 TradeCloseDivisionAccountMigration,
3528 TradeCloseAdministrativeAction,
3530 Unknown(String),
3532}
3533
3534impl FixedPriceOrderReason {
3535 pub fn as_str(&self) -> &str {
3537 match self {
3538 Self::PlatformAccountMigration => "PLATFORM_ACCOUNT_MIGRATION",
3539 Self::TradeCloseDivisionAccountMigration => "TRADE_CLOSE_DIVISION_ACCOUNT_MIGRATION",
3540 Self::TradeCloseAdministrativeAction => "TRADE_CLOSE_ADMINISTRATIVE_ACTION",
3541 Self::Unknown(value) => value,
3542 }
3543 }
3544}
3545
3546impl Serialize for FixedPriceOrderReason {
3547 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3548 serializer.serialize_str(self.as_str())
3549 }
3550}
3551
3552impl<'de> Deserialize<'de> for FixedPriceOrderReason {
3553 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3554 let value = String::deserialize(deserializer)?;
3555 Ok(match value.as_str() {
3556 "PLATFORM_ACCOUNT_MIGRATION" => Self::PlatformAccountMigration,
3557 "TRADE_CLOSE_DIVISION_ACCOUNT_MIGRATION" => Self::TradeCloseDivisionAccountMigration,
3558 "TRADE_CLOSE_ADMINISTRATIVE_ACTION" => Self::TradeCloseAdministrativeAction,
3559 _ => Self::Unknown(value),
3560 })
3561 }
3562}
3563
3564#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3566#[non_exhaustive]
3567pub enum LimitOrderReason {
3568 ClientOrder,
3570 Replacement,
3572 Unknown(String),
3574}
3575
3576impl LimitOrderReason {
3577 pub fn as_str(&self) -> &str {
3579 match self {
3580 Self::ClientOrder => "CLIENT_ORDER",
3581 Self::Replacement => "REPLACEMENT",
3582 Self::Unknown(value) => value,
3583 }
3584 }
3585}
3586
3587impl Serialize for LimitOrderReason {
3588 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3589 serializer.serialize_str(self.as_str())
3590 }
3591}
3592
3593impl<'de> Deserialize<'de> for LimitOrderReason {
3594 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3595 let value = String::deserialize(deserializer)?;
3596 Ok(match value.as_str() {
3597 "CLIENT_ORDER" => Self::ClientOrder,
3598 "REPLACEMENT" => Self::Replacement,
3599 _ => Self::Unknown(value),
3600 })
3601 }
3602}
3603
3604#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3606#[non_exhaustive]
3607pub enum StopOrderReason {
3608 ClientOrder,
3610 Replacement,
3612 Unknown(String),
3614}
3615
3616impl StopOrderReason {
3617 pub fn as_str(&self) -> &str {
3619 match self {
3620 Self::ClientOrder => "CLIENT_ORDER",
3621 Self::Replacement => "REPLACEMENT",
3622 Self::Unknown(value) => value,
3623 }
3624 }
3625}
3626
3627impl Serialize for StopOrderReason {
3628 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3629 serializer.serialize_str(self.as_str())
3630 }
3631}
3632
3633impl<'de> Deserialize<'de> for StopOrderReason {
3634 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3635 let value = String::deserialize(deserializer)?;
3636 Ok(match value.as_str() {
3637 "CLIENT_ORDER" => Self::ClientOrder,
3638 "REPLACEMENT" => Self::Replacement,
3639 _ => Self::Unknown(value),
3640 })
3641 }
3642}
3643
3644#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3646#[non_exhaustive]
3647pub enum MarketIfTouchedOrderReason {
3648 ClientOrder,
3650 Replacement,
3652 Unknown(String),
3654}
3655
3656impl MarketIfTouchedOrderReason {
3657 pub fn as_str(&self) -> &str {
3659 match self {
3660 Self::ClientOrder => "CLIENT_ORDER",
3661 Self::Replacement => "REPLACEMENT",
3662 Self::Unknown(value) => value,
3663 }
3664 }
3665}
3666
3667impl Serialize for MarketIfTouchedOrderReason {
3668 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3669 serializer.serialize_str(self.as_str())
3670 }
3671}
3672
3673impl<'de> Deserialize<'de> for MarketIfTouchedOrderReason {
3674 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3675 let value = String::deserialize(deserializer)?;
3676 Ok(match value.as_str() {
3677 "CLIENT_ORDER" => Self::ClientOrder,
3678 "REPLACEMENT" => Self::Replacement,
3679 _ => Self::Unknown(value),
3680 })
3681 }
3682}
3683
3684#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3686#[non_exhaustive]
3687pub enum TakeProfitOrderReason {
3688 ClientOrder,
3690 Replacement,
3692 OnFill,
3695 Unknown(String),
3697}
3698
3699impl TakeProfitOrderReason {
3700 pub fn as_str(&self) -> &str {
3702 match self {
3703 Self::ClientOrder => "CLIENT_ORDER",
3704 Self::Replacement => "REPLACEMENT",
3705 Self::OnFill => "ON_FILL",
3706 Self::Unknown(value) => value,
3707 }
3708 }
3709}
3710
3711impl Serialize for TakeProfitOrderReason {
3712 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3713 serializer.serialize_str(self.as_str())
3714 }
3715}
3716
3717impl<'de> Deserialize<'de> for TakeProfitOrderReason {
3718 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3719 let value = String::deserialize(deserializer)?;
3720 Ok(match value.as_str() {
3721 "CLIENT_ORDER" => Self::ClientOrder,
3722 "REPLACEMENT" => Self::Replacement,
3723 "ON_FILL" => Self::OnFill,
3724 _ => Self::Unknown(value),
3725 })
3726 }
3727}
3728
3729#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3731#[non_exhaustive]
3732pub enum StopLossOrderReason {
3733 ClientOrder,
3735 Replacement,
3737 OnFill,
3740 Unknown(String),
3742}
3743
3744impl StopLossOrderReason {
3745 pub fn as_str(&self) -> &str {
3747 match self {
3748 Self::ClientOrder => "CLIENT_ORDER",
3749 Self::Replacement => "REPLACEMENT",
3750 Self::OnFill => "ON_FILL",
3751 Self::Unknown(value) => value,
3752 }
3753 }
3754}
3755
3756impl Serialize for StopLossOrderReason {
3757 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3758 serializer.serialize_str(self.as_str())
3759 }
3760}
3761
3762impl<'de> Deserialize<'de> for StopLossOrderReason {
3763 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3764 let value = String::deserialize(deserializer)?;
3765 Ok(match value.as_str() {
3766 "CLIENT_ORDER" => Self::ClientOrder,
3767 "REPLACEMENT" => Self::Replacement,
3768 "ON_FILL" => Self::OnFill,
3769 _ => Self::Unknown(value),
3770 })
3771 }
3772}
3773
3774#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3776#[non_exhaustive]
3777pub enum GuaranteedStopLossOrderReason {
3778 ClientOrder,
3780 Replacement,
3782 OnFill,
3785 Unknown(String),
3787}
3788
3789impl GuaranteedStopLossOrderReason {
3790 pub fn as_str(&self) -> &str {
3792 match self {
3793 Self::ClientOrder => "CLIENT_ORDER",
3794 Self::Replacement => "REPLACEMENT",
3795 Self::OnFill => "ON_FILL",
3796 Self::Unknown(value) => value,
3797 }
3798 }
3799}
3800
3801impl Serialize for GuaranteedStopLossOrderReason {
3802 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3803 serializer.serialize_str(self.as_str())
3804 }
3805}
3806
3807impl<'de> Deserialize<'de> for GuaranteedStopLossOrderReason {
3808 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3809 let value = String::deserialize(deserializer)?;
3810 Ok(match value.as_str() {
3811 "CLIENT_ORDER" => Self::ClientOrder,
3812 "REPLACEMENT" => Self::Replacement,
3813 "ON_FILL" => Self::OnFill,
3814 _ => Self::Unknown(value),
3815 })
3816 }
3817}
3818
3819#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3821#[non_exhaustive]
3822pub enum TrailingStopLossOrderReason {
3823 ClientOrder,
3825 Replacement,
3827 OnFill,
3830 Unknown(String),
3832}
3833
3834impl TrailingStopLossOrderReason {
3835 pub fn as_str(&self) -> &str {
3837 match self {
3838 Self::ClientOrder => "CLIENT_ORDER",
3839 Self::Replacement => "REPLACEMENT",
3840 Self::OnFill => "ON_FILL",
3841 Self::Unknown(value) => value,
3842 }
3843 }
3844}
3845
3846impl Serialize for TrailingStopLossOrderReason {
3847 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3848 serializer.serialize_str(self.as_str())
3849 }
3850}
3851
3852impl<'de> Deserialize<'de> for TrailingStopLossOrderReason {
3853 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3854 let value = String::deserialize(deserializer)?;
3855 Ok(match value.as_str() {
3856 "CLIENT_ORDER" => Self::ClientOrder,
3857 "REPLACEMENT" => Self::Replacement,
3858 "ON_FILL" => Self::OnFill,
3859 _ => Self::Unknown(value),
3860 })
3861 }
3862}
3863
3864#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3866#[non_exhaustive]
3867pub enum OrderFillReason {
3868 LimitOrder,
3870 StopOrder,
3872 MarketIfTouchedOrder,
3874 TakeProfitOrder,
3876 StopLossOrder,
3878 GuaranteedStopLossOrder,
3880 TrailingStopLossOrder,
3882 MarketOrder,
3884 MarketOrderTradeClose,
3886 MarketOrderPositionCloseout,
3888 MarketOrderMarginCloseout,
3890 MarketOrderDelayedTradeClose,
3892 FixedPriceOrder,
3894 FixedPriceOrderPlatformAccountMigration,
3896 FixedPriceOrderDivisionAccountMigration,
3898 FixedPriceOrderAdministrativeAction,
3900 Unknown(String),
3902}
3903
3904impl OrderFillReason {
3905 pub fn as_str(&self) -> &str {
3907 match self {
3908 Self::LimitOrder => "LIMIT_ORDER",
3909 Self::StopOrder => "STOP_ORDER",
3910 Self::MarketIfTouchedOrder => "MARKET_IF_TOUCHED_ORDER",
3911 Self::TakeProfitOrder => "TAKE_PROFIT_ORDER",
3912 Self::StopLossOrder => "STOP_LOSS_ORDER",
3913 Self::GuaranteedStopLossOrder => "GUARANTEED_STOP_LOSS_ORDER",
3914 Self::TrailingStopLossOrder => "TRAILING_STOP_LOSS_ORDER",
3915 Self::MarketOrder => "MARKET_ORDER",
3916 Self::MarketOrderTradeClose => "MARKET_ORDER_TRADE_CLOSE",
3917 Self::MarketOrderPositionCloseout => "MARKET_ORDER_POSITION_CLOSEOUT",
3918 Self::MarketOrderMarginCloseout => "MARKET_ORDER_MARGIN_CLOSEOUT",
3919 Self::MarketOrderDelayedTradeClose => "MARKET_ORDER_DELAYED_TRADE_CLOSE",
3920 Self::FixedPriceOrder => "FIXED_PRICE_ORDER",
3921 Self::FixedPriceOrderPlatformAccountMigration => {
3922 "FIXED_PRICE_ORDER_PLATFORM_ACCOUNT_MIGRATION"
3923 }
3924 Self::FixedPriceOrderDivisionAccountMigration => {
3925 "FIXED_PRICE_ORDER_DIVISION_ACCOUNT_MIGRATION"
3926 }
3927 Self::FixedPriceOrderAdministrativeAction => "FIXED_PRICE_ORDER_ADMINISTRATIVE_ACTION",
3928 Self::Unknown(value) => value,
3929 }
3930 }
3931}
3932
3933impl Serialize for OrderFillReason {
3934 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3935 serializer.serialize_str(self.as_str())
3936 }
3937}
3938
3939impl<'de> Deserialize<'de> for OrderFillReason {
3940 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3941 let value = String::deserialize(deserializer)?;
3942 Ok(match value.as_str() {
3943 "LIMIT_ORDER" => Self::LimitOrder,
3944 "STOP_ORDER" => Self::StopOrder,
3945 "MARKET_IF_TOUCHED_ORDER" => Self::MarketIfTouchedOrder,
3946 "TAKE_PROFIT_ORDER" => Self::TakeProfitOrder,
3947 "STOP_LOSS_ORDER" => Self::StopLossOrder,
3948 "GUARANTEED_STOP_LOSS_ORDER" => Self::GuaranteedStopLossOrder,
3949 "TRAILING_STOP_LOSS_ORDER" => Self::TrailingStopLossOrder,
3950 "MARKET_ORDER" => Self::MarketOrder,
3951 "MARKET_ORDER_TRADE_CLOSE" => Self::MarketOrderTradeClose,
3952 "MARKET_ORDER_POSITION_CLOSEOUT" => Self::MarketOrderPositionCloseout,
3953 "MARKET_ORDER_MARGIN_CLOSEOUT" => Self::MarketOrderMarginCloseout,
3954 "MARKET_ORDER_DELAYED_TRADE_CLOSE" => Self::MarketOrderDelayedTradeClose,
3955 "FIXED_PRICE_ORDER" => Self::FixedPriceOrder,
3956 "FIXED_PRICE_ORDER_PLATFORM_ACCOUNT_MIGRATION" => {
3957 Self::FixedPriceOrderPlatformAccountMigration
3958 }
3959 "FIXED_PRICE_ORDER_DIVISION_ACCOUNT_MIGRATION" => {
3960 Self::FixedPriceOrderDivisionAccountMigration
3961 }
3962 "FIXED_PRICE_ORDER_ADMINISTRATIVE_ACTION" => Self::FixedPriceOrderAdministrativeAction,
3963 _ => Self::Unknown(value),
3964 })
3965 }
3966}
3967
3968#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3970#[non_exhaustive]
3971pub enum OrderCancelReason {
3972 InternalServerError,
3974 AccountLocked,
3976 AccountNewPositionsLocked,
3978 AccountOrderCreationLocked,
3981 AccountOrderFillLocked,
3983 ClientRequest,
3985 Migration,
3987 MarketHalted,
3989 LinkedTradeClosed,
3991 TimeInForceExpired,
3993 InsufficientMargin,
3995 FifoViolation,
3997 BoundsViolation,
3999 ClientRequestReplaced,
4001 DividendAdjustmentReplaced,
4004 InsufficientLiquidity,
4006 TakeProfitOnFillGtdTimestampInPast,
4008 TakeProfitOnFillLoss,
4011 LosingTakeProfit,
4014 StopLossOnFillGtdTimestampInPast,
4016 StopLossOnFillLoss,
4019 StopLossOnFillPriceDistanceMaximumExceeded,
4022 StopLossOnFillRequired,
4025 StopLossOnFillGuaranteedRequired,
4028 StopLossOnFillGuaranteedNotAllowed,
4031 StopLossOnFillGuaranteedMinimumDistanceNotMet,
4034 StopLossOnFillGuaranteedLevelRestrictionExceeded,
4037 StopLossOnFillGuaranteedHedgingNotAllowed,
4041 StopLossOnFillTimeInForceInvalid,
4045 StopLossOnFillTriggerConditionInvalid,
4049 GuaranteedStopLossOnFillGtdTimestampInPast,
4052 GuaranteedStopLossOnFillLoss,
4055 GuaranteedStopLossOnFillPriceDistanceMaximumExceeded,
4058 GuaranteedStopLossOnFillRequired,
4061 GuaranteedStopLossOnFillNotAllowed,
4064 GuaranteedStopLossOnFillMinimumDistanceNotMet,
4067 GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded,
4070 GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded,
4073 GuaranteedStopLossOnFillHedgingNotAllowed,
4077 GuaranteedStopLossOnFillTimeInForceInvalid,
4081 GuaranteedStopLossOnFillTriggerConditionInvalid,
4085 TakeProfitOnFillPriceDistanceMaximumExceeded,
4088 TrailingStopLossOnFillGtdTimestampInPast,
4091 ClientTradeIdAlreadyExists,
4093 PositionCloseoutFailed,
4095 OpenTradesAllowedExceeded,
4097 PendingOrdersAllowedExceeded,
4099 TakeProfitOnFillClientOrderIdAlreadyExists,
4102 StopLossOnFillClientOrderIdAlreadyExists,
4105 GuaranteedStopLossOnFillClientOrderIdAlreadyExists,
4108 TrailingStopLossOnFillClientOrderIdAlreadyExists,
4111 PositionSizeExceeded,
4114 HedgingGsloViolation,
4118 AccountPositionValueLimitExceeded,
4121 InstrumentBidReduceOnly,
4125 InstrumentAskReduceOnly,
4129 InstrumentBidHalted,
4132 InstrumentAskHalted,
4135 StopLossOnFillGuaranteedBidHalted,
4139 StopLossOnFillGuaranteedAskHalted,
4143 GuaranteedStopLossOnFillBidHalted,
4147 GuaranteedStopLossOnFillAskHalted,
4151 FifoViolationSafeguardViolation,
4154 FifoViolationSafeguardPartialCloseViolation,
4157 OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation,
4160 Unknown(String),
4162}
4163
4164impl OrderCancelReason {
4165 pub fn as_str(&self) -> &str {
4167 match self {
4168 Self::InternalServerError => "INTERNAL_SERVER_ERROR",
4169 Self::AccountLocked => "ACCOUNT_LOCKED",
4170 Self::AccountNewPositionsLocked => "ACCOUNT_NEW_POSITIONS_LOCKED",
4171 Self::AccountOrderCreationLocked => "ACCOUNT_ORDER_CREATION_LOCKED",
4172 Self::AccountOrderFillLocked => "ACCOUNT_ORDER_FILL_LOCKED",
4173 Self::ClientRequest => "CLIENT_REQUEST",
4174 Self::Migration => "MIGRATION",
4175 Self::MarketHalted => "MARKET_HALTED",
4176 Self::LinkedTradeClosed => "LINKED_TRADE_CLOSED",
4177 Self::TimeInForceExpired => "TIME_IN_FORCE_EXPIRED",
4178 Self::InsufficientMargin => "INSUFFICIENT_MARGIN",
4179 Self::FifoViolation => "FIFO_VIOLATION",
4180 Self::BoundsViolation => "BOUNDS_VIOLATION",
4181 Self::ClientRequestReplaced => "CLIENT_REQUEST_REPLACED",
4182 Self::DividendAdjustmentReplaced => "DIVIDEND_ADJUSTMENT_REPLACED",
4183 Self::InsufficientLiquidity => "INSUFFICIENT_LIQUIDITY",
4184 Self::TakeProfitOnFillGtdTimestampInPast => "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST",
4185 Self::TakeProfitOnFillLoss => "TAKE_PROFIT_ON_FILL_LOSS",
4186 Self::LosingTakeProfit => "LOSING_TAKE_PROFIT",
4187 Self::StopLossOnFillGtdTimestampInPast => "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST",
4188 Self::StopLossOnFillLoss => "STOP_LOSS_ON_FILL_LOSS",
4189 Self::StopLossOnFillPriceDistanceMaximumExceeded => {
4190 "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
4191 }
4192 Self::StopLossOnFillRequired => "STOP_LOSS_ON_FILL_REQUIRED",
4193 Self::StopLossOnFillGuaranteedRequired => "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED",
4194 Self::StopLossOnFillGuaranteedNotAllowed => "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED",
4195 Self::StopLossOnFillGuaranteedMinimumDistanceNotMet => {
4196 "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"
4197 }
4198 Self::StopLossOnFillGuaranteedLevelRestrictionExceeded => {
4199 "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"
4200 }
4201 Self::StopLossOnFillGuaranteedHedgingNotAllowed => {
4202 "STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED"
4203 }
4204 Self::StopLossOnFillTimeInForceInvalid => "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID",
4205 Self::StopLossOnFillTriggerConditionInvalid => {
4206 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
4207 }
4208 Self::GuaranteedStopLossOnFillGtdTimestampInPast => {
4209 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"
4210 }
4211 Self::GuaranteedStopLossOnFillLoss => "GUARANTEED_STOP_LOSS_ON_FILL_LOSS",
4212 Self::GuaranteedStopLossOnFillPriceDistanceMaximumExceeded => {
4213 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
4214 }
4215 Self::GuaranteedStopLossOnFillRequired => "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED",
4216 Self::GuaranteedStopLossOnFillNotAllowed => "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED",
4217 Self::GuaranteedStopLossOnFillMinimumDistanceNotMet => {
4218 "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET"
4219 }
4220 Self::GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded => {
4221 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED"
4222 }
4223 Self::GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded => {
4224 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED"
4225 }
4226 Self::GuaranteedStopLossOnFillHedgingNotAllowed => {
4227 "GUARANTEED_STOP_LOSS_ON_FILL_HEDGING_NOT_ALLOWED"
4228 }
4229 Self::GuaranteedStopLossOnFillTimeInForceInvalid => {
4230 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"
4231 }
4232 Self::GuaranteedStopLossOnFillTriggerConditionInvalid => {
4233 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
4234 }
4235 Self::TakeProfitOnFillPriceDistanceMaximumExceeded => {
4236 "TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
4237 }
4238 Self::TrailingStopLossOnFillGtdTimestampInPast => {
4239 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"
4240 }
4241 Self::ClientTradeIdAlreadyExists => "CLIENT_TRADE_ID_ALREADY_EXISTS",
4242 Self::PositionCloseoutFailed => "POSITION_CLOSEOUT_FAILED",
4243 Self::OpenTradesAllowedExceeded => "OPEN_TRADES_ALLOWED_EXCEEDED",
4244 Self::PendingOrdersAllowedExceeded => "PENDING_ORDERS_ALLOWED_EXCEEDED",
4245 Self::TakeProfitOnFillClientOrderIdAlreadyExists => {
4246 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"
4247 }
4248 Self::StopLossOnFillClientOrderIdAlreadyExists => {
4249 "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"
4250 }
4251 Self::GuaranteedStopLossOnFillClientOrderIdAlreadyExists => {
4252 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"
4253 }
4254 Self::TrailingStopLossOnFillClientOrderIdAlreadyExists => {
4255 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"
4256 }
4257 Self::PositionSizeExceeded => "POSITION_SIZE_EXCEEDED",
4258 Self::HedgingGsloViolation => "HEDGING_GSLO_VIOLATION",
4259 Self::AccountPositionValueLimitExceeded => "ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED",
4260 Self::InstrumentBidReduceOnly => "INSTRUMENT_BID_REDUCE_ONLY",
4261 Self::InstrumentAskReduceOnly => "INSTRUMENT_ASK_REDUCE_ONLY",
4262 Self::InstrumentBidHalted => "INSTRUMENT_BID_HALTED",
4263 Self::InstrumentAskHalted => "INSTRUMENT_ASK_HALTED",
4264 Self::StopLossOnFillGuaranteedBidHalted => "STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED",
4265 Self::StopLossOnFillGuaranteedAskHalted => "STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED",
4266 Self::GuaranteedStopLossOnFillBidHalted => "GUARANTEED_STOP_LOSS_ON_FILL_BID_HALTED",
4267 Self::GuaranteedStopLossOnFillAskHalted => "GUARANTEED_STOP_LOSS_ON_FILL_ASK_HALTED",
4268 Self::FifoViolationSafeguardViolation => "FIFO_VIOLATION_SAFEGUARD_VIOLATION",
4269 Self::FifoViolationSafeguardPartialCloseViolation => {
4270 "FIFO_VIOLATION_SAFEGUARD_PARTIAL_CLOSE_VIOLATION"
4271 }
4272 Self::OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation => {
4273 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
4274 }
4275 Self::Unknown(value) => value,
4276 }
4277 }
4278}
4279
4280impl Serialize for OrderCancelReason {
4281 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
4282 serializer.serialize_str(self.as_str())
4283 }
4284}
4285
4286impl<'de> Deserialize<'de> for OrderCancelReason {
4287 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4288 let value = String::deserialize(deserializer)?;
4289 Ok(match value.as_str() {
4290 "INTERNAL_SERVER_ERROR" => Self::InternalServerError,
4291 "ACCOUNT_LOCKED" => Self::AccountLocked,
4292 "ACCOUNT_NEW_POSITIONS_LOCKED" => Self::AccountNewPositionsLocked,
4293 "ACCOUNT_ORDER_CREATION_LOCKED" => Self::AccountOrderCreationLocked,
4294 "ACCOUNT_ORDER_FILL_LOCKED" => Self::AccountOrderFillLocked,
4295 "CLIENT_REQUEST" => Self::ClientRequest,
4296 "MIGRATION" => Self::Migration,
4297 "MARKET_HALTED" => Self::MarketHalted,
4298 "LINKED_TRADE_CLOSED" => Self::LinkedTradeClosed,
4299 "TIME_IN_FORCE_EXPIRED" => Self::TimeInForceExpired,
4300 "INSUFFICIENT_MARGIN" => Self::InsufficientMargin,
4301 "FIFO_VIOLATION" => Self::FifoViolation,
4302 "BOUNDS_VIOLATION" => Self::BoundsViolation,
4303 "CLIENT_REQUEST_REPLACED" => Self::ClientRequestReplaced,
4304 "DIVIDEND_ADJUSTMENT_REPLACED" => Self::DividendAdjustmentReplaced,
4305 "INSUFFICIENT_LIQUIDITY" => Self::InsufficientLiquidity,
4306 "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST" => Self::TakeProfitOnFillGtdTimestampInPast,
4307 "TAKE_PROFIT_ON_FILL_LOSS" => Self::TakeProfitOnFillLoss,
4308 "LOSING_TAKE_PROFIT" => Self::LosingTakeProfit,
4309 "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => Self::StopLossOnFillGtdTimestampInPast,
4310 "STOP_LOSS_ON_FILL_LOSS" => Self::StopLossOnFillLoss,
4311 "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
4312 Self::StopLossOnFillPriceDistanceMaximumExceeded
4313 }
4314 "STOP_LOSS_ON_FILL_REQUIRED" => Self::StopLossOnFillRequired,
4315 "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED" => Self::StopLossOnFillGuaranteedRequired,
4316 "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED" => Self::StopLossOnFillGuaranteedNotAllowed,
4317 "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" => {
4318 Self::StopLossOnFillGuaranteedMinimumDistanceNotMet
4319 }
4320 "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" => {
4321 Self::StopLossOnFillGuaranteedLevelRestrictionExceeded
4322 }
4323 "STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED" => {
4324 Self::StopLossOnFillGuaranteedHedgingNotAllowed
4325 }
4326 "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => Self::StopLossOnFillTimeInForceInvalid,
4327 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
4328 Self::StopLossOnFillTriggerConditionInvalid
4329 }
4330 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => {
4331 Self::GuaranteedStopLossOnFillGtdTimestampInPast
4332 }
4333 "GUARANTEED_STOP_LOSS_ON_FILL_LOSS" => Self::GuaranteedStopLossOnFillLoss,
4334 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
4335 Self::GuaranteedStopLossOnFillPriceDistanceMaximumExceeded
4336 }
4337 "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED" => Self::GuaranteedStopLossOnFillRequired,
4338 "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED" => Self::GuaranteedStopLossOnFillNotAllowed,
4339 "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET" => {
4340 Self::GuaranteedStopLossOnFillMinimumDistanceNotMet
4341 }
4342 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED" => {
4343 Self::GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded
4344 }
4345 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" => {
4346 Self::GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded
4347 }
4348 "GUARANTEED_STOP_LOSS_ON_FILL_HEDGING_NOT_ALLOWED" => {
4349 Self::GuaranteedStopLossOnFillHedgingNotAllowed
4350 }
4351 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => {
4352 Self::GuaranteedStopLossOnFillTimeInForceInvalid
4353 }
4354 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
4355 Self::GuaranteedStopLossOnFillTriggerConditionInvalid
4356 }
4357 "TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
4358 Self::TakeProfitOnFillPriceDistanceMaximumExceeded
4359 }
4360 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => {
4361 Self::TrailingStopLossOnFillGtdTimestampInPast
4362 }
4363 "CLIENT_TRADE_ID_ALREADY_EXISTS" => Self::ClientTradeIdAlreadyExists,
4364 "POSITION_CLOSEOUT_FAILED" => Self::PositionCloseoutFailed,
4365 "OPEN_TRADES_ALLOWED_EXCEEDED" => Self::OpenTradesAllowedExceeded,
4366 "PENDING_ORDERS_ALLOWED_EXCEEDED" => Self::PendingOrdersAllowedExceeded,
4367 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" => {
4368 Self::TakeProfitOnFillClientOrderIdAlreadyExists
4369 }
4370 "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" => {
4371 Self::StopLossOnFillClientOrderIdAlreadyExists
4372 }
4373 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" => {
4374 Self::GuaranteedStopLossOnFillClientOrderIdAlreadyExists
4375 }
4376 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" => {
4377 Self::TrailingStopLossOnFillClientOrderIdAlreadyExists
4378 }
4379 "POSITION_SIZE_EXCEEDED" => Self::PositionSizeExceeded,
4380 "HEDGING_GSLO_VIOLATION" => Self::HedgingGsloViolation,
4381 "ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED" => Self::AccountPositionValueLimitExceeded,
4382 "INSTRUMENT_BID_REDUCE_ONLY" => Self::InstrumentBidReduceOnly,
4383 "INSTRUMENT_ASK_REDUCE_ONLY" => Self::InstrumentAskReduceOnly,
4384 "INSTRUMENT_BID_HALTED" => Self::InstrumentBidHalted,
4385 "INSTRUMENT_ASK_HALTED" => Self::InstrumentAskHalted,
4386 "STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED" => Self::StopLossOnFillGuaranteedBidHalted,
4387 "STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED" => Self::StopLossOnFillGuaranteedAskHalted,
4388 "GUARANTEED_STOP_LOSS_ON_FILL_BID_HALTED" => Self::GuaranteedStopLossOnFillBidHalted,
4389 "GUARANTEED_STOP_LOSS_ON_FILL_ASK_HALTED" => Self::GuaranteedStopLossOnFillAskHalted,
4390 "FIFO_VIOLATION_SAFEGUARD_VIOLATION" => Self::FifoViolationSafeguardViolation,
4391 "FIFO_VIOLATION_SAFEGUARD_PARTIAL_CLOSE_VIOLATION" => {
4392 Self::FifoViolationSafeguardPartialCloseViolation
4393 }
4394 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
4395 Self::OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation
4396 }
4397 _ => Self::Unknown(value),
4398 })
4399 }
4400}
4401
4402#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4404#[serde(rename_all = "camelCase")]
4405pub struct OpenTradeDividendAdjustment {
4406 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4408 pub trade_id: Option<TradeID>,
4409 #[serde(
4411 rename = "dividendAdjustment",
4412 default,
4413 skip_serializing_if = "Option::is_none"
4414 )]
4415 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4416 pub dividend_adjustment: Option<Decimal>,
4417 #[serde(
4419 rename = "quoteDividendAdjustment",
4420 default,
4421 skip_serializing_if = "Option::is_none"
4422 )]
4423 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4424 pub quote_dividend_adjustment: Option<Decimal>,
4425}
4426
4427#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4430#[serde(rename_all = "camelCase")]
4431pub struct ClientExtensions {
4432 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
4434 pub id: Option<ClientID>,
4435 #[serde(rename = "tag", default, skip_serializing_if = "Option::is_none")]
4437 pub tag: Option<ClientTag>,
4438 #[serde(rename = "comment", default, skip_serializing_if = "Option::is_none")]
4440 pub comment: Option<ClientComment>,
4441}
4442
4443#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4447#[serde(rename_all = "camelCase")]
4448pub struct TakeProfitDetails {
4449 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4452 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4453 pub price: Option<Decimal>,
4454 #[serde(
4456 rename = "timeInForce",
4457 default,
4458 skip_serializing_if = "Option::is_none"
4459 )]
4460 pub time_in_force: Option<TimeInForce>,
4461 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
4463 pub gtd_time: Option<Timestamp>,
4464 #[serde(
4466 rename = "clientExtensions",
4467 default,
4468 skip_serializing_if = "Option::is_none"
4469 )]
4470 pub client_extensions: Option<ClientExtensions>,
4471}
4472
4473#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4477#[serde(rename_all = "camelCase")]
4478pub struct StopLossDetails {
4479 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4482 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4483 pub price: Option<Decimal>,
4484 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
4487 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4488 pub distance: Option<Decimal>,
4489 #[serde(
4491 rename = "timeInForce",
4492 default,
4493 skip_serializing_if = "Option::is_none"
4494 )]
4495 pub time_in_force: Option<TimeInForce>,
4496 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
4498 pub gtd_time: Option<Timestamp>,
4499 #[serde(
4501 rename = "clientExtensions",
4502 default,
4503 skip_serializing_if = "Option::is_none"
4504 )]
4505 pub client_extensions: Option<ClientExtensions>,
4506 #[serde(
4510 rename = "guaranteed",
4511 default,
4512 skip_serializing_if = "Option::is_none"
4513 )]
4514 pub guaranteed: Option<bool>,
4515}
4516
4517#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4521#[serde(rename_all = "camelCase")]
4522pub struct GuaranteedStopLossDetails {
4523 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4526 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4527 pub price: Option<Decimal>,
4528 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
4531 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4532 pub distance: Option<Decimal>,
4533 #[serde(
4535 rename = "timeInForce",
4536 default,
4537 skip_serializing_if = "Option::is_none"
4538 )]
4539 pub time_in_force: Option<TimeInForce>,
4540 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
4542 pub gtd_time: Option<Timestamp>,
4543 #[serde(
4545 rename = "clientExtensions",
4546 default,
4547 skip_serializing_if = "Option::is_none"
4548 )]
4549 pub client_extensions: Option<ClientExtensions>,
4550}
4551
4552#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4556#[serde(rename_all = "camelCase")]
4557pub struct TrailingStopLossDetails {
4558 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
4561 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4562 pub distance: Option<Decimal>,
4563 #[serde(
4565 rename = "timeInForce",
4566 default,
4567 skip_serializing_if = "Option::is_none"
4568 )]
4569 pub time_in_force: Option<TimeInForce>,
4570 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
4572 pub gtd_time: Option<Timestamp>,
4573 #[serde(
4575 rename = "clientExtensions",
4576 default,
4577 skip_serializing_if = "Option::is_none"
4578 )]
4579 pub client_extensions: Option<ClientExtensions>,
4580}
4581
4582#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4586#[serde(rename_all = "camelCase")]
4587pub struct TradeOpen {
4588 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4590 pub trade_id: Option<TradeID>,
4591 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
4593 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4594 pub units: Option<Decimal>,
4595 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4597 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4598 pub price: Option<Decimal>,
4599 #[serde(
4601 rename = "guaranteedExecutionFee",
4602 default,
4603 skip_serializing_if = "Option::is_none"
4604 )]
4605 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4606 pub guaranteed_execution_fee: Option<Decimal>,
4607 #[serde(
4610 rename = "quoteGuaranteedExecutionFee",
4611 default,
4612 skip_serializing_if = "Option::is_none"
4613 )]
4614 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4615 pub quote_guaranteed_execution_fee: Option<Decimal>,
4616 #[serde(
4618 rename = "clientExtensions",
4619 default,
4620 skip_serializing_if = "Option::is_none"
4621 )]
4622 pub client_extensions: Option<ClientExtensions>,
4623 #[serde(
4626 rename = "halfSpreadCost",
4627 default,
4628 skip_serializing_if = "Option::is_none"
4629 )]
4630 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4631 pub half_spread_cost: Option<Decimal>,
4632 #[serde(
4635 rename = "initialMarginRequired",
4636 default,
4637 skip_serializing_if = "Option::is_none"
4638 )]
4639 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4640 pub initial_margin_required: Option<Decimal>,
4641 #[serde(
4649 rename = "guaranteedExecutionFeeHomeConversionCost",
4650 default,
4651 skip_serializing_if = "Option::is_none"
4652 )]
4653 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4654 pub guaranteed_execution_fee_home_conversion_cost: Option<Decimal>,
4655}
4656
4657#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4661#[serde(rename_all = "camelCase")]
4662pub struct TradeReduce {
4663 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4665 pub trade_id: Option<TradeID>,
4666 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
4668 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4669 pub units: Option<Decimal>,
4670 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4673 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4674 pub price: Option<Decimal>,
4675 #[serde(
4677 rename = "realizedPL",
4678 default,
4679 skip_serializing_if = "Option::is_none"
4680 )]
4681 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4682 pub realized_pl: Option<Decimal>,
4683 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
4685 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4686 pub financing: Option<Decimal>,
4687 #[serde(
4689 rename = "baseFinancing",
4690 default,
4691 skip_serializing_if = "Option::is_none"
4692 )]
4693 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4694 pub base_financing: Option<Decimal>,
4695 #[serde(
4697 rename = "quoteFinancing",
4698 default,
4699 skip_serializing_if = "Option::is_none"
4700 )]
4701 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4702 pub quote_financing: Option<Decimal>,
4703 #[serde(
4708 rename = "financingRate",
4709 default,
4710 skip_serializing_if = "Option::is_none"
4711 )]
4712 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4713 pub financing_rate: Option<Decimal>,
4714 #[serde(
4717 rename = "guaranteedExecutionFee",
4718 default,
4719 skip_serializing_if = "Option::is_none"
4720 )]
4721 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4722 pub guaranteed_execution_fee: Option<Decimal>,
4723 #[serde(
4726 rename = "quoteGuaranteedExecutionFee",
4727 default,
4728 skip_serializing_if = "Option::is_none"
4729 )]
4730 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4731 pub quote_guaranteed_execution_fee: Option<Decimal>,
4732 #[serde(
4735 rename = "halfSpreadCost",
4736 default,
4737 skip_serializing_if = "Option::is_none"
4738 )]
4739 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4740 pub half_spread_cost: Option<Decimal>,
4741 #[serde(
4748 rename = "plHomeConversionCost",
4749 default,
4750 skip_serializing_if = "Option::is_none"
4751 )]
4752 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4753 pub pl_home_conversion_cost: Option<Decimal>,
4754 #[serde(
4759 rename = "baseFinancingHomeConversionCost",
4760 default,
4761 skip_serializing_if = "Option::is_none"
4762 )]
4763 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4764 pub base_financing_home_conversion_cost: Option<Decimal>,
4765 #[serde(
4770 rename = "guaranteedExecutionFeeHomeConversionCost",
4771 default,
4772 skip_serializing_if = "Option::is_none"
4773 )]
4774 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4775 pub guaranteed_execution_fee_home_conversion_cost: Option<Decimal>,
4776 #[serde(
4781 rename = "homeConversionCost",
4782 default,
4783 skip_serializing_if = "Option::is_none"
4784 )]
4785 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4786 pub home_conversion_cost: Option<Decimal>,
4787}
4788
4789#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4792#[serde(rename_all = "camelCase")]
4793pub struct MarketOrderTradeClose {
4794 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4796 pub trade_id: Option<TradeID>,
4797 #[serde(
4799 rename = "clientTradeID",
4800 default,
4801 skip_serializing_if = "Option::is_none"
4802 )]
4803 pub client_trade_id: Option<String>,
4804 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
4807 pub units: Option<String>,
4808}
4809
4810#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4813#[serde(rename_all = "camelCase")]
4814pub struct MarketOrderMarginCloseout {
4815 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
4817 pub reason: Option<MarketOrderMarginCloseoutReason>,
4818}
4819
4820#[derive(Debug, Clone, PartialEq, Eq, Hash)]
4822#[non_exhaustive]
4823pub enum MarketOrderMarginCloseoutReason {
4824 MarginCheckViolation,
4826 RegulatoryMarginCallViolation,
4829 RegulatoryMarginCheckViolation,
4831 Unknown(String),
4833}
4834
4835impl MarketOrderMarginCloseoutReason {
4836 pub fn as_str(&self) -> &str {
4838 match self {
4839 Self::MarginCheckViolation => "MARGIN_CHECK_VIOLATION",
4840 Self::RegulatoryMarginCallViolation => "REGULATORY_MARGIN_CALL_VIOLATION",
4841 Self::RegulatoryMarginCheckViolation => "REGULATORY_MARGIN_CHECK_VIOLATION",
4842 Self::Unknown(value) => value,
4843 }
4844 }
4845}
4846
4847impl Serialize for MarketOrderMarginCloseoutReason {
4848 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
4849 serializer.serialize_str(self.as_str())
4850 }
4851}
4852
4853impl<'de> Deserialize<'de> for MarketOrderMarginCloseoutReason {
4854 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4855 let value = String::deserialize(deserializer)?;
4856 Ok(match value.as_str() {
4857 "MARGIN_CHECK_VIOLATION" => Self::MarginCheckViolation,
4858 "REGULATORY_MARGIN_CALL_VIOLATION" => Self::RegulatoryMarginCallViolation,
4859 "REGULATORY_MARGIN_CHECK_VIOLATION" => Self::RegulatoryMarginCheckViolation,
4860 _ => Self::Unknown(value),
4861 })
4862 }
4863}
4864
4865#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4869#[serde(rename_all = "camelCase")]
4870pub struct MarketOrderDelayedTradeClose {
4871 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4873 pub trade_id: Option<TradeID>,
4874 #[serde(
4876 rename = "clientTradeID",
4877 default,
4878 skip_serializing_if = "Option::is_none"
4879 )]
4880 pub client_trade_id: Option<TradeID>,
4881 #[serde(
4883 rename = "sourceTransactionID",
4884 default,
4885 skip_serializing_if = "Option::is_none"
4886 )]
4887 pub source_transaction_id: Option<TransactionID>,
4888}
4889
4890#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4893#[serde(rename_all = "camelCase")]
4894pub struct MarketOrderPositionCloseout {
4895 #[serde(
4897 rename = "instrument",
4898 default,
4899 skip_serializing_if = "Option::is_none"
4900 )]
4901 pub instrument: Option<InstrumentName>,
4902 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
4906 pub units: Option<String>,
4907}
4908
4909#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4914#[serde(rename_all = "camelCase")]
4915pub struct LiquidityRegenerationSchedule {
4916 #[serde(rename = "steps", default, skip_serializing_if = "Option::is_none")]
4918 pub steps: Option<Vec<LiquidityRegenerationScheduleStep>>,
4919}
4920
4921#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4924#[serde(rename_all = "camelCase")]
4925pub struct LiquidityRegenerationScheduleStep {
4926 #[serde(rename = "timestamp", default, skip_serializing_if = "Option::is_none")]
4928 pub timestamp: Option<Timestamp>,
4929 #[serde(
4931 rename = "bidLiquidityUsed",
4932 default,
4933 skip_serializing_if = "Option::is_none"
4934 )]
4935 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4936 pub bid_liquidity_used: Option<Decimal>,
4937 #[serde(
4939 rename = "askLiquidityUsed",
4940 default,
4941 skip_serializing_if = "Option::is_none"
4942 )]
4943 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4944 pub ask_liquidity_used: Option<Decimal>,
4945}
4946
4947#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4949#[serde(rename_all = "camelCase")]
4950pub struct OpenTradeFinancing {
4951 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4953 pub trade_id: Option<TradeID>,
4954 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
4956 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4957 pub financing: Option<Decimal>,
4958 #[serde(
4960 rename = "baseFinancing",
4961 default,
4962 skip_serializing_if = "Option::is_none"
4963 )]
4964 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4965 pub base_financing: Option<Decimal>,
4966 #[serde(
4968 rename = "quoteFinancing",
4969 default,
4970 skip_serializing_if = "Option::is_none"
4971 )]
4972 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4973 pub quote_financing: Option<Decimal>,
4974 #[serde(
4979 rename = "financingRate",
4980 default,
4981 skip_serializing_if = "Option::is_none"
4982 )]
4983 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4984 pub financing_rate: Option<Decimal>,
4985}
4986
4987#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4989#[serde(rename_all = "camelCase")]
4990pub struct PositionFinancing {
4991 #[serde(
4993 rename = "instrument",
4994 default,
4995 skip_serializing_if = "Option::is_none"
4996 )]
4997 pub instrument: Option<InstrumentName>,
4998 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
5000 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
5001 pub financing: Option<Decimal>,
5002 #[serde(
5004 rename = "baseFinancing",
5005 default,
5006 skip_serializing_if = "Option::is_none"
5007 )]
5008 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
5009 pub base_financing: Option<Decimal>,
5010 #[serde(
5012 rename = "quoteFinancing",
5013 default,
5014 skip_serializing_if = "Option::is_none"
5015 )]
5016 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
5017 pub quote_financing: Option<Decimal>,
5018 #[serde(
5020 rename = "homeConversionFactors",
5021 default,
5022 skip_serializing_if = "Option::is_none"
5023 )]
5024 pub home_conversion_factors: Option<HomeConversionFactors>,
5025 #[serde(
5027 rename = "openTradeFinancings",
5028 default,
5029 skip_serializing_if = "Option::is_none"
5030 )]
5031 pub open_trade_financings: Option<Vec<OpenTradeFinancing>>,
5032 #[serde(
5034 rename = "accountFinancingMode",
5035 default,
5036 skip_serializing_if = "Option::is_none"
5037 )]
5038 pub account_financing_mode: Option<AccountFinancingMode>,
5039}
5040
5041#[derive(Debug, Clone, PartialEq, Eq, Hash)]
5043#[non_exhaustive]
5044pub enum TransactionRejectReason {
5045 InternalServerError,
5047 InstrumentPriceUnknown,
5049 AccountNotActive,
5051 AccountLocked,
5053 AccountOrderCreationLocked,
5055 AccountConfigurationLocked,
5057 AccountDepositLocked,
5059 AccountWithdrawalLocked,
5061 AccountOrderCancelLocked,
5063 InstrumentNotTradeable,
5065 PendingOrdersAllowedExceeded,
5067 OrderIdUnspecified,
5069 OrderDoesntExist,
5071 OrderIdentifierInconsistency,
5073 TradeIdUnspecified,
5075 TradeDoesntExist,
5077 TradeIdentifierInconsistency,
5079 InsufficientMargin,
5082 InstrumentMissing,
5084 InstrumentUnknown,
5086 UnitsMissing,
5088 UnitsInvalid,
5090 UnitsPrecisionExceeded,
5092 UnitsLimitExceeded,
5094 UnitsMinimumNotMet,
5096 PriceMissing,
5098 PriceInvalid,
5100 PricePrecisionExceeded,
5102 PriceDistanceMissing,
5104 PriceDistanceInvalid,
5106 PriceDistancePrecisionExceeded,
5108 PriceDistanceMaximumExceeded,
5110 PriceDistanceMinimumNotMet,
5112 TimeInForceMissing,
5114 TimeInForceInvalid,
5116 TimeInForceGtdTimestampMissing,
5118 TimeInForceGtdTimestampInPast,
5120 PriceBoundInvalid,
5122 PriceBoundPrecisionExceeded,
5124 OrdersOnFillDuplicateClientOrderIds,
5126 TradeOnFillClientExtensionsNotSupported,
5128 ClientOrderIdInvalid,
5130 ClientOrderIdAlreadyExists,
5132 ClientOrderTagInvalid,
5134 ClientOrderCommentInvalid,
5136 ClientTradeIdInvalid,
5138 ClientTradeIdAlreadyExists,
5140 ClientTradeTagInvalid,
5142 ClientTradeCommentInvalid,
5144 OrderFillPositionActionMissing,
5146 OrderFillPositionActionInvalid,
5148 TriggerConditionMissing,
5150 TriggerConditionInvalid,
5152 OrderPartialFillOptionMissing,
5154 OrderPartialFillOptionInvalid,
5156 InvalidReissueImmediatePartialFill,
5159 OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation,
5162 OrdersOnFillRmoMutualExclusivityGsloExcludesOthersViolation,
5166 TakeProfitOrderAlreadyExists,
5168 TakeProfitOrderWouldViolateFifoViolationSafeguard,
5171 TakeProfitOnFillPriceMissing,
5173 TakeProfitOnFillPriceInvalid,
5175 TakeProfitOnFillPricePrecisionExceeded,
5178 TakeProfitOnFillTimeInForceMissing,
5180 TakeProfitOnFillTimeInForceInvalid,
5182 TakeProfitOnFillGtdTimestampMissing,
5184 TakeProfitOnFillGtdTimestampInPast,
5186 TakeProfitOnFillClientOrderIdInvalid,
5188 TakeProfitOnFillClientOrderTagInvalid,
5190 TakeProfitOnFillClientOrderCommentInvalid,
5192 TakeProfitOnFillTriggerConditionMissing,
5194 TakeProfitOnFillTriggerConditionInvalid,
5196 StopLossOrderAlreadyExists,
5198 StopLossOrderGuaranteedRequired,
5201 StopLossOrderGuaranteedPriceWithinSpread,
5204 StopLossOrderGuaranteedNotAllowed,
5207 StopLossOrderGuaranteedHaltedCreateViolation,
5209 StopLossOrderGuaranteedHaltedTightenViolation,
5212 StopLossOrderGuaranteedHedgingNotAllowed,
5216 StopLossOrderGuaranteedMinimumDistanceNotMet,
5219 StopLossOrderNotCancelable,
5222 StopLossOrderNotReplaceable,
5225 StopLossOrderGuaranteedLevelRestrictionExceeded,
5228 StopLossOrderPriceAndDistanceBothSpecified,
5230 StopLossOrderPriceAndDistanceBothMissing,
5232 StopLossOrderWouldViolateFifoViolationSafeguard,
5235 StopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation,
5238 StopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation,
5242 StopLossOnFillRequiredForPendingOrder,
5245 StopLossOnFillGuaranteedNotAllowed,
5249 StopLossOnFillGuaranteedRequired,
5253 StopLossOnFillPriceMissing,
5255 StopLossOnFillPriceInvalid,
5257 StopLossOnFillPricePrecisionExceeded,
5259 StopLossOnFillGuaranteedMinimumDistanceNotMet,
5263 StopLossOnFillGuaranteedLevelRestrictionExceeded,
5266 StopLossOnFillDistanceInvalid,
5268 StopLossOnFillPriceDistanceMaximumExceeded,
5270 StopLossOnFillDistancePrecisionExceeded,
5272 StopLossOnFillPriceAndDistanceBothSpecified,
5274 StopLossOnFillPriceAndDistanceBothMissing,
5276 StopLossOnFillTimeInForceMissing,
5278 StopLossOnFillTimeInForceInvalid,
5280 StopLossOnFillGtdTimestampMissing,
5282 StopLossOnFillGtdTimestampInPast,
5284 StopLossOnFillClientOrderIdInvalid,
5286 StopLossOnFillClientOrderTagInvalid,
5288 StopLossOnFillClientOrderCommentInvalid,
5290 StopLossOnFillTriggerConditionMissing,
5292 StopLossOnFillTriggerConditionInvalid,
5294 GuaranteedStopLossOrderAlreadyExists,
5296 GuaranteedStopLossOrderRequired,
5299 GuaranteedStopLossOrderPriceWithinSpread,
5302 GuaranteedStopLossOrderNotAllowed,
5305 GuaranteedStopLossOrderHaltedCreateViolation,
5307 GuaranteedStopLossOrderCreateViolation,
5309 GuaranteedStopLossOrderHaltedTightenViolation,
5312 GuaranteedStopLossOrderTightenViolation,
5315 GuaranteedStopLossOrderHedgingNotAllowed,
5319 GuaranteedStopLossOrderMinimumDistanceNotMet,
5322 GuaranteedStopLossOrderNotCancelable,
5325 GuaranteedStopLossOrderHaltedNotCancelable,
5328 GuaranteedStopLossOrderNotReplaceable,
5331 GuaranteedStopLossOrderHaltedNotReplaceable,
5334 GuaranteedStopLossOrderLevelRestrictionVolumeExceeded,
5337 GuaranteedStopLossOrderLevelRestrictionPriceRangeExceeded,
5340 GuaranteedStopLossOrderPriceAndDistanceBothSpecified,
5342 GuaranteedStopLossOrderPriceAndDistanceBothMissing,
5344 GuaranteedStopLossOrderWouldViolateFifoViolationSafeguard,
5347 GuaranteedStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation,
5350 GuaranteedStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation,
5354 GuaranteedStopLossOnFillRequiredForPendingOrder,
5357 GuaranteedStopLossOnFillNotAllowed,
5361 GuaranteedStopLossOnFillRequired,
5365 GuaranteedStopLossOnFillPriceMissing,
5367 GuaranteedStopLossOnFillPriceInvalid,
5369 GuaranteedStopLossOnFillPricePrecisionExceeded,
5372 GuaranteedStopLossOnFillMinimumDistanceNotMet,
5376 GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded,
5379 GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded,
5382 GuaranteedStopLossOnFillDistanceInvalid,
5384 GuaranteedStopLossOnFillPriceDistanceMaximumExceeded,
5386 GuaranteedStopLossOnFillDistancePrecisionExceeded,
5388 GuaranteedStopLossOnFillPriceAndDistanceBothSpecified,
5390 GuaranteedStopLossOnFillPriceAndDistanceBothMissing,
5392 GuaranteedStopLossOnFillTimeInForceMissing,
5394 GuaranteedStopLossOnFillTimeInForceInvalid,
5396 GuaranteedStopLossOnFillGtdTimestampMissing,
5398 GuaranteedStopLossOnFillGtdTimestampInPast,
5400 GuaranteedStopLossOnFillClientOrderIdInvalid,
5402 GuaranteedStopLossOnFillClientOrderTagInvalid,
5404 GuaranteedStopLossOnFillClientOrderCommentInvalid,
5406 GuaranteedStopLossOnFillTriggerConditionMissing,
5408 GuaranteedStopLossOnFillTriggerConditionInvalid,
5410 TrailingStopLossOrderAlreadyExists,
5412 TrailingStopLossOrderWouldViolateFifoViolationSafeguard,
5415 TrailingStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation,
5418 TrailingStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation,
5422 TrailingStopLossOnFillPriceDistanceMissing,
5424 TrailingStopLossOnFillPriceDistanceInvalid,
5426 TrailingStopLossOnFillPriceDistancePrecisionExceeded,
5428 TrailingStopLossOnFillPriceDistanceMaximumExceeded,
5430 TrailingStopLossOnFillPriceDistanceMinimumNotMet,
5432 TrailingStopLossOnFillTimeInForceMissing,
5434 TrailingStopLossOnFillTimeInForceInvalid,
5436 TrailingStopLossOnFillGtdTimestampMissing,
5438 TrailingStopLossOnFillGtdTimestampInPast,
5440 TrailingStopLossOnFillClientOrderIdInvalid,
5442 TrailingStopLossOnFillClientOrderTagInvalid,
5444 TrailingStopLossOnFillClientOrderCommentInvalid,
5446 TrailingStopLossOrdersNotSupported,
5449 TrailingStopLossOnFillTriggerConditionMissing,
5451 TrailingStopLossOnFillTriggerConditionInvalid,
5453 CloseTradeTypeMissing,
5455 CloseTradePartialUnitsMissing,
5457 CloseTradeUnitsExceedTradeSize,
5460 CloseoutPositionDoesntExist,
5462 CloseoutPositionIncompleteSpecification,
5464 CloseoutPositionUnitsExceedPositionSize,
5466 CloseoutPositionReject,
5468 CloseoutPositionPartialUnitsMissing,
5470 MarkupGroupIdInvalid,
5472 PositionAggregationModeInvalid,
5474 AdminConfigureDataMissing,
5476 MarginRateInvalid,
5478 MarginRateWouldTriggerCloseout,
5480 AliasInvalid,
5482 ClientConfigureDataMissing,
5484 MarginRateWouldTriggerMarginCall,
5486 AmountInvalid,
5488 InsufficientFunds,
5490 AmountMissing,
5492 FundingReasonMissing,
5494 OcaOrderIdsStopLossNotAllowed,
5497 ClientExtensionsDataMissing,
5499 ReplacingOrderInvalid,
5501 ReplacingTradeIdInvalid,
5503 OrderCancelWouldTriggerCloseout,
5505 Unknown(String),
5507}
5508
5509impl TransactionRejectReason {
5510 pub fn as_str(&self) -> &str {
5512 match self {
5513 Self::InternalServerError => "INTERNAL_SERVER_ERROR",
5514 Self::InstrumentPriceUnknown => "INSTRUMENT_PRICE_UNKNOWN",
5515 Self::AccountNotActive => "ACCOUNT_NOT_ACTIVE",
5516 Self::AccountLocked => "ACCOUNT_LOCKED",
5517 Self::AccountOrderCreationLocked => "ACCOUNT_ORDER_CREATION_LOCKED",
5518 Self::AccountConfigurationLocked => "ACCOUNT_CONFIGURATION_LOCKED",
5519 Self::AccountDepositLocked => "ACCOUNT_DEPOSIT_LOCKED",
5520 Self::AccountWithdrawalLocked => "ACCOUNT_WITHDRAWAL_LOCKED",
5521 Self::AccountOrderCancelLocked => "ACCOUNT_ORDER_CANCEL_LOCKED",
5522 Self::InstrumentNotTradeable => "INSTRUMENT_NOT_TRADEABLE",
5523 Self::PendingOrdersAllowedExceeded => "PENDING_ORDERS_ALLOWED_EXCEEDED",
5524 Self::OrderIdUnspecified => "ORDER_ID_UNSPECIFIED",
5525 Self::OrderDoesntExist => "ORDER_DOESNT_EXIST",
5526 Self::OrderIdentifierInconsistency => "ORDER_IDENTIFIER_INCONSISTENCY",
5527 Self::TradeIdUnspecified => "TRADE_ID_UNSPECIFIED",
5528 Self::TradeDoesntExist => "TRADE_DOESNT_EXIST",
5529 Self::TradeIdentifierInconsistency => "TRADE_IDENTIFIER_INCONSISTENCY",
5530 Self::InsufficientMargin => "INSUFFICIENT_MARGIN",
5531 Self::InstrumentMissing => "INSTRUMENT_MISSING",
5532 Self::InstrumentUnknown => "INSTRUMENT_UNKNOWN",
5533 Self::UnitsMissing => "UNITS_MISSING",
5534 Self::UnitsInvalid => "UNITS_INVALID",
5535 Self::UnitsPrecisionExceeded => "UNITS_PRECISION_EXCEEDED",
5536 Self::UnitsLimitExceeded => "UNITS_LIMIT_EXCEEDED",
5537 Self::UnitsMinimumNotMet => "UNITS_MINIMUM_NOT_MET",
5538 Self::PriceMissing => "PRICE_MISSING",
5539 Self::PriceInvalid => "PRICE_INVALID",
5540 Self::PricePrecisionExceeded => "PRICE_PRECISION_EXCEEDED",
5541 Self::PriceDistanceMissing => "PRICE_DISTANCE_MISSING",
5542 Self::PriceDistanceInvalid => "PRICE_DISTANCE_INVALID",
5543 Self::PriceDistancePrecisionExceeded => "PRICE_DISTANCE_PRECISION_EXCEEDED",
5544 Self::PriceDistanceMaximumExceeded => "PRICE_DISTANCE_MAXIMUM_EXCEEDED",
5545 Self::PriceDistanceMinimumNotMet => "PRICE_DISTANCE_MINIMUM_NOT_MET",
5546 Self::TimeInForceMissing => "TIME_IN_FORCE_MISSING",
5547 Self::TimeInForceInvalid => "TIME_IN_FORCE_INVALID",
5548 Self::TimeInForceGtdTimestampMissing => "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING",
5549 Self::TimeInForceGtdTimestampInPast => "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST",
5550 Self::PriceBoundInvalid => "PRICE_BOUND_INVALID",
5551 Self::PriceBoundPrecisionExceeded => "PRICE_BOUND_PRECISION_EXCEEDED",
5552 Self::OrdersOnFillDuplicateClientOrderIds => {
5553 "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS"
5554 }
5555 Self::TradeOnFillClientExtensionsNotSupported => {
5556 "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED"
5557 }
5558 Self::ClientOrderIdInvalid => "CLIENT_ORDER_ID_INVALID",
5559 Self::ClientOrderIdAlreadyExists => "CLIENT_ORDER_ID_ALREADY_EXISTS",
5560 Self::ClientOrderTagInvalid => "CLIENT_ORDER_TAG_INVALID",
5561 Self::ClientOrderCommentInvalid => "CLIENT_ORDER_COMMENT_INVALID",
5562 Self::ClientTradeIdInvalid => "CLIENT_TRADE_ID_INVALID",
5563 Self::ClientTradeIdAlreadyExists => "CLIENT_TRADE_ID_ALREADY_EXISTS",
5564 Self::ClientTradeTagInvalid => "CLIENT_TRADE_TAG_INVALID",
5565 Self::ClientTradeCommentInvalid => "CLIENT_TRADE_COMMENT_INVALID",
5566 Self::OrderFillPositionActionMissing => "ORDER_FILL_POSITION_ACTION_MISSING",
5567 Self::OrderFillPositionActionInvalid => "ORDER_FILL_POSITION_ACTION_INVALID",
5568 Self::TriggerConditionMissing => "TRIGGER_CONDITION_MISSING",
5569 Self::TriggerConditionInvalid => "TRIGGER_CONDITION_INVALID",
5570 Self::OrderPartialFillOptionMissing => "ORDER_PARTIAL_FILL_OPTION_MISSING",
5571 Self::OrderPartialFillOptionInvalid => "ORDER_PARTIAL_FILL_OPTION_INVALID",
5572 Self::InvalidReissueImmediatePartialFill => "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL",
5573 Self::OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation => {
5574 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
5575 }
5576 Self::OrdersOnFillRmoMutualExclusivityGsloExcludesOthersViolation => {
5577 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION"
5578 }
5579 Self::TakeProfitOrderAlreadyExists => "TAKE_PROFIT_ORDER_ALREADY_EXISTS",
5580 Self::TakeProfitOrderWouldViolateFifoViolationSafeguard => {
5581 "TAKE_PROFIT_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD"
5582 }
5583 Self::TakeProfitOnFillPriceMissing => "TAKE_PROFIT_ON_FILL_PRICE_MISSING",
5584 Self::TakeProfitOnFillPriceInvalid => "TAKE_PROFIT_ON_FILL_PRICE_INVALID",
5585 Self::TakeProfitOnFillPricePrecisionExceeded => {
5586 "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED"
5587 }
5588 Self::TakeProfitOnFillTimeInForceMissing => "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING",
5589 Self::TakeProfitOnFillTimeInForceInvalid => "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID",
5590 Self::TakeProfitOnFillGtdTimestampMissing => {
5591 "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING"
5592 }
5593 Self::TakeProfitOnFillGtdTimestampInPast => "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST",
5594 Self::TakeProfitOnFillClientOrderIdInvalid => {
5595 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID"
5596 }
5597 Self::TakeProfitOnFillClientOrderTagInvalid => {
5598 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID"
5599 }
5600 Self::TakeProfitOnFillClientOrderCommentInvalid => {
5601 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"
5602 }
5603 Self::TakeProfitOnFillTriggerConditionMissing => {
5604 "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING"
5605 }
5606 Self::TakeProfitOnFillTriggerConditionInvalid => {
5607 "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID"
5608 }
5609 Self::StopLossOrderAlreadyExists => "STOP_LOSS_ORDER_ALREADY_EXISTS",
5610 Self::StopLossOrderGuaranteedRequired => "STOP_LOSS_ORDER_GUARANTEED_REQUIRED",
5611 Self::StopLossOrderGuaranteedPriceWithinSpread => {
5612 "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD"
5613 }
5614 Self::StopLossOrderGuaranteedNotAllowed => "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED",
5615 Self::StopLossOrderGuaranteedHaltedCreateViolation => {
5616 "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION"
5617 }
5618 Self::StopLossOrderGuaranteedHaltedTightenViolation => {
5619 "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION"
5620 }
5621 Self::StopLossOrderGuaranteedHedgingNotAllowed => {
5622 "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED"
5623 }
5624 Self::StopLossOrderGuaranteedMinimumDistanceNotMet => {
5625 "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"
5626 }
5627 Self::StopLossOrderNotCancelable => "STOP_LOSS_ORDER_NOT_CANCELABLE",
5628 Self::StopLossOrderNotReplaceable => "STOP_LOSS_ORDER_NOT_REPLACEABLE",
5629 Self::StopLossOrderGuaranteedLevelRestrictionExceeded => {
5630 "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"
5631 }
5632 Self::StopLossOrderPriceAndDistanceBothSpecified => {
5633 "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED"
5634 }
5635 Self::StopLossOrderPriceAndDistanceBothMissing => {
5636 "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING"
5637 }
5638 Self::StopLossOrderWouldViolateFifoViolationSafeguard => {
5639 "STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD"
5640 }
5641 Self::StopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation => {
5642 "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
5643 }
5644 Self::StopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation => {
5645 "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION"
5646 }
5647 Self::StopLossOnFillRequiredForPendingOrder => {
5648 "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER"
5649 }
5650 Self::StopLossOnFillGuaranteedNotAllowed => "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED",
5651 Self::StopLossOnFillGuaranteedRequired => "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED",
5652 Self::StopLossOnFillPriceMissing => "STOP_LOSS_ON_FILL_PRICE_MISSING",
5653 Self::StopLossOnFillPriceInvalid => "STOP_LOSS_ON_FILL_PRICE_INVALID",
5654 Self::StopLossOnFillPricePrecisionExceeded => {
5655 "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED"
5656 }
5657 Self::StopLossOnFillGuaranteedMinimumDistanceNotMet => {
5658 "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"
5659 }
5660 Self::StopLossOnFillGuaranteedLevelRestrictionExceeded => {
5661 "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"
5662 }
5663 Self::StopLossOnFillDistanceInvalid => "STOP_LOSS_ON_FILL_DISTANCE_INVALID",
5664 Self::StopLossOnFillPriceDistanceMaximumExceeded => {
5665 "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
5666 }
5667 Self::StopLossOnFillDistancePrecisionExceeded => {
5668 "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED"
5669 }
5670 Self::StopLossOnFillPriceAndDistanceBothSpecified => {
5671 "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED"
5672 }
5673 Self::StopLossOnFillPriceAndDistanceBothMissing => {
5674 "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING"
5675 }
5676 Self::StopLossOnFillTimeInForceMissing => "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING",
5677 Self::StopLossOnFillTimeInForceInvalid => "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID",
5678 Self::StopLossOnFillGtdTimestampMissing => "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING",
5679 Self::StopLossOnFillGtdTimestampInPast => "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST",
5680 Self::StopLossOnFillClientOrderIdInvalid => "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID",
5681 Self::StopLossOnFillClientOrderTagInvalid => {
5682 "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"
5683 }
5684 Self::StopLossOnFillClientOrderCommentInvalid => {
5685 "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"
5686 }
5687 Self::StopLossOnFillTriggerConditionMissing => {
5688 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"
5689 }
5690 Self::StopLossOnFillTriggerConditionInvalid => {
5691 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
5692 }
5693 Self::GuaranteedStopLossOrderAlreadyExists => {
5694 "GUARANTEED_STOP_LOSS_ORDER_ALREADY_EXISTS"
5695 }
5696 Self::GuaranteedStopLossOrderRequired => "GUARANTEED_STOP_LOSS_ORDER_REQUIRED",
5697 Self::GuaranteedStopLossOrderPriceWithinSpread => {
5698 "GUARANTEED_STOP_LOSS_ORDER_PRICE_WITHIN_SPREAD"
5699 }
5700 Self::GuaranteedStopLossOrderNotAllowed => "GUARANTEED_STOP_LOSS_ORDER_NOT_ALLOWED",
5701 Self::GuaranteedStopLossOrderHaltedCreateViolation => {
5702 "GUARANTEED_STOP_LOSS_ORDER_HALTED_CREATE_VIOLATION"
5703 }
5704 Self::GuaranteedStopLossOrderCreateViolation => {
5705 "GUARANTEED_STOP_LOSS_ORDER_CREATE_VIOLATION"
5706 }
5707 Self::GuaranteedStopLossOrderHaltedTightenViolation => {
5708 "GUARANTEED_STOP_LOSS_ORDER_HALTED_TIGHTEN_VIOLATION"
5709 }
5710 Self::GuaranteedStopLossOrderTightenViolation => {
5711 "GUARANTEED_STOP_LOSS_ORDER_TIGHTEN_VIOLATION"
5712 }
5713 Self::GuaranteedStopLossOrderHedgingNotAllowed => {
5714 "GUARANTEED_STOP_LOSS_ORDER_HEDGING_NOT_ALLOWED"
5715 }
5716 Self::GuaranteedStopLossOrderMinimumDistanceNotMet => {
5717 "GUARANTEED_STOP_LOSS_ORDER_MINIMUM_DISTANCE_NOT_MET"
5718 }
5719 Self::GuaranteedStopLossOrderNotCancelable => {
5720 "GUARANTEED_STOP_LOSS_ORDER_NOT_CANCELABLE"
5721 }
5722 Self::GuaranteedStopLossOrderHaltedNotCancelable => {
5723 "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_CANCELABLE"
5724 }
5725 Self::GuaranteedStopLossOrderNotReplaceable => {
5726 "GUARANTEED_STOP_LOSS_ORDER_NOT_REPLACEABLE"
5727 }
5728 Self::GuaranteedStopLossOrderHaltedNotReplaceable => {
5729 "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_REPLACEABLE"
5730 }
5731 Self::GuaranteedStopLossOrderLevelRestrictionVolumeExceeded => {
5732 "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_VOLUME_EXCEEDED"
5733 }
5734 Self::GuaranteedStopLossOrderLevelRestrictionPriceRangeExceeded => {
5735 "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED"
5736 }
5737 Self::GuaranteedStopLossOrderPriceAndDistanceBothSpecified => {
5738 "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED"
5739 }
5740 Self::GuaranteedStopLossOrderPriceAndDistanceBothMissing => {
5741 "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING"
5742 }
5743 Self::GuaranteedStopLossOrderWouldViolateFifoViolationSafeguard => {
5744 "GUARANTEED_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD"
5745 }
5746 Self::GuaranteedStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation => {
5747 "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
5748 }
5749 Self::GuaranteedStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation => {
5750 "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION"
5751 }
5752 Self::GuaranteedStopLossOnFillRequiredForPendingOrder => {
5753 "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER"
5754 }
5755 Self::GuaranteedStopLossOnFillNotAllowed => "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED",
5756 Self::GuaranteedStopLossOnFillRequired => "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED",
5757 Self::GuaranteedStopLossOnFillPriceMissing => {
5758 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_MISSING"
5759 }
5760 Self::GuaranteedStopLossOnFillPriceInvalid => {
5761 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_INVALID"
5762 }
5763 Self::GuaranteedStopLossOnFillPricePrecisionExceeded => {
5764 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED"
5765 }
5766 Self::GuaranteedStopLossOnFillMinimumDistanceNotMet => {
5767 "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET"
5768 }
5769 Self::GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded => {
5770 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED"
5771 }
5772 Self::GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded => {
5773 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED"
5774 }
5775 Self::GuaranteedStopLossOnFillDistanceInvalid => {
5776 "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_INVALID"
5777 }
5778 Self::GuaranteedStopLossOnFillPriceDistanceMaximumExceeded => {
5779 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
5780 }
5781 Self::GuaranteedStopLossOnFillDistancePrecisionExceeded => {
5782 "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED"
5783 }
5784 Self::GuaranteedStopLossOnFillPriceAndDistanceBothSpecified => {
5785 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED"
5786 }
5787 Self::GuaranteedStopLossOnFillPriceAndDistanceBothMissing => {
5788 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING"
5789 }
5790 Self::GuaranteedStopLossOnFillTimeInForceMissing => {
5791 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING"
5792 }
5793 Self::GuaranteedStopLossOnFillTimeInForceInvalid => {
5794 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"
5795 }
5796 Self::GuaranteedStopLossOnFillGtdTimestampMissing => {
5797 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING"
5798 }
5799 Self::GuaranteedStopLossOnFillGtdTimestampInPast => {
5800 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"
5801 }
5802 Self::GuaranteedStopLossOnFillClientOrderIdInvalid => {
5803 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID"
5804 }
5805 Self::GuaranteedStopLossOnFillClientOrderTagInvalid => {
5806 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"
5807 }
5808 Self::GuaranteedStopLossOnFillClientOrderCommentInvalid => {
5809 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"
5810 }
5811 Self::GuaranteedStopLossOnFillTriggerConditionMissing => {
5812 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"
5813 }
5814 Self::GuaranteedStopLossOnFillTriggerConditionInvalid => {
5815 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
5816 }
5817 Self::TrailingStopLossOrderAlreadyExists => "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS",
5818 Self::TrailingStopLossOrderWouldViolateFifoViolationSafeguard => {
5819 "TRAILING_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD"
5820 }
5821 Self::TrailingStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation => {
5822 "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
5823 }
5824 Self::TrailingStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation => {
5825 "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION"
5826 }
5827 Self::TrailingStopLossOnFillPriceDistanceMissing => {
5828 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING"
5829 }
5830 Self::TrailingStopLossOnFillPriceDistanceInvalid => {
5831 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID"
5832 }
5833 Self::TrailingStopLossOnFillPriceDistancePrecisionExceeded => {
5834 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED"
5835 }
5836 Self::TrailingStopLossOnFillPriceDistanceMaximumExceeded => {
5837 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
5838 }
5839 Self::TrailingStopLossOnFillPriceDistanceMinimumNotMet => {
5840 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET"
5841 }
5842 Self::TrailingStopLossOnFillTimeInForceMissing => {
5843 "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING"
5844 }
5845 Self::TrailingStopLossOnFillTimeInForceInvalid => {
5846 "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"
5847 }
5848 Self::TrailingStopLossOnFillGtdTimestampMissing => {
5849 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING"
5850 }
5851 Self::TrailingStopLossOnFillGtdTimestampInPast => {
5852 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"
5853 }
5854 Self::TrailingStopLossOnFillClientOrderIdInvalid => {
5855 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID"
5856 }
5857 Self::TrailingStopLossOnFillClientOrderTagInvalid => {
5858 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"
5859 }
5860 Self::TrailingStopLossOnFillClientOrderCommentInvalid => {
5861 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"
5862 }
5863 Self::TrailingStopLossOrdersNotSupported => "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED",
5864 Self::TrailingStopLossOnFillTriggerConditionMissing => {
5865 "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"
5866 }
5867 Self::TrailingStopLossOnFillTriggerConditionInvalid => {
5868 "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
5869 }
5870 Self::CloseTradeTypeMissing => "CLOSE_TRADE_TYPE_MISSING",
5871 Self::CloseTradePartialUnitsMissing => "CLOSE_TRADE_PARTIAL_UNITS_MISSING",
5872 Self::CloseTradeUnitsExceedTradeSize => "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE",
5873 Self::CloseoutPositionDoesntExist => "CLOSEOUT_POSITION_DOESNT_EXIST",
5874 Self::CloseoutPositionIncompleteSpecification => {
5875 "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION"
5876 }
5877 Self::CloseoutPositionUnitsExceedPositionSize => {
5878 "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE"
5879 }
5880 Self::CloseoutPositionReject => "CLOSEOUT_POSITION_REJECT",
5881 Self::CloseoutPositionPartialUnitsMissing => "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING",
5882 Self::MarkupGroupIdInvalid => "MARKUP_GROUP_ID_INVALID",
5883 Self::PositionAggregationModeInvalid => "POSITION_AGGREGATION_MODE_INVALID",
5884 Self::AdminConfigureDataMissing => "ADMIN_CONFIGURE_DATA_MISSING",
5885 Self::MarginRateInvalid => "MARGIN_RATE_INVALID",
5886 Self::MarginRateWouldTriggerCloseout => "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT",
5887 Self::AliasInvalid => "ALIAS_INVALID",
5888 Self::ClientConfigureDataMissing => "CLIENT_CONFIGURE_DATA_MISSING",
5889 Self::MarginRateWouldTriggerMarginCall => "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL",
5890 Self::AmountInvalid => "AMOUNT_INVALID",
5891 Self::InsufficientFunds => "INSUFFICIENT_FUNDS",
5892 Self::AmountMissing => "AMOUNT_MISSING",
5893 Self::FundingReasonMissing => "FUNDING_REASON_MISSING",
5894 Self::OcaOrderIdsStopLossNotAllowed => "OCA_ORDER_IDS_STOP_LOSS_NOT_ALLOWED",
5895 Self::ClientExtensionsDataMissing => "CLIENT_EXTENSIONS_DATA_MISSING",
5896 Self::ReplacingOrderInvalid => "REPLACING_ORDER_INVALID",
5897 Self::ReplacingTradeIdInvalid => "REPLACING_TRADE_ID_INVALID",
5898 Self::OrderCancelWouldTriggerCloseout => "ORDER_CANCEL_WOULD_TRIGGER_CLOSEOUT",
5899 Self::Unknown(value) => value,
5900 }
5901 }
5902}
5903
5904impl Serialize for TransactionRejectReason {
5905 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
5906 serializer.serialize_str(self.as_str())
5907 }
5908}
5909
5910impl<'de> Deserialize<'de> for TransactionRejectReason {
5911 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5912 let value = String::deserialize(deserializer)?;
5913 Ok(match value.as_str() {
5914 "INTERNAL_SERVER_ERROR" => Self::InternalServerError,
5915 "INSTRUMENT_PRICE_UNKNOWN" => Self::InstrumentPriceUnknown,
5916 "ACCOUNT_NOT_ACTIVE" => Self::AccountNotActive,
5917 "ACCOUNT_LOCKED" => Self::AccountLocked,
5918 "ACCOUNT_ORDER_CREATION_LOCKED" => Self::AccountOrderCreationLocked,
5919 "ACCOUNT_CONFIGURATION_LOCKED" => Self::AccountConfigurationLocked,
5920 "ACCOUNT_DEPOSIT_LOCKED" => Self::AccountDepositLocked,
5921 "ACCOUNT_WITHDRAWAL_LOCKED" => Self::AccountWithdrawalLocked,
5922 "ACCOUNT_ORDER_CANCEL_LOCKED" => Self::AccountOrderCancelLocked,
5923 "INSTRUMENT_NOT_TRADEABLE" => Self::InstrumentNotTradeable,
5924 "PENDING_ORDERS_ALLOWED_EXCEEDED" => Self::PendingOrdersAllowedExceeded,
5925 "ORDER_ID_UNSPECIFIED" => Self::OrderIdUnspecified,
5926 "ORDER_DOESNT_EXIST" => Self::OrderDoesntExist,
5927 "ORDER_IDENTIFIER_INCONSISTENCY" => Self::OrderIdentifierInconsistency,
5928 "TRADE_ID_UNSPECIFIED" => Self::TradeIdUnspecified,
5929 "TRADE_DOESNT_EXIST" => Self::TradeDoesntExist,
5930 "TRADE_IDENTIFIER_INCONSISTENCY" => Self::TradeIdentifierInconsistency,
5931 "INSUFFICIENT_MARGIN" => Self::InsufficientMargin,
5932 "INSTRUMENT_MISSING" => Self::InstrumentMissing,
5933 "INSTRUMENT_UNKNOWN" => Self::InstrumentUnknown,
5934 "UNITS_MISSING" => Self::UnitsMissing,
5935 "UNITS_INVALID" => Self::UnitsInvalid,
5936 "UNITS_PRECISION_EXCEEDED" => Self::UnitsPrecisionExceeded,
5937 "UNITS_LIMIT_EXCEEDED" => Self::UnitsLimitExceeded,
5938 "UNITS_MINIMUM_NOT_MET" => Self::UnitsMinimumNotMet,
5939 "PRICE_MISSING" => Self::PriceMissing,
5940 "PRICE_INVALID" => Self::PriceInvalid,
5941 "PRICE_PRECISION_EXCEEDED" => Self::PricePrecisionExceeded,
5942 "PRICE_DISTANCE_MISSING" => Self::PriceDistanceMissing,
5943 "PRICE_DISTANCE_INVALID" => Self::PriceDistanceInvalid,
5944 "PRICE_DISTANCE_PRECISION_EXCEEDED" => Self::PriceDistancePrecisionExceeded,
5945 "PRICE_DISTANCE_MAXIMUM_EXCEEDED" => Self::PriceDistanceMaximumExceeded,
5946 "PRICE_DISTANCE_MINIMUM_NOT_MET" => Self::PriceDistanceMinimumNotMet,
5947 "TIME_IN_FORCE_MISSING" => Self::TimeInForceMissing,
5948 "TIME_IN_FORCE_INVALID" => Self::TimeInForceInvalid,
5949 "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING" => Self::TimeInForceGtdTimestampMissing,
5950 "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST" => Self::TimeInForceGtdTimestampInPast,
5951 "PRICE_BOUND_INVALID" => Self::PriceBoundInvalid,
5952 "PRICE_BOUND_PRECISION_EXCEEDED" => Self::PriceBoundPrecisionExceeded,
5953 "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS" => {
5954 Self::OrdersOnFillDuplicateClientOrderIds
5955 }
5956 "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED" => {
5957 Self::TradeOnFillClientExtensionsNotSupported
5958 }
5959 "CLIENT_ORDER_ID_INVALID" => Self::ClientOrderIdInvalid,
5960 "CLIENT_ORDER_ID_ALREADY_EXISTS" => Self::ClientOrderIdAlreadyExists,
5961 "CLIENT_ORDER_TAG_INVALID" => Self::ClientOrderTagInvalid,
5962 "CLIENT_ORDER_COMMENT_INVALID" => Self::ClientOrderCommentInvalid,
5963 "CLIENT_TRADE_ID_INVALID" => Self::ClientTradeIdInvalid,
5964 "CLIENT_TRADE_ID_ALREADY_EXISTS" => Self::ClientTradeIdAlreadyExists,
5965 "CLIENT_TRADE_TAG_INVALID" => Self::ClientTradeTagInvalid,
5966 "CLIENT_TRADE_COMMENT_INVALID" => Self::ClientTradeCommentInvalid,
5967 "ORDER_FILL_POSITION_ACTION_MISSING" => Self::OrderFillPositionActionMissing,
5968 "ORDER_FILL_POSITION_ACTION_INVALID" => Self::OrderFillPositionActionInvalid,
5969 "TRIGGER_CONDITION_MISSING" => Self::TriggerConditionMissing,
5970 "TRIGGER_CONDITION_INVALID" => Self::TriggerConditionInvalid,
5971 "ORDER_PARTIAL_FILL_OPTION_MISSING" => Self::OrderPartialFillOptionMissing,
5972 "ORDER_PARTIAL_FILL_OPTION_INVALID" => Self::OrderPartialFillOptionInvalid,
5973 "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL" => Self::InvalidReissueImmediatePartialFill,
5974 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
5975 Self::OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation
5976 }
5977 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" => {
5978 Self::OrdersOnFillRmoMutualExclusivityGsloExcludesOthersViolation
5979 }
5980 "TAKE_PROFIT_ORDER_ALREADY_EXISTS" => Self::TakeProfitOrderAlreadyExists,
5981 "TAKE_PROFIT_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" => {
5982 Self::TakeProfitOrderWouldViolateFifoViolationSafeguard
5983 }
5984 "TAKE_PROFIT_ON_FILL_PRICE_MISSING" => Self::TakeProfitOnFillPriceMissing,
5985 "TAKE_PROFIT_ON_FILL_PRICE_INVALID" => Self::TakeProfitOnFillPriceInvalid,
5986 "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED" => {
5987 Self::TakeProfitOnFillPricePrecisionExceeded
5988 }
5989 "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING" => Self::TakeProfitOnFillTimeInForceMissing,
5990 "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID" => Self::TakeProfitOnFillTimeInForceInvalid,
5991 "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING" => {
5992 Self::TakeProfitOnFillGtdTimestampMissing
5993 }
5994 "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST" => Self::TakeProfitOnFillGtdTimestampInPast,
5995 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID" => {
5996 Self::TakeProfitOnFillClientOrderIdInvalid
5997 }
5998 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID" => {
5999 Self::TakeProfitOnFillClientOrderTagInvalid
6000 }
6001 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" => {
6002 Self::TakeProfitOnFillClientOrderCommentInvalid
6003 }
6004 "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING" => {
6005 Self::TakeProfitOnFillTriggerConditionMissing
6006 }
6007 "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID" => {
6008 Self::TakeProfitOnFillTriggerConditionInvalid
6009 }
6010 "STOP_LOSS_ORDER_ALREADY_EXISTS" => Self::StopLossOrderAlreadyExists,
6011 "STOP_LOSS_ORDER_GUARANTEED_REQUIRED" => Self::StopLossOrderGuaranteedRequired,
6012 "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD" => {
6013 Self::StopLossOrderGuaranteedPriceWithinSpread
6014 }
6015 "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED" => Self::StopLossOrderGuaranteedNotAllowed,
6016 "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION" => {
6017 Self::StopLossOrderGuaranteedHaltedCreateViolation
6018 }
6019 "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION" => {
6020 Self::StopLossOrderGuaranteedHaltedTightenViolation
6021 }
6022 "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED" => {
6023 Self::StopLossOrderGuaranteedHedgingNotAllowed
6024 }
6025 "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" => {
6026 Self::StopLossOrderGuaranteedMinimumDistanceNotMet
6027 }
6028 "STOP_LOSS_ORDER_NOT_CANCELABLE" => Self::StopLossOrderNotCancelable,
6029 "STOP_LOSS_ORDER_NOT_REPLACEABLE" => Self::StopLossOrderNotReplaceable,
6030 "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" => {
6031 Self::StopLossOrderGuaranteedLevelRestrictionExceeded
6032 }
6033 "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED" => {
6034 Self::StopLossOrderPriceAndDistanceBothSpecified
6035 }
6036 "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING" => {
6037 Self::StopLossOrderPriceAndDistanceBothMissing
6038 }
6039 "STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" => {
6040 Self::StopLossOrderWouldViolateFifoViolationSafeguard
6041 }
6042 "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
6043 Self::StopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation
6044 }
6045 "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" => {
6046 Self::StopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation
6047 }
6048 "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER" => {
6049 Self::StopLossOnFillRequiredForPendingOrder
6050 }
6051 "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED" => Self::StopLossOnFillGuaranteedNotAllowed,
6052 "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED" => Self::StopLossOnFillGuaranteedRequired,
6053 "STOP_LOSS_ON_FILL_PRICE_MISSING" => Self::StopLossOnFillPriceMissing,
6054 "STOP_LOSS_ON_FILL_PRICE_INVALID" => Self::StopLossOnFillPriceInvalid,
6055 "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED" => {
6056 Self::StopLossOnFillPricePrecisionExceeded
6057 }
6058 "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" => {
6059 Self::StopLossOnFillGuaranteedMinimumDistanceNotMet
6060 }
6061 "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" => {
6062 Self::StopLossOnFillGuaranteedLevelRestrictionExceeded
6063 }
6064 "STOP_LOSS_ON_FILL_DISTANCE_INVALID" => Self::StopLossOnFillDistanceInvalid,
6065 "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
6066 Self::StopLossOnFillPriceDistanceMaximumExceeded
6067 }
6068 "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED" => {
6069 Self::StopLossOnFillDistancePrecisionExceeded
6070 }
6071 "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED" => {
6072 Self::StopLossOnFillPriceAndDistanceBothSpecified
6073 }
6074 "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING" => {
6075 Self::StopLossOnFillPriceAndDistanceBothMissing
6076 }
6077 "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" => Self::StopLossOnFillTimeInForceMissing,
6078 "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => Self::StopLossOnFillTimeInForceInvalid,
6079 "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" => Self::StopLossOnFillGtdTimestampMissing,
6080 "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => Self::StopLossOnFillGtdTimestampInPast,
6081 "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" => Self::StopLossOnFillClientOrderIdInvalid,
6082 "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" => {
6083 Self::StopLossOnFillClientOrderTagInvalid
6084 }
6085 "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" => {
6086 Self::StopLossOnFillClientOrderCommentInvalid
6087 }
6088 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" => {
6089 Self::StopLossOnFillTriggerConditionMissing
6090 }
6091 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
6092 Self::StopLossOnFillTriggerConditionInvalid
6093 }
6094 "GUARANTEED_STOP_LOSS_ORDER_ALREADY_EXISTS" => {
6095 Self::GuaranteedStopLossOrderAlreadyExists
6096 }
6097 "GUARANTEED_STOP_LOSS_ORDER_REQUIRED" => Self::GuaranteedStopLossOrderRequired,
6098 "GUARANTEED_STOP_LOSS_ORDER_PRICE_WITHIN_SPREAD" => {
6099 Self::GuaranteedStopLossOrderPriceWithinSpread
6100 }
6101 "GUARANTEED_STOP_LOSS_ORDER_NOT_ALLOWED" => Self::GuaranteedStopLossOrderNotAllowed,
6102 "GUARANTEED_STOP_LOSS_ORDER_HALTED_CREATE_VIOLATION" => {
6103 Self::GuaranteedStopLossOrderHaltedCreateViolation
6104 }
6105 "GUARANTEED_STOP_LOSS_ORDER_CREATE_VIOLATION" => {
6106 Self::GuaranteedStopLossOrderCreateViolation
6107 }
6108 "GUARANTEED_STOP_LOSS_ORDER_HALTED_TIGHTEN_VIOLATION" => {
6109 Self::GuaranteedStopLossOrderHaltedTightenViolation
6110 }
6111 "GUARANTEED_STOP_LOSS_ORDER_TIGHTEN_VIOLATION" => {
6112 Self::GuaranteedStopLossOrderTightenViolation
6113 }
6114 "GUARANTEED_STOP_LOSS_ORDER_HEDGING_NOT_ALLOWED" => {
6115 Self::GuaranteedStopLossOrderHedgingNotAllowed
6116 }
6117 "GUARANTEED_STOP_LOSS_ORDER_MINIMUM_DISTANCE_NOT_MET" => {
6118 Self::GuaranteedStopLossOrderMinimumDistanceNotMet
6119 }
6120 "GUARANTEED_STOP_LOSS_ORDER_NOT_CANCELABLE" => {
6121 Self::GuaranteedStopLossOrderNotCancelable
6122 }
6123 "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_CANCELABLE" => {
6124 Self::GuaranteedStopLossOrderHaltedNotCancelable
6125 }
6126 "GUARANTEED_STOP_LOSS_ORDER_NOT_REPLACEABLE" => {
6127 Self::GuaranteedStopLossOrderNotReplaceable
6128 }
6129 "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_REPLACEABLE" => {
6130 Self::GuaranteedStopLossOrderHaltedNotReplaceable
6131 }
6132 "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_VOLUME_EXCEEDED" => {
6133 Self::GuaranteedStopLossOrderLevelRestrictionVolumeExceeded
6134 }
6135 "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" => {
6136 Self::GuaranteedStopLossOrderLevelRestrictionPriceRangeExceeded
6137 }
6138 "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED" => {
6139 Self::GuaranteedStopLossOrderPriceAndDistanceBothSpecified
6140 }
6141 "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING" => {
6142 Self::GuaranteedStopLossOrderPriceAndDistanceBothMissing
6143 }
6144 "GUARANTEED_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" => {
6145 Self::GuaranteedStopLossOrderWouldViolateFifoViolationSafeguard
6146 }
6147 "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
6148 Self::GuaranteedStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation
6149 }
6150 "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" => {
6151 Self::GuaranteedStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation
6152 }
6153 "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER" => {
6154 Self::GuaranteedStopLossOnFillRequiredForPendingOrder
6155 }
6156 "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED" => Self::GuaranteedStopLossOnFillNotAllowed,
6157 "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED" => Self::GuaranteedStopLossOnFillRequired,
6158 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_MISSING" => {
6159 Self::GuaranteedStopLossOnFillPriceMissing
6160 }
6161 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_INVALID" => {
6162 Self::GuaranteedStopLossOnFillPriceInvalid
6163 }
6164 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED" => {
6165 Self::GuaranteedStopLossOnFillPricePrecisionExceeded
6166 }
6167 "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET" => {
6168 Self::GuaranteedStopLossOnFillMinimumDistanceNotMet
6169 }
6170 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED" => {
6171 Self::GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded
6172 }
6173 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" => {
6174 Self::GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded
6175 }
6176 "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_INVALID" => {
6177 Self::GuaranteedStopLossOnFillDistanceInvalid
6178 }
6179 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
6180 Self::GuaranteedStopLossOnFillPriceDistanceMaximumExceeded
6181 }
6182 "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED" => {
6183 Self::GuaranteedStopLossOnFillDistancePrecisionExceeded
6184 }
6185 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED" => {
6186 Self::GuaranteedStopLossOnFillPriceAndDistanceBothSpecified
6187 }
6188 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING" => {
6189 Self::GuaranteedStopLossOnFillPriceAndDistanceBothMissing
6190 }
6191 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" => {
6192 Self::GuaranteedStopLossOnFillTimeInForceMissing
6193 }
6194 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => {
6195 Self::GuaranteedStopLossOnFillTimeInForceInvalid
6196 }
6197 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" => {
6198 Self::GuaranteedStopLossOnFillGtdTimestampMissing
6199 }
6200 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => {
6201 Self::GuaranteedStopLossOnFillGtdTimestampInPast
6202 }
6203 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" => {
6204 Self::GuaranteedStopLossOnFillClientOrderIdInvalid
6205 }
6206 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" => {
6207 Self::GuaranteedStopLossOnFillClientOrderTagInvalid
6208 }
6209 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" => {
6210 Self::GuaranteedStopLossOnFillClientOrderCommentInvalid
6211 }
6212 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" => {
6213 Self::GuaranteedStopLossOnFillTriggerConditionMissing
6214 }
6215 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
6216 Self::GuaranteedStopLossOnFillTriggerConditionInvalid
6217 }
6218 "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS" => Self::TrailingStopLossOrderAlreadyExists,
6219 "TRAILING_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" => {
6220 Self::TrailingStopLossOrderWouldViolateFifoViolationSafeguard
6221 }
6222 "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
6223 Self::TrailingStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation
6224 }
6225 "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" => {
6226 Self::TrailingStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation
6227 }
6228 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING" => {
6229 Self::TrailingStopLossOnFillPriceDistanceMissing
6230 }
6231 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID" => {
6232 Self::TrailingStopLossOnFillPriceDistanceInvalid
6233 }
6234 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED" => {
6235 Self::TrailingStopLossOnFillPriceDistancePrecisionExceeded
6236 }
6237 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
6238 Self::TrailingStopLossOnFillPriceDistanceMaximumExceeded
6239 }
6240 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET" => {
6241 Self::TrailingStopLossOnFillPriceDistanceMinimumNotMet
6242 }
6243 "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" => {
6244 Self::TrailingStopLossOnFillTimeInForceMissing
6245 }
6246 "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => {
6247 Self::TrailingStopLossOnFillTimeInForceInvalid
6248 }
6249 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" => {
6250 Self::TrailingStopLossOnFillGtdTimestampMissing
6251 }
6252 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => {
6253 Self::TrailingStopLossOnFillGtdTimestampInPast
6254 }
6255 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" => {
6256 Self::TrailingStopLossOnFillClientOrderIdInvalid
6257 }
6258 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" => {
6259 Self::TrailingStopLossOnFillClientOrderTagInvalid
6260 }
6261 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" => {
6262 Self::TrailingStopLossOnFillClientOrderCommentInvalid
6263 }
6264 "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED" => Self::TrailingStopLossOrdersNotSupported,
6265 "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" => {
6266 Self::TrailingStopLossOnFillTriggerConditionMissing
6267 }
6268 "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
6269 Self::TrailingStopLossOnFillTriggerConditionInvalid
6270 }
6271 "CLOSE_TRADE_TYPE_MISSING" => Self::CloseTradeTypeMissing,
6272 "CLOSE_TRADE_PARTIAL_UNITS_MISSING" => Self::CloseTradePartialUnitsMissing,
6273 "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE" => Self::CloseTradeUnitsExceedTradeSize,
6274 "CLOSEOUT_POSITION_DOESNT_EXIST" => Self::CloseoutPositionDoesntExist,
6275 "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION" => {
6276 Self::CloseoutPositionIncompleteSpecification
6277 }
6278 "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE" => {
6279 Self::CloseoutPositionUnitsExceedPositionSize
6280 }
6281 "CLOSEOUT_POSITION_REJECT" => Self::CloseoutPositionReject,
6282 "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING" => Self::CloseoutPositionPartialUnitsMissing,
6283 "MARKUP_GROUP_ID_INVALID" => Self::MarkupGroupIdInvalid,
6284 "POSITION_AGGREGATION_MODE_INVALID" => Self::PositionAggregationModeInvalid,
6285 "ADMIN_CONFIGURE_DATA_MISSING" => Self::AdminConfigureDataMissing,
6286 "MARGIN_RATE_INVALID" => Self::MarginRateInvalid,
6287 "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT" => Self::MarginRateWouldTriggerCloseout,
6288 "ALIAS_INVALID" => Self::AliasInvalid,
6289 "CLIENT_CONFIGURE_DATA_MISSING" => Self::ClientConfigureDataMissing,
6290 "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL" => Self::MarginRateWouldTriggerMarginCall,
6291 "AMOUNT_INVALID" => Self::AmountInvalid,
6292 "INSUFFICIENT_FUNDS" => Self::InsufficientFunds,
6293 "AMOUNT_MISSING" => Self::AmountMissing,
6294 "FUNDING_REASON_MISSING" => Self::FundingReasonMissing,
6295 "OCA_ORDER_IDS_STOP_LOSS_NOT_ALLOWED" => Self::OcaOrderIdsStopLossNotAllowed,
6296 "CLIENT_EXTENSIONS_DATA_MISSING" => Self::ClientExtensionsDataMissing,
6297 "REPLACING_ORDER_INVALID" => Self::ReplacingOrderInvalid,
6298 "REPLACING_TRADE_ID_INVALID" => Self::ReplacingTradeIdInvalid,
6299 "ORDER_CANCEL_WOULD_TRIGGER_CLOSEOUT" => Self::OrderCancelWouldTriggerCloseout,
6300 _ => Self::Unknown(value),
6301 })
6302 }
6303}
6304
6305#[derive(Debug, Clone, PartialEq, Eq, Hash)]
6307#[non_exhaustive]
6308pub enum TransactionFilter {
6309 Order,
6311 Funding,
6313 Admin,
6315 Create,
6317 Close,
6319 Reopen,
6321 ClientConfigure,
6323 ClientConfigureReject,
6325 TransferFunds,
6327 TransferFundsReject,
6329 MarketOrder,
6331 MarketOrderReject,
6333 LimitOrder,
6335 LimitOrderReject,
6337 StopOrder,
6339 StopOrderReject,
6341 MarketIfTouchedOrder,
6343 MarketIfTouchedOrderReject,
6345 TakeProfitOrder,
6347 TakeProfitOrderReject,
6349 StopLossOrder,
6351 StopLossOrderReject,
6353 GuaranteedStopLossOrder,
6355 GuaranteedStopLossOrderReject,
6357 TrailingStopLossOrder,
6359 TrailingStopLossOrderReject,
6361 OneCancelsAllOrder,
6363 OneCancelsAllOrderReject,
6365 OneCancelsAllOrderTriggered,
6367 OrderFill,
6369 OrderCancel,
6371 OrderCancelReject,
6373 OrderClientExtensionsModify,
6375 OrderClientExtensionsModifyReject,
6377 TradeClientExtensionsModify,
6379 TradeClientExtensionsModifyReject,
6381 MarginCallEnter,
6383 MarginCallExtend,
6385 MarginCallExit,
6387 DelayedTradeClosure,
6389 DailyFinancing,
6391 ResetResettablePl,
6393 Unknown(String),
6395}
6396
6397impl TransactionFilter {
6398 pub fn as_str(&self) -> &str {
6400 match self {
6401 Self::Order => "ORDER",
6402 Self::Funding => "FUNDING",
6403 Self::Admin => "ADMIN",
6404 Self::Create => "CREATE",
6405 Self::Close => "CLOSE",
6406 Self::Reopen => "REOPEN",
6407 Self::ClientConfigure => "CLIENT_CONFIGURE",
6408 Self::ClientConfigureReject => "CLIENT_CONFIGURE_REJECT",
6409 Self::TransferFunds => "TRANSFER_FUNDS",
6410 Self::TransferFundsReject => "TRANSFER_FUNDS_REJECT",
6411 Self::MarketOrder => "MARKET_ORDER",
6412 Self::MarketOrderReject => "MARKET_ORDER_REJECT",
6413 Self::LimitOrder => "LIMIT_ORDER",
6414 Self::LimitOrderReject => "LIMIT_ORDER_REJECT",
6415 Self::StopOrder => "STOP_ORDER",
6416 Self::StopOrderReject => "STOP_ORDER_REJECT",
6417 Self::MarketIfTouchedOrder => "MARKET_IF_TOUCHED_ORDER",
6418 Self::MarketIfTouchedOrderReject => "MARKET_IF_TOUCHED_ORDER_REJECT",
6419 Self::TakeProfitOrder => "TAKE_PROFIT_ORDER",
6420 Self::TakeProfitOrderReject => "TAKE_PROFIT_ORDER_REJECT",
6421 Self::StopLossOrder => "STOP_LOSS_ORDER",
6422 Self::StopLossOrderReject => "STOP_LOSS_ORDER_REJECT",
6423 Self::GuaranteedStopLossOrder => "GUARANTEED_STOP_LOSS_ORDER",
6424 Self::GuaranteedStopLossOrderReject => "GUARANTEED_STOP_LOSS_ORDER_REJECT",
6425 Self::TrailingStopLossOrder => "TRAILING_STOP_LOSS_ORDER",
6426 Self::TrailingStopLossOrderReject => "TRAILING_STOP_LOSS_ORDER_REJECT",
6427 Self::OneCancelsAllOrder => "ONE_CANCELS_ALL_ORDER",
6428 Self::OneCancelsAllOrderReject => "ONE_CANCELS_ALL_ORDER_REJECT",
6429 Self::OneCancelsAllOrderTriggered => "ONE_CANCELS_ALL_ORDER_TRIGGERED",
6430 Self::OrderFill => "ORDER_FILL",
6431 Self::OrderCancel => "ORDER_CANCEL",
6432 Self::OrderCancelReject => "ORDER_CANCEL_REJECT",
6433 Self::OrderClientExtensionsModify => "ORDER_CLIENT_EXTENSIONS_MODIFY",
6434 Self::OrderClientExtensionsModifyReject => "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT",
6435 Self::TradeClientExtensionsModify => "TRADE_CLIENT_EXTENSIONS_MODIFY",
6436 Self::TradeClientExtensionsModifyReject => "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT",
6437 Self::MarginCallEnter => "MARGIN_CALL_ENTER",
6438 Self::MarginCallExtend => "MARGIN_CALL_EXTEND",
6439 Self::MarginCallExit => "MARGIN_CALL_EXIT",
6440 Self::DelayedTradeClosure => "DELAYED_TRADE_CLOSURE",
6441 Self::DailyFinancing => "DAILY_FINANCING",
6442 Self::ResetResettablePl => "RESET_RESETTABLE_PL",
6443 Self::Unknown(value) => value,
6444 }
6445 }
6446}
6447
6448impl Serialize for TransactionFilter {
6449 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
6450 serializer.serialize_str(self.as_str())
6451 }
6452}
6453
6454impl<'de> Deserialize<'de> for TransactionFilter {
6455 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6456 let value = String::deserialize(deserializer)?;
6457 Ok(match value.as_str() {
6458 "ORDER" => Self::Order,
6459 "FUNDING" => Self::Funding,
6460 "ADMIN" => Self::Admin,
6461 "CREATE" => Self::Create,
6462 "CLOSE" => Self::Close,
6463 "REOPEN" => Self::Reopen,
6464 "CLIENT_CONFIGURE" => Self::ClientConfigure,
6465 "CLIENT_CONFIGURE_REJECT" => Self::ClientConfigureReject,
6466 "TRANSFER_FUNDS" => Self::TransferFunds,
6467 "TRANSFER_FUNDS_REJECT" => Self::TransferFundsReject,
6468 "MARKET_ORDER" => Self::MarketOrder,
6469 "MARKET_ORDER_REJECT" => Self::MarketOrderReject,
6470 "LIMIT_ORDER" => Self::LimitOrder,
6471 "LIMIT_ORDER_REJECT" => Self::LimitOrderReject,
6472 "STOP_ORDER" => Self::StopOrder,
6473 "STOP_ORDER_REJECT" => Self::StopOrderReject,
6474 "MARKET_IF_TOUCHED_ORDER" => Self::MarketIfTouchedOrder,
6475 "MARKET_IF_TOUCHED_ORDER_REJECT" => Self::MarketIfTouchedOrderReject,
6476 "TAKE_PROFIT_ORDER" => Self::TakeProfitOrder,
6477 "TAKE_PROFIT_ORDER_REJECT" => Self::TakeProfitOrderReject,
6478 "STOP_LOSS_ORDER" => Self::StopLossOrder,
6479 "STOP_LOSS_ORDER_REJECT" => Self::StopLossOrderReject,
6480 "GUARANTEED_STOP_LOSS_ORDER" => Self::GuaranteedStopLossOrder,
6481 "GUARANTEED_STOP_LOSS_ORDER_REJECT" => Self::GuaranteedStopLossOrderReject,
6482 "TRAILING_STOP_LOSS_ORDER" => Self::TrailingStopLossOrder,
6483 "TRAILING_STOP_LOSS_ORDER_REJECT" => Self::TrailingStopLossOrderReject,
6484 "ONE_CANCELS_ALL_ORDER" => Self::OneCancelsAllOrder,
6485 "ONE_CANCELS_ALL_ORDER_REJECT" => Self::OneCancelsAllOrderReject,
6486 "ONE_CANCELS_ALL_ORDER_TRIGGERED" => Self::OneCancelsAllOrderTriggered,
6487 "ORDER_FILL" => Self::OrderFill,
6488 "ORDER_CANCEL" => Self::OrderCancel,
6489 "ORDER_CANCEL_REJECT" => Self::OrderCancelReject,
6490 "ORDER_CLIENT_EXTENSIONS_MODIFY" => Self::OrderClientExtensionsModify,
6491 "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT" => Self::OrderClientExtensionsModifyReject,
6492 "TRADE_CLIENT_EXTENSIONS_MODIFY" => Self::TradeClientExtensionsModify,
6493 "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT" => Self::TradeClientExtensionsModifyReject,
6494 "MARGIN_CALL_ENTER" => Self::MarginCallEnter,
6495 "MARGIN_CALL_EXTEND" => Self::MarginCallExtend,
6496 "MARGIN_CALL_EXIT" => Self::MarginCallExit,
6497 "DELAYED_TRADE_CLOSURE" => Self::DelayedTradeClosure,
6498 "DAILY_FINANCING" => Self::DailyFinancing,
6499 "RESET_RESETTABLE_PL" => Self::ResetResettablePl,
6500 _ => Self::Unknown(value),
6501 })
6502 }
6503}
6504
6505#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6508#[serde(rename_all = "camelCase")]
6509pub struct TransactionHeartbeat {
6510 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
6512 pub r#type: Option<String>,
6513 #[serde(
6515 rename = "lastTransactionID",
6516 default,
6517 skip_serializing_if = "Option::is_none"
6518 )]
6519 pub last_transaction_id: Option<TransactionID>,
6520 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
6522 pub time: Option<Timestamp>,
6523}