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")]
490 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
491 pub units: Decimal,
492 #[serde(rename = "timeInForce")]
494 pub time_in_force: TimeInForce,
495 #[serde(
497 rename = "priceBound",
498 default,
499 skip_serializing_if = "Option::is_none"
500 )]
501 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
502 pub price_bound: Option<Decimal>,
503 #[serde(rename = "positionFill")]
505 pub position_fill: OrderPositionFill,
506 #[serde(
509 rename = "tradeClose",
510 default,
511 skip_serializing_if = "Option::is_none"
512 )]
513 pub trade_close: Option<MarketOrderTradeClose>,
514 #[serde(
517 rename = "longPositionCloseout",
518 default,
519 skip_serializing_if = "Option::is_none"
520 )]
521 pub long_position_closeout: Option<MarketOrderPositionCloseout>,
522 #[serde(
525 rename = "shortPositionCloseout",
526 default,
527 skip_serializing_if = "Option::is_none"
528 )]
529 pub short_position_closeout: Option<MarketOrderPositionCloseout>,
530 #[serde(
532 rename = "marginCloseout",
533 default,
534 skip_serializing_if = "Option::is_none"
535 )]
536 pub margin_closeout: Option<MarketOrderMarginCloseout>,
537 #[serde(
539 rename = "delayedTradeClose",
540 default,
541 skip_serializing_if = "Option::is_none"
542 )]
543 pub delayed_trade_close: Option<MarketOrderDelayedTradeClose>,
544 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
546 pub reason: Option<MarketOrderReason>,
547 #[serde(
550 rename = "clientExtensions",
551 default,
552 skip_serializing_if = "Option::is_none"
553 )]
554 pub client_extensions: Option<ClientExtensions>,
555 #[serde(
558 rename = "takeProfitOnFill",
559 default,
560 skip_serializing_if = "Option::is_none"
561 )]
562 pub take_profit_on_fill: Option<TakeProfitDetails>,
563 #[serde(
566 rename = "stopLossOnFill",
567 default,
568 skip_serializing_if = "Option::is_none"
569 )]
570 pub stop_loss_on_fill: Option<StopLossDetails>,
571 #[serde(
574 rename = "trailingStopLossOnFill",
575 default,
576 skip_serializing_if = "Option::is_none"
577 )]
578 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
579 #[serde(
582 rename = "guaranteedStopLossOnFill",
583 default,
584 skip_serializing_if = "Option::is_none"
585 )]
586 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
587 #[serde(
590 rename = "tradeClientExtensions",
591 default,
592 skip_serializing_if = "Option::is_none"
593 )]
594 pub trade_client_extensions: Option<ClientExtensions>,
595 #[serde(
597 rename = "rejectReason",
598 default,
599 skip_serializing_if = "Option::is_none"
600 )]
601 pub reject_reason: Option<TransactionRejectReason>,
602}
603
604#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
607#[serde(rename_all = "camelCase")]
608pub struct FixedPriceOrderTransaction {
609 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
611 pub id: Option<TransactionID>,
612 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
614 pub time: Option<Timestamp>,
615 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
617 pub user_id: Option<i64>,
618 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
620 pub account_id: Option<AccountID>,
621 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
624 pub batch_id: Option<TransactionID>,
625 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
627 pub request_id: Option<RequestID>,
628 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
630 pub r#type: Option<TransactionType>,
631 #[serde(rename = "instrument")]
633 pub instrument: InstrumentName,
634 #[serde(rename = "units")]
637 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
638 pub units: Decimal,
639 #[serde(rename = "price")]
642 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
643 pub price: Decimal,
644 #[serde(rename = "positionFill")]
646 pub position_fill: OrderPositionFill,
647 #[serde(rename = "tradeState")]
649 pub trade_state: String,
650 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
652 pub reason: Option<FixedPriceOrderReason>,
653 #[serde(
655 rename = "clientExtensions",
656 default,
657 skip_serializing_if = "Option::is_none"
658 )]
659 pub client_extensions: Option<ClientExtensions>,
660 #[serde(
663 rename = "takeProfitOnFill",
664 default,
665 skip_serializing_if = "Option::is_none"
666 )]
667 pub take_profit_on_fill: Option<TakeProfitDetails>,
668 #[serde(
671 rename = "stopLossOnFill",
672 default,
673 skip_serializing_if = "Option::is_none"
674 )]
675 pub stop_loss_on_fill: Option<StopLossDetails>,
676 #[serde(
679 rename = "trailingStopLossOnFill",
680 default,
681 skip_serializing_if = "Option::is_none"
682 )]
683 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
684 #[serde(
687 rename = "guaranteedStopLossOnFill",
688 default,
689 skip_serializing_if = "Option::is_none"
690 )]
691 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
692 #[serde(
695 rename = "tradeClientExtensions",
696 default,
697 skip_serializing_if = "Option::is_none"
698 )]
699 pub trade_client_extensions: Option<ClientExtensions>,
700}
701
702#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
704#[serde(rename_all = "camelCase")]
705pub struct LimitOrderTransaction {
706 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
708 pub id: Option<TransactionID>,
709 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
711 pub time: Option<Timestamp>,
712 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
714 pub user_id: Option<i64>,
715 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
717 pub account_id: Option<AccountID>,
718 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
721 pub batch_id: Option<TransactionID>,
722 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
724 pub request_id: Option<RequestID>,
725 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
727 pub r#type: Option<TransactionType>,
728 #[serde(rename = "instrument")]
730 pub instrument: InstrumentName,
731 #[serde(rename = "units")]
734 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
735 pub units: Decimal,
736 #[serde(rename = "price")]
739 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
740 pub price: Decimal,
741 #[serde(rename = "timeInForce")]
743 pub time_in_force: TimeInForce,
744 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
746 pub gtd_time: Option<Timestamp>,
747 #[serde(rename = "positionFill")]
749 pub position_fill: OrderPositionFill,
750 #[serde(rename = "triggerCondition")]
763 pub trigger_condition: OrderTriggerCondition,
764 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
766 pub reason: Option<LimitOrderReason>,
767 #[serde(
770 rename = "clientExtensions",
771 default,
772 skip_serializing_if = "Option::is_none"
773 )]
774 pub client_extensions: Option<ClientExtensions>,
775 #[serde(
778 rename = "takeProfitOnFill",
779 default,
780 skip_serializing_if = "Option::is_none"
781 )]
782 pub take_profit_on_fill: Option<TakeProfitDetails>,
783 #[serde(
786 rename = "stopLossOnFill",
787 default,
788 skip_serializing_if = "Option::is_none"
789 )]
790 pub stop_loss_on_fill: Option<StopLossDetails>,
791 #[serde(
794 rename = "trailingStopLossOnFill",
795 default,
796 skip_serializing_if = "Option::is_none"
797 )]
798 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
799 #[serde(
802 rename = "guaranteedStopLossOnFill",
803 default,
804 skip_serializing_if = "Option::is_none"
805 )]
806 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
807 #[serde(
810 rename = "tradeClientExtensions",
811 default,
812 skip_serializing_if = "Option::is_none"
813 )]
814 pub trade_client_extensions: Option<ClientExtensions>,
815 #[serde(
817 rename = "replacesOrderID",
818 default,
819 skip_serializing_if = "Option::is_none"
820 )]
821 pub replaces_order_id: Option<OrderID>,
822 #[serde(
825 rename = "cancellingTransactionID",
826 default,
827 skip_serializing_if = "Option::is_none"
828 )]
829 pub cancelling_transaction_id: Option<TransactionID>,
830}
831
832#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
834#[serde(rename_all = "camelCase")]
835pub struct LimitOrderRejectTransaction {
836 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
838 pub id: Option<TransactionID>,
839 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
841 pub time: Option<Timestamp>,
842 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
844 pub user_id: Option<i64>,
845 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
847 pub account_id: Option<AccountID>,
848 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
851 pub batch_id: Option<TransactionID>,
852 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
854 pub request_id: Option<RequestID>,
855 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
857 pub r#type: Option<TransactionType>,
858 #[serde(rename = "instrument")]
860 pub instrument: InstrumentName,
861 #[serde(rename = "units")]
864 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
865 pub units: Decimal,
866 #[serde(rename = "price")]
869 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
870 pub price: Decimal,
871 #[serde(rename = "timeInForce")]
873 pub time_in_force: TimeInForce,
874 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
876 pub gtd_time: Option<Timestamp>,
877 #[serde(rename = "positionFill")]
879 pub position_fill: OrderPositionFill,
880 #[serde(rename = "triggerCondition")]
893 pub trigger_condition: OrderTriggerCondition,
894 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
896 pub reason: Option<LimitOrderReason>,
897 #[serde(
900 rename = "clientExtensions",
901 default,
902 skip_serializing_if = "Option::is_none"
903 )]
904 pub client_extensions: Option<ClientExtensions>,
905 #[serde(
908 rename = "takeProfitOnFill",
909 default,
910 skip_serializing_if = "Option::is_none"
911 )]
912 pub take_profit_on_fill: Option<TakeProfitDetails>,
913 #[serde(
916 rename = "stopLossOnFill",
917 default,
918 skip_serializing_if = "Option::is_none"
919 )]
920 pub stop_loss_on_fill: Option<StopLossDetails>,
921 #[serde(
924 rename = "trailingStopLossOnFill",
925 default,
926 skip_serializing_if = "Option::is_none"
927 )]
928 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
929 #[serde(
932 rename = "guaranteedStopLossOnFill",
933 default,
934 skip_serializing_if = "Option::is_none"
935 )]
936 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
937 #[serde(
940 rename = "tradeClientExtensions",
941 default,
942 skip_serializing_if = "Option::is_none"
943 )]
944 pub trade_client_extensions: Option<ClientExtensions>,
945 #[serde(
948 rename = "intendedReplacesOrderID",
949 default,
950 skip_serializing_if = "Option::is_none"
951 )]
952 pub intended_replaces_order_id: Option<OrderID>,
953 #[serde(
955 rename = "rejectReason",
956 default,
957 skip_serializing_if = "Option::is_none"
958 )]
959 pub reject_reason: Option<TransactionRejectReason>,
960}
961
962#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
964#[serde(rename_all = "camelCase")]
965pub struct StopOrderTransaction {
966 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
968 pub id: Option<TransactionID>,
969 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
971 pub time: Option<Timestamp>,
972 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
974 pub user_id: Option<i64>,
975 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
977 pub account_id: Option<AccountID>,
978 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
981 pub batch_id: Option<TransactionID>,
982 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
984 pub request_id: Option<RequestID>,
985 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
987 pub r#type: Option<TransactionType>,
988 #[serde(rename = "instrument")]
990 pub instrument: InstrumentName,
991 #[serde(rename = "units")]
994 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
995 pub units: Decimal,
996 #[serde(rename = "price")]
999 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1000 pub price: Decimal,
1001 #[serde(
1004 rename = "priceBound",
1005 default,
1006 skip_serializing_if = "Option::is_none"
1007 )]
1008 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1009 pub price_bound: Option<Decimal>,
1010 #[serde(rename = "timeInForce")]
1012 pub time_in_force: TimeInForce,
1013 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1015 pub gtd_time: Option<Timestamp>,
1016 #[serde(rename = "positionFill")]
1018 pub position_fill: OrderPositionFill,
1019 #[serde(rename = "triggerCondition")]
1032 pub trigger_condition: OrderTriggerCondition,
1033 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1035 pub reason: Option<StopOrderReason>,
1036 #[serde(
1039 rename = "clientExtensions",
1040 default,
1041 skip_serializing_if = "Option::is_none"
1042 )]
1043 pub client_extensions: Option<ClientExtensions>,
1044 #[serde(
1047 rename = "takeProfitOnFill",
1048 default,
1049 skip_serializing_if = "Option::is_none"
1050 )]
1051 pub take_profit_on_fill: Option<TakeProfitDetails>,
1052 #[serde(
1055 rename = "stopLossOnFill",
1056 default,
1057 skip_serializing_if = "Option::is_none"
1058 )]
1059 pub stop_loss_on_fill: Option<StopLossDetails>,
1060 #[serde(
1063 rename = "trailingStopLossOnFill",
1064 default,
1065 skip_serializing_if = "Option::is_none"
1066 )]
1067 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
1068 #[serde(
1071 rename = "guaranteedStopLossOnFill",
1072 default,
1073 skip_serializing_if = "Option::is_none"
1074 )]
1075 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
1076 #[serde(
1079 rename = "tradeClientExtensions",
1080 default,
1081 skip_serializing_if = "Option::is_none"
1082 )]
1083 pub trade_client_extensions: Option<ClientExtensions>,
1084 #[serde(
1086 rename = "replacesOrderID",
1087 default,
1088 skip_serializing_if = "Option::is_none"
1089 )]
1090 pub replaces_order_id: Option<OrderID>,
1091 #[serde(
1094 rename = "cancellingTransactionID",
1095 default,
1096 skip_serializing_if = "Option::is_none"
1097 )]
1098 pub cancelling_transaction_id: Option<TransactionID>,
1099}
1100
1101#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1103#[serde(rename_all = "camelCase")]
1104pub struct StopOrderRejectTransaction {
1105 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1107 pub id: Option<TransactionID>,
1108 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1110 pub time: Option<Timestamp>,
1111 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1113 pub user_id: Option<i64>,
1114 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1116 pub account_id: Option<AccountID>,
1117 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1120 pub batch_id: Option<TransactionID>,
1121 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1123 pub request_id: Option<RequestID>,
1124 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1126 pub r#type: Option<TransactionType>,
1127 #[serde(rename = "instrument")]
1129 pub instrument: InstrumentName,
1130 #[serde(rename = "units")]
1133 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1134 pub units: Decimal,
1135 #[serde(rename = "price")]
1138 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1139 pub price: Decimal,
1140 #[serde(
1143 rename = "priceBound",
1144 default,
1145 skip_serializing_if = "Option::is_none"
1146 )]
1147 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1148 pub price_bound: Option<Decimal>,
1149 #[serde(rename = "timeInForce")]
1151 pub time_in_force: TimeInForce,
1152 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1154 pub gtd_time: Option<Timestamp>,
1155 #[serde(rename = "positionFill")]
1157 pub position_fill: OrderPositionFill,
1158 #[serde(rename = "triggerCondition")]
1171 pub trigger_condition: OrderTriggerCondition,
1172 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1174 pub reason: Option<StopOrderReason>,
1175 #[serde(
1178 rename = "clientExtensions",
1179 default,
1180 skip_serializing_if = "Option::is_none"
1181 )]
1182 pub client_extensions: Option<ClientExtensions>,
1183 #[serde(
1186 rename = "takeProfitOnFill",
1187 default,
1188 skip_serializing_if = "Option::is_none"
1189 )]
1190 pub take_profit_on_fill: Option<TakeProfitDetails>,
1191 #[serde(
1194 rename = "stopLossOnFill",
1195 default,
1196 skip_serializing_if = "Option::is_none"
1197 )]
1198 pub stop_loss_on_fill: Option<StopLossDetails>,
1199 #[serde(
1202 rename = "trailingStopLossOnFill",
1203 default,
1204 skip_serializing_if = "Option::is_none"
1205 )]
1206 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
1207 #[serde(
1210 rename = "guaranteedStopLossOnFill",
1211 default,
1212 skip_serializing_if = "Option::is_none"
1213 )]
1214 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
1215 #[serde(
1218 rename = "tradeClientExtensions",
1219 default,
1220 skip_serializing_if = "Option::is_none"
1221 )]
1222 pub trade_client_extensions: Option<ClientExtensions>,
1223 #[serde(
1226 rename = "intendedReplacesOrderID",
1227 default,
1228 skip_serializing_if = "Option::is_none"
1229 )]
1230 pub intended_replaces_order_id: Option<OrderID>,
1231 #[serde(
1233 rename = "rejectReason",
1234 default,
1235 skip_serializing_if = "Option::is_none"
1236 )]
1237 pub reject_reason: Option<TransactionRejectReason>,
1238}
1239
1240#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1243#[serde(rename_all = "camelCase")]
1244pub struct MarketIfTouchedOrderTransaction {
1245 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1247 pub id: Option<TransactionID>,
1248 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1250 pub time: Option<Timestamp>,
1251 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1253 pub user_id: Option<i64>,
1254 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1256 pub account_id: Option<AccountID>,
1257 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1260 pub batch_id: Option<TransactionID>,
1261 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1263 pub request_id: Option<RequestID>,
1264 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1267 pub r#type: Option<TransactionType>,
1268 #[serde(rename = "instrument")]
1270 pub instrument: InstrumentName,
1271 #[serde(rename = "units")]
1274 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1275 pub units: Decimal,
1276 #[serde(rename = "price")]
1281 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1282 pub price: Decimal,
1283 #[serde(
1285 rename = "priceBound",
1286 default,
1287 skip_serializing_if = "Option::is_none"
1288 )]
1289 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1290 pub price_bound: Option<Decimal>,
1291 #[serde(rename = "timeInForce")]
1294 pub time_in_force: TimeInForce,
1295 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1297 pub gtd_time: Option<Timestamp>,
1298 #[serde(rename = "positionFill")]
1300 pub position_fill: OrderPositionFill,
1301 #[serde(rename = "triggerCondition")]
1314 pub trigger_condition: OrderTriggerCondition,
1315 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1317 pub reason: Option<MarketIfTouchedOrderReason>,
1318 #[serde(
1321 rename = "clientExtensions",
1322 default,
1323 skip_serializing_if = "Option::is_none"
1324 )]
1325 pub client_extensions: Option<ClientExtensions>,
1326 #[serde(
1329 rename = "takeProfitOnFill",
1330 default,
1331 skip_serializing_if = "Option::is_none"
1332 )]
1333 pub take_profit_on_fill: Option<TakeProfitDetails>,
1334 #[serde(
1337 rename = "stopLossOnFill",
1338 default,
1339 skip_serializing_if = "Option::is_none"
1340 )]
1341 pub stop_loss_on_fill: Option<StopLossDetails>,
1342 #[serde(
1345 rename = "trailingStopLossOnFill",
1346 default,
1347 skip_serializing_if = "Option::is_none"
1348 )]
1349 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
1350 #[serde(
1353 rename = "guaranteedStopLossOnFill",
1354 default,
1355 skip_serializing_if = "Option::is_none"
1356 )]
1357 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
1358 #[serde(
1361 rename = "tradeClientExtensions",
1362 default,
1363 skip_serializing_if = "Option::is_none"
1364 )]
1365 pub trade_client_extensions: Option<ClientExtensions>,
1366 #[serde(
1368 rename = "replacesOrderID",
1369 default,
1370 skip_serializing_if = "Option::is_none"
1371 )]
1372 pub replaces_order_id: Option<OrderID>,
1373 #[serde(
1376 rename = "cancellingTransactionID",
1377 default,
1378 skip_serializing_if = "Option::is_none"
1379 )]
1380 pub cancelling_transaction_id: Option<TransactionID>,
1381}
1382
1383#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1386#[serde(rename_all = "camelCase")]
1387pub struct MarketIfTouchedOrderRejectTransaction {
1388 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1390 pub id: Option<TransactionID>,
1391 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1393 pub time: Option<Timestamp>,
1394 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1396 pub user_id: Option<i64>,
1397 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1399 pub account_id: Option<AccountID>,
1400 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1403 pub batch_id: Option<TransactionID>,
1404 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1406 pub request_id: Option<RequestID>,
1407 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1410 pub r#type: Option<TransactionType>,
1411 #[serde(rename = "instrument")]
1413 pub instrument: InstrumentName,
1414 #[serde(rename = "units")]
1417 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1418 pub units: Decimal,
1419 #[serde(rename = "price")]
1424 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1425 pub price: Decimal,
1426 #[serde(
1428 rename = "priceBound",
1429 default,
1430 skip_serializing_if = "Option::is_none"
1431 )]
1432 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1433 pub price_bound: Option<Decimal>,
1434 #[serde(rename = "timeInForce")]
1437 pub time_in_force: TimeInForce,
1438 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1440 pub gtd_time: Option<Timestamp>,
1441 #[serde(rename = "positionFill")]
1443 pub position_fill: OrderPositionFill,
1444 #[serde(rename = "triggerCondition")]
1457 pub trigger_condition: OrderTriggerCondition,
1458 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1460 pub reason: Option<MarketIfTouchedOrderReason>,
1461 #[serde(
1464 rename = "clientExtensions",
1465 default,
1466 skip_serializing_if = "Option::is_none"
1467 )]
1468 pub client_extensions: Option<ClientExtensions>,
1469 #[serde(
1472 rename = "takeProfitOnFill",
1473 default,
1474 skip_serializing_if = "Option::is_none"
1475 )]
1476 pub take_profit_on_fill: Option<TakeProfitDetails>,
1477 #[serde(
1480 rename = "stopLossOnFill",
1481 default,
1482 skip_serializing_if = "Option::is_none"
1483 )]
1484 pub stop_loss_on_fill: Option<StopLossDetails>,
1485 #[serde(
1488 rename = "trailingStopLossOnFill",
1489 default,
1490 skip_serializing_if = "Option::is_none"
1491 )]
1492 pub trailing_stop_loss_on_fill: Option<TrailingStopLossDetails>,
1493 #[serde(
1496 rename = "guaranteedStopLossOnFill",
1497 default,
1498 skip_serializing_if = "Option::is_none"
1499 )]
1500 pub guaranteed_stop_loss_on_fill: Option<GuaranteedStopLossDetails>,
1501 #[serde(
1504 rename = "tradeClientExtensions",
1505 default,
1506 skip_serializing_if = "Option::is_none"
1507 )]
1508 pub trade_client_extensions: Option<ClientExtensions>,
1509 #[serde(
1512 rename = "intendedReplacesOrderID",
1513 default,
1514 skip_serializing_if = "Option::is_none"
1515 )]
1516 pub intended_replaces_order_id: Option<OrderID>,
1517 #[serde(
1519 rename = "rejectReason",
1520 default,
1521 skip_serializing_if = "Option::is_none"
1522 )]
1523 pub reject_reason: Option<TransactionRejectReason>,
1524}
1525
1526#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1528#[serde(rename_all = "camelCase")]
1529pub struct TakeProfitOrderTransaction {
1530 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1532 pub id: Option<TransactionID>,
1533 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1535 pub time: Option<Timestamp>,
1536 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1538 pub user_id: Option<i64>,
1539 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1541 pub account_id: Option<AccountID>,
1542 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1545 pub batch_id: Option<TransactionID>,
1546 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1548 pub request_id: Option<RequestID>,
1549 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1551 pub r#type: Option<TransactionType>,
1552 #[serde(rename = "tradeID")]
1554 pub trade_id: TradeID,
1555 #[serde(
1557 rename = "clientTradeID",
1558 default,
1559 skip_serializing_if = "Option::is_none"
1560 )]
1561 pub client_trade_id: Option<ClientID>,
1562 #[serde(rename = "price")]
1565 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1566 pub price: Decimal,
1567 #[serde(rename = "timeInForce")]
1570 pub time_in_force: TimeInForce,
1571 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1573 pub gtd_time: Option<Timestamp>,
1574 #[serde(rename = "triggerCondition")]
1587 pub trigger_condition: OrderTriggerCondition,
1588 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1590 pub reason: Option<TakeProfitOrderReason>,
1591 #[serde(
1594 rename = "clientExtensions",
1595 default,
1596 skip_serializing_if = "Option::is_none"
1597 )]
1598 pub client_extensions: Option<ClientExtensions>,
1599 #[serde(
1602 rename = "orderFillTransactionID",
1603 default,
1604 skip_serializing_if = "Option::is_none"
1605 )]
1606 pub order_fill_transaction_id: Option<TransactionID>,
1607 #[serde(
1609 rename = "replacesOrderID",
1610 default,
1611 skip_serializing_if = "Option::is_none"
1612 )]
1613 pub replaces_order_id: Option<OrderID>,
1614 #[serde(
1617 rename = "cancellingTransactionID",
1618 default,
1619 skip_serializing_if = "Option::is_none"
1620 )]
1621 pub cancelling_transaction_id: Option<TransactionID>,
1622}
1623
1624#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1626#[serde(rename_all = "camelCase")]
1627pub struct TakeProfitOrderRejectTransaction {
1628 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1630 pub id: Option<TransactionID>,
1631 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1633 pub time: Option<Timestamp>,
1634 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1636 pub user_id: Option<i64>,
1637 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1639 pub account_id: Option<AccountID>,
1640 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1643 pub batch_id: Option<TransactionID>,
1644 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1646 pub request_id: Option<RequestID>,
1647 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1650 pub r#type: Option<TransactionType>,
1651 #[serde(rename = "tradeID")]
1653 pub trade_id: TradeID,
1654 #[serde(
1656 rename = "clientTradeID",
1657 default,
1658 skip_serializing_if = "Option::is_none"
1659 )]
1660 pub client_trade_id: Option<ClientID>,
1661 #[serde(rename = "price")]
1664 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1665 pub price: Decimal,
1666 #[serde(rename = "timeInForce")]
1669 pub time_in_force: TimeInForce,
1670 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1672 pub gtd_time: Option<Timestamp>,
1673 #[serde(rename = "triggerCondition")]
1686 pub trigger_condition: OrderTriggerCondition,
1687 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1689 pub reason: Option<TakeProfitOrderReason>,
1690 #[serde(
1693 rename = "clientExtensions",
1694 default,
1695 skip_serializing_if = "Option::is_none"
1696 )]
1697 pub client_extensions: Option<ClientExtensions>,
1698 #[serde(
1701 rename = "orderFillTransactionID",
1702 default,
1703 skip_serializing_if = "Option::is_none"
1704 )]
1705 pub order_fill_transaction_id: Option<TransactionID>,
1706 #[serde(
1709 rename = "intendedReplacesOrderID",
1710 default,
1711 skip_serializing_if = "Option::is_none"
1712 )]
1713 pub intended_replaces_order_id: Option<OrderID>,
1714 #[serde(
1716 rename = "rejectReason",
1717 default,
1718 skip_serializing_if = "Option::is_none"
1719 )]
1720 pub reject_reason: Option<TransactionRejectReason>,
1721}
1722
1723#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1725#[serde(rename_all = "camelCase")]
1726pub struct StopLossOrderTransaction {
1727 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1729 pub id: Option<TransactionID>,
1730 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1732 pub time: Option<Timestamp>,
1733 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1735 pub user_id: Option<i64>,
1736 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1738 pub account_id: Option<AccountID>,
1739 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1742 pub batch_id: Option<TransactionID>,
1743 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1745 pub request_id: Option<RequestID>,
1746 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1748 pub r#type: Option<TransactionType>,
1749 #[serde(rename = "tradeID")]
1751 pub trade_id: TradeID,
1752 #[serde(
1754 rename = "clientTradeID",
1755 default,
1756 skip_serializing_if = "Option::is_none"
1757 )]
1758 pub client_trade_id: Option<ClientID>,
1759 #[serde(rename = "price")]
1762 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1763 pub price: Decimal,
1764 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
1767 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1768 pub distance: Option<Decimal>,
1769 #[serde(rename = "timeInForce")]
1772 pub time_in_force: TimeInForce,
1773 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1775 pub gtd_time: Option<Timestamp>,
1776 #[serde(rename = "triggerCondition")]
1789 pub trigger_condition: OrderTriggerCondition,
1790 #[serde(
1794 rename = "guaranteed",
1795 default,
1796 skip_serializing_if = "Option::is_none"
1797 )]
1798 pub guaranteed: Option<bool>,
1799 #[serde(
1803 rename = "guaranteedExecutionPremium",
1804 default,
1805 skip_serializing_if = "Option::is_none"
1806 )]
1807 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1808 pub guaranteed_execution_premium: Option<Decimal>,
1809 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1811 pub reason: Option<StopLossOrderReason>,
1812 #[serde(
1815 rename = "clientExtensions",
1816 default,
1817 skip_serializing_if = "Option::is_none"
1818 )]
1819 pub client_extensions: Option<ClientExtensions>,
1820 #[serde(
1823 rename = "orderFillTransactionID",
1824 default,
1825 skip_serializing_if = "Option::is_none"
1826 )]
1827 pub order_fill_transaction_id: Option<TransactionID>,
1828 #[serde(
1830 rename = "replacesOrderID",
1831 default,
1832 skip_serializing_if = "Option::is_none"
1833 )]
1834 pub replaces_order_id: Option<OrderID>,
1835 #[serde(
1838 rename = "cancellingTransactionID",
1839 default,
1840 skip_serializing_if = "Option::is_none"
1841 )]
1842 pub cancelling_transaction_id: Option<TransactionID>,
1843}
1844
1845#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1847#[serde(rename_all = "camelCase")]
1848pub struct StopLossOrderRejectTransaction {
1849 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1851 pub id: Option<TransactionID>,
1852 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1854 pub time: Option<Timestamp>,
1855 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1857 pub user_id: Option<i64>,
1858 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1860 pub account_id: Option<AccountID>,
1861 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1864 pub batch_id: Option<TransactionID>,
1865 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1867 pub request_id: Option<RequestID>,
1868 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1870 pub r#type: Option<TransactionType>,
1871 #[serde(rename = "tradeID")]
1873 pub trade_id: TradeID,
1874 #[serde(
1876 rename = "clientTradeID",
1877 default,
1878 skip_serializing_if = "Option::is_none"
1879 )]
1880 pub client_trade_id: Option<ClientID>,
1881 #[serde(rename = "price")]
1884 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1885 pub price: Decimal,
1886 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
1889 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
1890 pub distance: Option<Decimal>,
1891 #[serde(rename = "timeInForce")]
1894 pub time_in_force: TimeInForce,
1895 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
1897 pub gtd_time: Option<Timestamp>,
1898 #[serde(rename = "triggerCondition")]
1911 pub trigger_condition: OrderTriggerCondition,
1912 #[serde(
1916 rename = "guaranteed",
1917 default,
1918 skip_serializing_if = "Option::is_none"
1919 )]
1920 pub guaranteed: Option<bool>,
1921 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
1923 pub reason: Option<StopLossOrderReason>,
1924 #[serde(
1927 rename = "clientExtensions",
1928 default,
1929 skip_serializing_if = "Option::is_none"
1930 )]
1931 pub client_extensions: Option<ClientExtensions>,
1932 #[serde(
1935 rename = "orderFillTransactionID",
1936 default,
1937 skip_serializing_if = "Option::is_none"
1938 )]
1939 pub order_fill_transaction_id: Option<TransactionID>,
1940 #[serde(
1943 rename = "intendedReplacesOrderID",
1944 default,
1945 skip_serializing_if = "Option::is_none"
1946 )]
1947 pub intended_replaces_order_id: Option<OrderID>,
1948 #[serde(
1950 rename = "rejectReason",
1951 default,
1952 skip_serializing_if = "Option::is_none"
1953 )]
1954 pub reject_reason: Option<TransactionRejectReason>,
1955}
1956
1957#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1960#[serde(rename_all = "camelCase")]
1961pub struct GuaranteedStopLossOrderTransaction {
1962 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
1964 pub id: Option<TransactionID>,
1965 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
1967 pub time: Option<Timestamp>,
1968 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
1970 pub user_id: Option<i64>,
1971 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
1973 pub account_id: Option<AccountID>,
1974 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
1977 pub batch_id: Option<TransactionID>,
1978 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
1980 pub request_id: Option<RequestID>,
1981 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1984 pub r#type: Option<TransactionType>,
1985 #[serde(rename = "tradeID")]
1987 pub trade_id: TradeID,
1988 #[serde(
1990 rename = "clientTradeID",
1991 default,
1992 skip_serializing_if = "Option::is_none"
1993 )]
1994 pub client_trade_id: Option<ClientID>,
1995 #[serde(rename = "price")]
1998 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
1999 pub price: Decimal,
2000 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
2004 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2005 pub distance: Option<Decimal>,
2006 #[serde(rename = "timeInForce")]
2009 pub time_in_force: TimeInForce,
2010 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
2012 pub gtd_time: Option<Timestamp>,
2013 #[serde(rename = "triggerCondition")]
2026 pub trigger_condition: OrderTriggerCondition,
2027 #[serde(
2031 rename = "guaranteedExecutionPremium",
2032 default,
2033 skip_serializing_if = "Option::is_none"
2034 )]
2035 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2036 pub guaranteed_execution_premium: Option<Decimal>,
2037 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2039 pub reason: Option<GuaranteedStopLossOrderReason>,
2040 #[serde(
2043 rename = "clientExtensions",
2044 default,
2045 skip_serializing_if = "Option::is_none"
2046 )]
2047 pub client_extensions: Option<ClientExtensions>,
2048 #[serde(
2051 rename = "orderFillTransactionID",
2052 default,
2053 skip_serializing_if = "Option::is_none"
2054 )]
2055 pub order_fill_transaction_id: Option<TransactionID>,
2056 #[serde(
2058 rename = "replacesOrderID",
2059 default,
2060 skip_serializing_if = "Option::is_none"
2061 )]
2062 pub replaces_order_id: Option<OrderID>,
2063 #[serde(
2066 rename = "cancellingTransactionID",
2067 default,
2068 skip_serializing_if = "Option::is_none"
2069 )]
2070 pub cancelling_transaction_id: Option<TransactionID>,
2071}
2072
2073#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2076#[serde(rename_all = "camelCase")]
2077pub struct GuaranteedStopLossOrderRejectTransaction {
2078 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2080 pub id: Option<TransactionID>,
2081 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2083 pub time: Option<Timestamp>,
2084 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2086 pub user_id: Option<i64>,
2087 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2089 pub account_id: Option<AccountID>,
2090 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2093 pub batch_id: Option<TransactionID>,
2094 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2096 pub request_id: Option<RequestID>,
2097 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2100 pub r#type: Option<TransactionType>,
2101 #[serde(rename = "tradeID")]
2103 pub trade_id: TradeID,
2104 #[serde(
2106 rename = "clientTradeID",
2107 default,
2108 skip_serializing_if = "Option::is_none"
2109 )]
2110 pub client_trade_id: Option<ClientID>,
2111 #[serde(rename = "price")]
2114 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
2115 pub price: Decimal,
2116 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
2120 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2121 pub distance: Option<Decimal>,
2122 #[serde(rename = "timeInForce")]
2125 pub time_in_force: TimeInForce,
2126 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
2128 pub gtd_time: Option<Timestamp>,
2129 #[serde(rename = "triggerCondition")]
2142 pub trigger_condition: OrderTriggerCondition,
2143 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2145 pub reason: Option<GuaranteedStopLossOrderReason>,
2146 #[serde(
2149 rename = "clientExtensions",
2150 default,
2151 skip_serializing_if = "Option::is_none"
2152 )]
2153 pub client_extensions: Option<ClientExtensions>,
2154 #[serde(
2157 rename = "orderFillTransactionID",
2158 default,
2159 skip_serializing_if = "Option::is_none"
2160 )]
2161 pub order_fill_transaction_id: Option<TransactionID>,
2162 #[serde(
2165 rename = "intendedReplacesOrderID",
2166 default,
2167 skip_serializing_if = "Option::is_none"
2168 )]
2169 pub intended_replaces_order_id: Option<OrderID>,
2170 #[serde(
2172 rename = "rejectReason",
2173 default,
2174 skip_serializing_if = "Option::is_none"
2175 )]
2176 pub reject_reason: Option<TransactionRejectReason>,
2177}
2178
2179#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2182#[serde(rename_all = "camelCase")]
2183pub struct TrailingStopLossOrderTransaction {
2184 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2186 pub id: Option<TransactionID>,
2187 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2189 pub time: Option<Timestamp>,
2190 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2192 pub user_id: Option<i64>,
2193 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2195 pub account_id: Option<AccountID>,
2196 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2199 pub batch_id: Option<TransactionID>,
2200 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2202 pub request_id: Option<RequestID>,
2203 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2206 pub r#type: Option<TransactionType>,
2207 #[serde(rename = "tradeID")]
2209 pub trade_id: TradeID,
2210 #[serde(
2212 rename = "clientTradeID",
2213 default,
2214 skip_serializing_if = "Option::is_none"
2215 )]
2216 pub client_trade_id: Option<ClientID>,
2217 #[serde(rename = "distance")]
2219 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
2220 pub distance: Decimal,
2221 #[serde(rename = "timeInForce")]
2224 pub time_in_force: TimeInForce,
2225 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
2227 pub gtd_time: Option<Timestamp>,
2228 #[serde(rename = "triggerCondition")]
2241 pub trigger_condition: OrderTriggerCondition,
2242 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2244 pub reason: Option<TrailingStopLossOrderReason>,
2245 #[serde(
2248 rename = "clientExtensions",
2249 default,
2250 skip_serializing_if = "Option::is_none"
2251 )]
2252 pub client_extensions: Option<ClientExtensions>,
2253 #[serde(
2256 rename = "orderFillTransactionID",
2257 default,
2258 skip_serializing_if = "Option::is_none"
2259 )]
2260 pub order_fill_transaction_id: Option<TransactionID>,
2261 #[serde(
2263 rename = "replacesOrderID",
2264 default,
2265 skip_serializing_if = "Option::is_none"
2266 )]
2267 pub replaces_order_id: Option<OrderID>,
2268 #[serde(
2271 rename = "cancellingTransactionID",
2272 default,
2273 skip_serializing_if = "Option::is_none"
2274 )]
2275 pub cancelling_transaction_id: Option<TransactionID>,
2276}
2277
2278#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2281#[serde(rename_all = "camelCase")]
2282pub struct TrailingStopLossOrderRejectTransaction {
2283 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2285 pub id: Option<TransactionID>,
2286 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2288 pub time: Option<Timestamp>,
2289 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2291 pub user_id: Option<i64>,
2292 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2294 pub account_id: Option<AccountID>,
2295 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2298 pub batch_id: Option<TransactionID>,
2299 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2301 pub request_id: Option<RequestID>,
2302 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2305 pub r#type: Option<TransactionType>,
2306 #[serde(rename = "tradeID")]
2308 pub trade_id: TradeID,
2309 #[serde(
2311 rename = "clientTradeID",
2312 default,
2313 skip_serializing_if = "Option::is_none"
2314 )]
2315 pub client_trade_id: Option<ClientID>,
2316 #[serde(rename = "distance")]
2318 #[serde(deserialize_with = "crate::decimal_wire::number_or_string")]
2319 pub distance: Decimal,
2320 #[serde(rename = "timeInForce")]
2323 pub time_in_force: TimeInForce,
2324 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
2326 pub gtd_time: Option<Timestamp>,
2327 #[serde(rename = "triggerCondition")]
2340 pub trigger_condition: OrderTriggerCondition,
2341 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2343 pub reason: Option<TrailingStopLossOrderReason>,
2344 #[serde(
2347 rename = "clientExtensions",
2348 default,
2349 skip_serializing_if = "Option::is_none"
2350 )]
2351 pub client_extensions: Option<ClientExtensions>,
2352 #[serde(
2355 rename = "orderFillTransactionID",
2356 default,
2357 skip_serializing_if = "Option::is_none"
2358 )]
2359 pub order_fill_transaction_id: Option<TransactionID>,
2360 #[serde(
2363 rename = "intendedReplacesOrderID",
2364 default,
2365 skip_serializing_if = "Option::is_none"
2366 )]
2367 pub intended_replaces_order_id: Option<OrderID>,
2368 #[serde(
2370 rename = "rejectReason",
2371 default,
2372 skip_serializing_if = "Option::is_none"
2373 )]
2374 pub reject_reason: Option<TransactionRejectReason>,
2375}
2376
2377#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2379#[serde(rename_all = "camelCase")]
2380pub struct OrderFillTransaction {
2381 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2383 pub id: Option<TransactionID>,
2384 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2386 pub time: Option<Timestamp>,
2387 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2389 pub user_id: Option<i64>,
2390 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2392 pub account_id: Option<AccountID>,
2393 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2396 pub batch_id: Option<TransactionID>,
2397 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2399 pub request_id: Option<RequestID>,
2400 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2402 pub r#type: Option<TransactionType>,
2403 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2405 pub order_id: Option<OrderID>,
2406 #[serde(
2408 rename = "clientOrderID",
2409 default,
2410 skip_serializing_if = "Option::is_none"
2411 )]
2412 pub client_order_id: Option<ClientID>,
2413 #[serde(
2415 rename = "instrument",
2416 default,
2417 skip_serializing_if = "Option::is_none"
2418 )]
2419 pub instrument: Option<InstrumentName>,
2420 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
2422 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2423 pub units: Option<Decimal>,
2424 #[serde(
2428 rename = "gainQuoteHomeConversionFactor",
2429 default,
2430 skip_serializing_if = "Option::is_none"
2431 )]
2432 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2433 pub gain_quote_home_conversion_factor: Option<Decimal>,
2434 #[serde(
2438 rename = "lossQuoteHomeConversionFactor",
2439 default,
2440 skip_serializing_if = "Option::is_none"
2441 )]
2442 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2443 pub loss_quote_home_conversion_factor: Option<Decimal>,
2444 #[serde(
2446 rename = "homeConversionFactors",
2447 default,
2448 skip_serializing_if = "Option::is_none"
2449 )]
2450 pub home_conversion_factors: Option<HomeConversionFactors>,
2451 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
2455 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2456 pub price: Option<Decimal>,
2457 #[serde(rename = "fullVWAP", default, skip_serializing_if = "Option::is_none")]
2463 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2464 pub full_vwap: Option<Decimal>,
2465 #[serde(rename = "fullPrice", default, skip_serializing_if = "Option::is_none")]
2467 pub full_price: Option<ClientPrice>,
2468 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2470 pub reason: Option<OrderFillReason>,
2471 #[serde(rename = "pl", default, skip_serializing_if = "Option::is_none")]
2473 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2474 pub pl: Option<Decimal>,
2475 #[serde(rename = "quotePL", default, skip_serializing_if = "Option::is_none")]
2477 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2478 pub quote_pl: Option<Decimal>,
2479 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
2481 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2482 pub financing: Option<Decimal>,
2483 #[serde(
2485 rename = "baseFinancing",
2486 default,
2487 skip_serializing_if = "Option::is_none"
2488 )]
2489 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2490 pub base_financing: Option<Decimal>,
2491 #[serde(
2493 rename = "quoteFinancing",
2494 default,
2495 skip_serializing_if = "Option::is_none"
2496 )]
2497 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2498 pub quote_financing: Option<Decimal>,
2499 #[serde(
2503 rename = "commission",
2504 default,
2505 skip_serializing_if = "Option::is_none"
2506 )]
2507 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2508 pub commission: Option<Decimal>,
2509 #[serde(
2512 rename = "guaranteedExecutionFee",
2513 default,
2514 skip_serializing_if = "Option::is_none"
2515 )]
2516 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2517 pub guaranteed_execution_fee: Option<Decimal>,
2518 #[serde(
2521 rename = "quoteGuaranteedExecutionFee",
2522 default,
2523 skip_serializing_if = "Option::is_none"
2524 )]
2525 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2526 pub quote_guaranteed_execution_fee: Option<Decimal>,
2527 #[serde(
2529 rename = "accountBalance",
2530 default,
2531 skip_serializing_if = "Option::is_none"
2532 )]
2533 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2534 pub account_balance: Option<Decimal>,
2535 #[serde(
2538 rename = "tradeOpened",
2539 default,
2540 skip_serializing_if = "Option::is_none"
2541 )]
2542 pub trade_opened: Option<TradeOpen>,
2543 #[serde(
2546 rename = "tradesClosed",
2547 default,
2548 skip_serializing_if = "Option::is_none"
2549 )]
2550 pub trades_closed: Option<Vec<TradeReduce>>,
2551 #[serde(
2554 rename = "tradeReduced",
2555 default,
2556 skip_serializing_if = "Option::is_none"
2557 )]
2558 pub trade_reduced: Option<TradeReduce>,
2559 #[serde(
2563 rename = "halfSpreadCost",
2564 default,
2565 skip_serializing_if = "Option::is_none"
2566 )]
2567 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
2568 pub half_spread_cost: Option<Decimal>,
2569}
2570
2571#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2573#[serde(rename_all = "camelCase")]
2574pub struct OrderCancelTransaction {
2575 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2577 pub id: Option<TransactionID>,
2578 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2580 pub time: Option<Timestamp>,
2581 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2583 pub user_id: Option<i64>,
2584 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2586 pub account_id: Option<AccountID>,
2587 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2590 pub batch_id: Option<TransactionID>,
2591 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2593 pub request_id: Option<RequestID>,
2594 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2596 pub r#type: Option<TransactionType>,
2597 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2599 pub order_id: Option<OrderID>,
2600 #[serde(
2602 rename = "clientOrderID",
2603 default,
2604 skip_serializing_if = "Option::is_none"
2605 )]
2606 pub client_order_id: Option<OrderID>,
2607 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
2609 pub reason: Option<OrderCancelReason>,
2610 #[serde(
2612 rename = "replacedByOrderID",
2613 default,
2614 skip_serializing_if = "Option::is_none"
2615 )]
2616 pub replaced_by_order_id: Option<OrderID>,
2617}
2618
2619#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2622#[serde(rename_all = "camelCase")]
2623pub struct OrderCancelRejectTransaction {
2624 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2626 pub id: Option<TransactionID>,
2627 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2629 pub time: Option<Timestamp>,
2630 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2632 pub user_id: Option<i64>,
2633 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2635 pub account_id: Option<AccountID>,
2636 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2639 pub batch_id: Option<TransactionID>,
2640 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2642 pub request_id: Option<RequestID>,
2643 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2645 pub r#type: Option<TransactionType>,
2646 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2648 pub order_id: Option<OrderID>,
2649 #[serde(
2651 rename = "clientOrderID",
2652 default,
2653 skip_serializing_if = "Option::is_none"
2654 )]
2655 pub client_order_id: Option<OrderID>,
2656 #[serde(
2658 rename = "rejectReason",
2659 default,
2660 skip_serializing_if = "Option::is_none"
2661 )]
2662 pub reject_reason: Option<TransactionRejectReason>,
2663}
2664
2665#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2667#[serde(rename_all = "camelCase")]
2668pub struct OrderClientExtensionsModifyTransaction {
2669 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2671 pub id: Option<TransactionID>,
2672 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2674 pub time: Option<Timestamp>,
2675 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2677 pub user_id: Option<i64>,
2678 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2680 pub account_id: Option<AccountID>,
2681 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2684 pub batch_id: Option<TransactionID>,
2685 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2687 pub request_id: Option<RequestID>,
2688 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2691 pub r#type: Option<TransactionType>,
2692 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2694 pub order_id: Option<OrderID>,
2695 #[serde(
2697 rename = "clientOrderID",
2698 default,
2699 skip_serializing_if = "Option::is_none"
2700 )]
2701 pub client_order_id: Option<ClientID>,
2702 #[serde(
2704 rename = "clientExtensionsModify",
2705 default,
2706 skip_serializing_if = "Option::is_none"
2707 )]
2708 pub client_extensions_modify: Option<ClientExtensions>,
2709 #[serde(
2711 rename = "tradeClientExtensionsModify",
2712 default,
2713 skip_serializing_if = "Option::is_none"
2714 )]
2715 pub trade_client_extensions_modify: Option<ClientExtensions>,
2716}
2717
2718#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2721#[serde(rename_all = "camelCase")]
2722pub struct OrderClientExtensionsModifyRejectTransaction {
2723 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2725 pub id: Option<TransactionID>,
2726 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2728 pub time: Option<Timestamp>,
2729 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2731 pub user_id: Option<i64>,
2732 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2734 pub account_id: Option<AccountID>,
2735 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2738 pub batch_id: Option<TransactionID>,
2739 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2741 pub request_id: Option<RequestID>,
2742 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2745 pub r#type: Option<TransactionType>,
2746 #[serde(rename = "orderID", default, skip_serializing_if = "Option::is_none")]
2748 pub order_id: Option<OrderID>,
2749 #[serde(
2751 rename = "clientOrderID",
2752 default,
2753 skip_serializing_if = "Option::is_none"
2754 )]
2755 pub client_order_id: Option<ClientID>,
2756 #[serde(
2758 rename = "clientExtensionsModify",
2759 default,
2760 skip_serializing_if = "Option::is_none"
2761 )]
2762 pub client_extensions_modify: Option<ClientExtensions>,
2763 #[serde(
2765 rename = "tradeClientExtensionsModify",
2766 default,
2767 skip_serializing_if = "Option::is_none"
2768 )]
2769 pub trade_client_extensions_modify: Option<ClientExtensions>,
2770 #[serde(
2772 rename = "rejectReason",
2773 default,
2774 skip_serializing_if = "Option::is_none"
2775 )]
2776 pub reject_reason: Option<TransactionRejectReason>,
2777}
2778
2779#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2781#[serde(rename_all = "camelCase")]
2782pub struct TradeClientExtensionsModifyTransaction {
2783 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2785 pub id: Option<TransactionID>,
2786 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2788 pub time: Option<Timestamp>,
2789 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2791 pub user_id: Option<i64>,
2792 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2794 pub account_id: Option<AccountID>,
2795 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2798 pub batch_id: Option<TransactionID>,
2799 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2801 pub request_id: Option<RequestID>,
2802 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2805 pub r#type: Option<TransactionType>,
2806 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
2808 pub trade_id: Option<TradeID>,
2809 #[serde(
2811 rename = "clientTradeID",
2812 default,
2813 skip_serializing_if = "Option::is_none"
2814 )]
2815 pub client_trade_id: Option<ClientID>,
2816 #[serde(
2818 rename = "tradeClientExtensionsModify",
2819 default,
2820 skip_serializing_if = "Option::is_none"
2821 )]
2822 pub trade_client_extensions_modify: Option<ClientExtensions>,
2823}
2824
2825#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2828#[serde(rename_all = "camelCase")]
2829pub struct TradeClientExtensionsModifyRejectTransaction {
2830 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2832 pub id: Option<TransactionID>,
2833 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2835 pub time: Option<Timestamp>,
2836 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2838 pub user_id: Option<i64>,
2839 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2841 pub account_id: Option<AccountID>,
2842 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2845 pub batch_id: Option<TransactionID>,
2846 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2848 pub request_id: Option<RequestID>,
2849 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2852 pub r#type: Option<TransactionType>,
2853 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
2855 pub trade_id: Option<TradeID>,
2856 #[serde(
2858 rename = "clientTradeID",
2859 default,
2860 skip_serializing_if = "Option::is_none"
2861 )]
2862 pub client_trade_id: Option<ClientID>,
2863 #[serde(
2865 rename = "tradeClientExtensionsModify",
2866 default,
2867 skip_serializing_if = "Option::is_none"
2868 )]
2869 pub trade_client_extensions_modify: Option<ClientExtensions>,
2870 #[serde(
2872 rename = "rejectReason",
2873 default,
2874 skip_serializing_if = "Option::is_none"
2875 )]
2876 pub reject_reason: Option<TransactionRejectReason>,
2877}
2878
2879#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2881#[serde(rename_all = "camelCase")]
2882pub struct MarginCallEnterTransaction {
2883 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2885 pub id: Option<TransactionID>,
2886 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2888 pub time: Option<Timestamp>,
2889 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2891 pub user_id: Option<i64>,
2892 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2894 pub account_id: Option<AccountID>,
2895 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2898 pub batch_id: Option<TransactionID>,
2899 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2901 pub request_id: Option<RequestID>,
2902 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2904 pub r#type: Option<TransactionType>,
2905}
2906
2907#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2909#[serde(rename_all = "camelCase")]
2910pub struct MarginCallExtendTransaction {
2911 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2913 pub id: Option<TransactionID>,
2914 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2916 pub time: Option<Timestamp>,
2917 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2919 pub user_id: Option<i64>,
2920 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2922 pub account_id: Option<AccountID>,
2923 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2926 pub batch_id: Option<TransactionID>,
2927 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2929 pub request_id: Option<RequestID>,
2930 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2932 pub r#type: Option<TransactionType>,
2933 #[serde(
2936 rename = "extensionNumber",
2937 default,
2938 skip_serializing_if = "Option::is_none"
2939 )]
2940 pub extension_number: Option<i64>,
2941}
2942
2943#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2945#[serde(rename_all = "camelCase")]
2946pub struct MarginCallExitTransaction {
2947 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2949 pub id: Option<TransactionID>,
2950 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2952 pub time: Option<Timestamp>,
2953 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2955 pub user_id: Option<i64>,
2956 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2958 pub account_id: Option<AccountID>,
2959 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2962 pub batch_id: Option<TransactionID>,
2963 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2965 pub request_id: Option<RequestID>,
2966 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2968 pub r#type: Option<TransactionType>,
2969}
2970
2971#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2975#[serde(rename_all = "camelCase")]
2976pub struct DelayedTradeClosureTransaction {
2977 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
2979 pub id: Option<TransactionID>,
2980 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
2982 pub time: Option<Timestamp>,
2983 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
2985 pub user_id: Option<i64>,
2986 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
2988 pub account_id: Option<AccountID>,
2989 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
2992 pub batch_id: Option<TransactionID>,
2993 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
2995 pub request_id: Option<RequestID>,
2996 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2998 pub r#type: Option<TransactionType>,
2999 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
3001 pub reason: Option<MarketOrderReason>,
3002 #[serde(rename = "tradeIDs", default, skip_serializing_if = "Option::is_none")]
3005 pub trade_ids: Option<TradeID>,
3006}
3007
3008#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3010#[serde(rename_all = "camelCase")]
3011pub struct DailyFinancingTransaction {
3012 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
3014 pub id: Option<TransactionID>,
3015 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
3017 pub time: Option<Timestamp>,
3018 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
3020 pub user_id: Option<i64>,
3021 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
3023 pub account_id: Option<AccountID>,
3024 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
3027 pub batch_id: Option<TransactionID>,
3028 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
3030 pub request_id: Option<RequestID>,
3031 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3033 pub r#type: Option<TransactionType>,
3034 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
3036 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3037 pub financing: Option<Decimal>,
3038 #[serde(
3040 rename = "accountBalance",
3041 default,
3042 skip_serializing_if = "Option::is_none"
3043 )]
3044 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3045 pub account_balance: Option<Decimal>,
3046 #[serde(
3050 rename = "accountFinancingMode",
3051 default,
3052 skip_serializing_if = "Option::is_none"
3053 )]
3054 pub account_financing_mode: Option<AccountFinancingMode>,
3055 #[serde(
3057 rename = "positionFinancings",
3058 default,
3059 skip_serializing_if = "Option::is_none"
3060 )]
3061 pub position_financings: Option<Vec<PositionFinancing>>,
3062}
3063
3064#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3067#[serde(rename_all = "camelCase")]
3068pub struct DividendAdjustmentTransaction {
3069 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
3071 pub id: Option<TransactionID>,
3072 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
3074 pub time: Option<Timestamp>,
3075 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
3077 pub user_id: Option<i64>,
3078 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
3080 pub account_id: Option<AccountID>,
3081 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
3084 pub batch_id: Option<TransactionID>,
3085 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
3087 pub request_id: Option<RequestID>,
3088 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3090 pub r#type: Option<TransactionType>,
3091 #[serde(
3093 rename = "instrument",
3094 default,
3095 skip_serializing_if = "Option::is_none"
3096 )]
3097 pub instrument: Option<InstrumentName>,
3098 #[serde(
3102 rename = "dividendAdjustment",
3103 default,
3104 skip_serializing_if = "Option::is_none"
3105 )]
3106 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3107 pub dividend_adjustment: Option<Decimal>,
3108 #[serde(
3112 rename = "quoteDividendAdjustment",
3113 default,
3114 skip_serializing_if = "Option::is_none"
3115 )]
3116 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3117 pub quote_dividend_adjustment: Option<Decimal>,
3118 #[serde(
3120 rename = "homeConversionFactors",
3121 default,
3122 skip_serializing_if = "Option::is_none"
3123 )]
3124 pub home_conversion_factors: Option<HomeConversionFactors>,
3125 #[serde(
3127 rename = "accountBalance",
3128 default,
3129 skip_serializing_if = "Option::is_none"
3130 )]
3131 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
3132 pub account_balance: Option<Decimal>,
3133 #[serde(
3136 rename = "openTradeDividendAdjustments",
3137 default,
3138 skip_serializing_if = "Option::is_none"
3139 )]
3140 pub open_trade_dividend_adjustments: Option<Vec<OpenTradeDividendAdjustment>>,
3141}
3142
3143#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3145#[serde(rename_all = "camelCase")]
3146pub struct ResetResettablePLTransaction {
3147 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
3149 pub id: Option<TransactionID>,
3150 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
3152 pub time: Option<Timestamp>,
3153 #[serde(rename = "userID", default, skip_serializing_if = "Option::is_none")]
3155 pub user_id: Option<i64>,
3156 #[serde(rename = "accountID", default, skip_serializing_if = "Option::is_none")]
3158 pub account_id: Option<AccountID>,
3159 #[serde(rename = "batchID", default, skip_serializing_if = "Option::is_none")]
3162 pub batch_id: Option<TransactionID>,
3163 #[serde(rename = "requestID", default, skip_serializing_if = "Option::is_none")]
3165 pub request_id: Option<RequestID>,
3166 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3168 pub r#type: Option<TransactionType>,
3169}
3170
3171#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3173#[non_exhaustive]
3174pub enum TransactionType {
3175 Create,
3177 Close,
3179 Reopen,
3181 ClientConfigure,
3183 ClientConfigureReject,
3185 TransferFunds,
3187 TransferFundsReject,
3189 MarketOrder,
3191 MarketOrderReject,
3193 FixedPriceOrder,
3195 LimitOrder,
3197 LimitOrderReject,
3199 StopOrder,
3201 StopOrderReject,
3203 MarketIfTouchedOrder,
3205 MarketIfTouchedOrderReject,
3207 TakeProfitOrder,
3209 TakeProfitOrderReject,
3211 StopLossOrder,
3213 StopLossOrderReject,
3215 GuaranteedStopLossOrder,
3217 GuaranteedStopLossOrderReject,
3219 TrailingStopLossOrder,
3221 TrailingStopLossOrderReject,
3223 OrderFill,
3225 OrderCancel,
3227 OrderCancelReject,
3229 OrderClientExtensionsModify,
3231 OrderClientExtensionsModifyReject,
3233 TradeClientExtensionsModify,
3235 TradeClientExtensionsModifyReject,
3237 MarginCallEnter,
3239 MarginCallExtend,
3241 MarginCallExit,
3243 DelayedTradeClosure,
3245 DailyFinancing,
3247 DividendAdjustment,
3249 ResetResettablePl,
3251 Unknown(String),
3253}
3254
3255impl TransactionType {
3256 pub fn as_str(&self) -> &str {
3258 match self {
3259 Self::Create => "CREATE",
3260 Self::Close => "CLOSE",
3261 Self::Reopen => "REOPEN",
3262 Self::ClientConfigure => "CLIENT_CONFIGURE",
3263 Self::ClientConfigureReject => "CLIENT_CONFIGURE_REJECT",
3264 Self::TransferFunds => "TRANSFER_FUNDS",
3265 Self::TransferFundsReject => "TRANSFER_FUNDS_REJECT",
3266 Self::MarketOrder => "MARKET_ORDER",
3267 Self::MarketOrderReject => "MARKET_ORDER_REJECT",
3268 Self::FixedPriceOrder => "FIXED_PRICE_ORDER",
3269 Self::LimitOrder => "LIMIT_ORDER",
3270 Self::LimitOrderReject => "LIMIT_ORDER_REJECT",
3271 Self::StopOrder => "STOP_ORDER",
3272 Self::StopOrderReject => "STOP_ORDER_REJECT",
3273 Self::MarketIfTouchedOrder => "MARKET_IF_TOUCHED_ORDER",
3274 Self::MarketIfTouchedOrderReject => "MARKET_IF_TOUCHED_ORDER_REJECT",
3275 Self::TakeProfitOrder => "TAKE_PROFIT_ORDER",
3276 Self::TakeProfitOrderReject => "TAKE_PROFIT_ORDER_REJECT",
3277 Self::StopLossOrder => "STOP_LOSS_ORDER",
3278 Self::StopLossOrderReject => "STOP_LOSS_ORDER_REJECT",
3279 Self::GuaranteedStopLossOrder => "GUARANTEED_STOP_LOSS_ORDER",
3280 Self::GuaranteedStopLossOrderReject => "GUARANTEED_STOP_LOSS_ORDER_REJECT",
3281 Self::TrailingStopLossOrder => "TRAILING_STOP_LOSS_ORDER",
3282 Self::TrailingStopLossOrderReject => "TRAILING_STOP_LOSS_ORDER_REJECT",
3283 Self::OrderFill => "ORDER_FILL",
3284 Self::OrderCancel => "ORDER_CANCEL",
3285 Self::OrderCancelReject => "ORDER_CANCEL_REJECT",
3286 Self::OrderClientExtensionsModify => "ORDER_CLIENT_EXTENSIONS_MODIFY",
3287 Self::OrderClientExtensionsModifyReject => "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT",
3288 Self::TradeClientExtensionsModify => "TRADE_CLIENT_EXTENSIONS_MODIFY",
3289 Self::TradeClientExtensionsModifyReject => "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT",
3290 Self::MarginCallEnter => "MARGIN_CALL_ENTER",
3291 Self::MarginCallExtend => "MARGIN_CALL_EXTEND",
3292 Self::MarginCallExit => "MARGIN_CALL_EXIT",
3293 Self::DelayedTradeClosure => "DELAYED_TRADE_CLOSURE",
3294 Self::DailyFinancing => "DAILY_FINANCING",
3295 Self::DividendAdjustment => "DIVIDEND_ADJUSTMENT",
3296 Self::ResetResettablePl => "RESET_RESETTABLE_PL",
3297 Self::Unknown(value) => value,
3298 }
3299 }
3300}
3301
3302impl Serialize for TransactionType {
3303 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3304 serializer.serialize_str(self.as_str())
3305 }
3306}
3307
3308impl<'de> Deserialize<'de> for TransactionType {
3309 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3310 let value = String::deserialize(deserializer)?;
3311 Ok(match value.as_str() {
3312 "CREATE" => Self::Create,
3313 "CLOSE" => Self::Close,
3314 "REOPEN" => Self::Reopen,
3315 "CLIENT_CONFIGURE" => Self::ClientConfigure,
3316 "CLIENT_CONFIGURE_REJECT" => Self::ClientConfigureReject,
3317 "TRANSFER_FUNDS" => Self::TransferFunds,
3318 "TRANSFER_FUNDS_REJECT" => Self::TransferFundsReject,
3319 "MARKET_ORDER" => Self::MarketOrder,
3320 "MARKET_ORDER_REJECT" => Self::MarketOrderReject,
3321 "FIXED_PRICE_ORDER" => Self::FixedPriceOrder,
3322 "LIMIT_ORDER" => Self::LimitOrder,
3323 "LIMIT_ORDER_REJECT" => Self::LimitOrderReject,
3324 "STOP_ORDER" => Self::StopOrder,
3325 "STOP_ORDER_REJECT" => Self::StopOrderReject,
3326 "MARKET_IF_TOUCHED_ORDER" => Self::MarketIfTouchedOrder,
3327 "MARKET_IF_TOUCHED_ORDER_REJECT" => Self::MarketIfTouchedOrderReject,
3328 "TAKE_PROFIT_ORDER" => Self::TakeProfitOrder,
3329 "TAKE_PROFIT_ORDER_REJECT" => Self::TakeProfitOrderReject,
3330 "STOP_LOSS_ORDER" => Self::StopLossOrder,
3331 "STOP_LOSS_ORDER_REJECT" => Self::StopLossOrderReject,
3332 "GUARANTEED_STOP_LOSS_ORDER" => Self::GuaranteedStopLossOrder,
3333 "GUARANTEED_STOP_LOSS_ORDER_REJECT" => Self::GuaranteedStopLossOrderReject,
3334 "TRAILING_STOP_LOSS_ORDER" => Self::TrailingStopLossOrder,
3335 "TRAILING_STOP_LOSS_ORDER_REJECT" => Self::TrailingStopLossOrderReject,
3336 "ORDER_FILL" => Self::OrderFill,
3337 "ORDER_CANCEL" => Self::OrderCancel,
3338 "ORDER_CANCEL_REJECT" => Self::OrderCancelReject,
3339 "ORDER_CLIENT_EXTENSIONS_MODIFY" => Self::OrderClientExtensionsModify,
3340 "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT" => Self::OrderClientExtensionsModifyReject,
3341 "TRADE_CLIENT_EXTENSIONS_MODIFY" => Self::TradeClientExtensionsModify,
3342 "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT" => Self::TradeClientExtensionsModifyReject,
3343 "MARGIN_CALL_ENTER" => Self::MarginCallEnter,
3344 "MARGIN_CALL_EXTEND" => Self::MarginCallExtend,
3345 "MARGIN_CALL_EXIT" => Self::MarginCallExit,
3346 "DELAYED_TRADE_CLOSURE" => Self::DelayedTradeClosure,
3347 "DAILY_FINANCING" => Self::DailyFinancing,
3348 "DIVIDEND_ADJUSTMENT" => Self::DividendAdjustment,
3349 "RESET_RESETTABLE_PL" => Self::ResetResettablePl,
3350 _ => Self::Unknown(value),
3351 })
3352 }
3353}
3354
3355#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3357#[non_exhaustive]
3358pub enum FundingReason {
3359 ClientFunding,
3361 AccountTransfer,
3363 DivisionMigration,
3365 SiteMigration,
3367 Adjustment,
3369 Unknown(String),
3371}
3372
3373impl FundingReason {
3374 pub fn as_str(&self) -> &str {
3376 match self {
3377 Self::ClientFunding => "CLIENT_FUNDING",
3378 Self::AccountTransfer => "ACCOUNT_TRANSFER",
3379 Self::DivisionMigration => "DIVISION_MIGRATION",
3380 Self::SiteMigration => "SITE_MIGRATION",
3381 Self::Adjustment => "ADJUSTMENT",
3382 Self::Unknown(value) => value,
3383 }
3384 }
3385}
3386
3387impl Serialize for FundingReason {
3388 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3389 serializer.serialize_str(self.as_str())
3390 }
3391}
3392
3393impl<'de> Deserialize<'de> for FundingReason {
3394 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3395 let value = String::deserialize(deserializer)?;
3396 Ok(match value.as_str() {
3397 "CLIENT_FUNDING" => Self::ClientFunding,
3398 "ACCOUNT_TRANSFER" => Self::AccountTransfer,
3399 "DIVISION_MIGRATION" => Self::DivisionMigration,
3400 "SITE_MIGRATION" => Self::SiteMigration,
3401 "ADJUSTMENT" => Self::Adjustment,
3402 _ => Self::Unknown(value),
3403 })
3404 }
3405}
3406
3407#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3409#[non_exhaustive]
3410pub enum MarketOrderReason {
3411 ClientOrder,
3413 TradeClose,
3415 PositionCloseout,
3417 MarginCloseout,
3419 DelayedTradeClose,
3421 Unknown(String),
3423}
3424
3425impl MarketOrderReason {
3426 pub fn as_str(&self) -> &str {
3428 match self {
3429 Self::ClientOrder => "CLIENT_ORDER",
3430 Self::TradeClose => "TRADE_CLOSE",
3431 Self::PositionCloseout => "POSITION_CLOSEOUT",
3432 Self::MarginCloseout => "MARGIN_CLOSEOUT",
3433 Self::DelayedTradeClose => "DELAYED_TRADE_CLOSE",
3434 Self::Unknown(value) => value,
3435 }
3436 }
3437}
3438
3439impl Serialize for MarketOrderReason {
3440 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3441 serializer.serialize_str(self.as_str())
3442 }
3443}
3444
3445impl<'de> Deserialize<'de> for MarketOrderReason {
3446 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3447 let value = String::deserialize(deserializer)?;
3448 Ok(match value.as_str() {
3449 "CLIENT_ORDER" => Self::ClientOrder,
3450 "TRADE_CLOSE" => Self::TradeClose,
3451 "POSITION_CLOSEOUT" => Self::PositionCloseout,
3452 "MARGIN_CLOSEOUT" => Self::MarginCloseout,
3453 "DELAYED_TRADE_CLOSE" => Self::DelayedTradeClose,
3454 _ => Self::Unknown(value),
3455 })
3456 }
3457}
3458
3459#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3461#[non_exhaustive]
3462pub enum FixedPriceOrderReason {
3463 PlatformAccountMigration,
3465 TradeCloseDivisionAccountMigration,
3467 TradeCloseAdministrativeAction,
3469 Unknown(String),
3471}
3472
3473impl FixedPriceOrderReason {
3474 pub fn as_str(&self) -> &str {
3476 match self {
3477 Self::PlatformAccountMigration => "PLATFORM_ACCOUNT_MIGRATION",
3478 Self::TradeCloseDivisionAccountMigration => "TRADE_CLOSE_DIVISION_ACCOUNT_MIGRATION",
3479 Self::TradeCloseAdministrativeAction => "TRADE_CLOSE_ADMINISTRATIVE_ACTION",
3480 Self::Unknown(value) => value,
3481 }
3482 }
3483}
3484
3485impl Serialize for FixedPriceOrderReason {
3486 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3487 serializer.serialize_str(self.as_str())
3488 }
3489}
3490
3491impl<'de> Deserialize<'de> for FixedPriceOrderReason {
3492 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3493 let value = String::deserialize(deserializer)?;
3494 Ok(match value.as_str() {
3495 "PLATFORM_ACCOUNT_MIGRATION" => Self::PlatformAccountMigration,
3496 "TRADE_CLOSE_DIVISION_ACCOUNT_MIGRATION" => Self::TradeCloseDivisionAccountMigration,
3497 "TRADE_CLOSE_ADMINISTRATIVE_ACTION" => Self::TradeCloseAdministrativeAction,
3498 _ => Self::Unknown(value),
3499 })
3500 }
3501}
3502
3503#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3505#[non_exhaustive]
3506pub enum LimitOrderReason {
3507 ClientOrder,
3509 Replacement,
3511 Unknown(String),
3513}
3514
3515impl LimitOrderReason {
3516 pub fn as_str(&self) -> &str {
3518 match self {
3519 Self::ClientOrder => "CLIENT_ORDER",
3520 Self::Replacement => "REPLACEMENT",
3521 Self::Unknown(value) => value,
3522 }
3523 }
3524}
3525
3526impl Serialize for LimitOrderReason {
3527 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3528 serializer.serialize_str(self.as_str())
3529 }
3530}
3531
3532impl<'de> Deserialize<'de> for LimitOrderReason {
3533 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3534 let value = String::deserialize(deserializer)?;
3535 Ok(match value.as_str() {
3536 "CLIENT_ORDER" => Self::ClientOrder,
3537 "REPLACEMENT" => Self::Replacement,
3538 _ => Self::Unknown(value),
3539 })
3540 }
3541}
3542
3543#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3545#[non_exhaustive]
3546pub enum StopOrderReason {
3547 ClientOrder,
3549 Replacement,
3551 Unknown(String),
3553}
3554
3555impl StopOrderReason {
3556 pub fn as_str(&self) -> &str {
3558 match self {
3559 Self::ClientOrder => "CLIENT_ORDER",
3560 Self::Replacement => "REPLACEMENT",
3561 Self::Unknown(value) => value,
3562 }
3563 }
3564}
3565
3566impl Serialize for StopOrderReason {
3567 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3568 serializer.serialize_str(self.as_str())
3569 }
3570}
3571
3572impl<'de> Deserialize<'de> for StopOrderReason {
3573 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3574 let value = String::deserialize(deserializer)?;
3575 Ok(match value.as_str() {
3576 "CLIENT_ORDER" => Self::ClientOrder,
3577 "REPLACEMENT" => Self::Replacement,
3578 _ => Self::Unknown(value),
3579 })
3580 }
3581}
3582
3583#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3585#[non_exhaustive]
3586pub enum MarketIfTouchedOrderReason {
3587 ClientOrder,
3589 Replacement,
3591 Unknown(String),
3593}
3594
3595impl MarketIfTouchedOrderReason {
3596 pub fn as_str(&self) -> &str {
3598 match self {
3599 Self::ClientOrder => "CLIENT_ORDER",
3600 Self::Replacement => "REPLACEMENT",
3601 Self::Unknown(value) => value,
3602 }
3603 }
3604}
3605
3606impl Serialize for MarketIfTouchedOrderReason {
3607 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3608 serializer.serialize_str(self.as_str())
3609 }
3610}
3611
3612impl<'de> Deserialize<'de> for MarketIfTouchedOrderReason {
3613 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3614 let value = String::deserialize(deserializer)?;
3615 Ok(match value.as_str() {
3616 "CLIENT_ORDER" => Self::ClientOrder,
3617 "REPLACEMENT" => Self::Replacement,
3618 _ => Self::Unknown(value),
3619 })
3620 }
3621}
3622
3623#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3625#[non_exhaustive]
3626pub enum TakeProfitOrderReason {
3627 ClientOrder,
3629 Replacement,
3631 OnFill,
3634 Unknown(String),
3636}
3637
3638impl TakeProfitOrderReason {
3639 pub fn as_str(&self) -> &str {
3641 match self {
3642 Self::ClientOrder => "CLIENT_ORDER",
3643 Self::Replacement => "REPLACEMENT",
3644 Self::OnFill => "ON_FILL",
3645 Self::Unknown(value) => value,
3646 }
3647 }
3648}
3649
3650impl Serialize for TakeProfitOrderReason {
3651 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3652 serializer.serialize_str(self.as_str())
3653 }
3654}
3655
3656impl<'de> Deserialize<'de> for TakeProfitOrderReason {
3657 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3658 let value = String::deserialize(deserializer)?;
3659 Ok(match value.as_str() {
3660 "CLIENT_ORDER" => Self::ClientOrder,
3661 "REPLACEMENT" => Self::Replacement,
3662 "ON_FILL" => Self::OnFill,
3663 _ => Self::Unknown(value),
3664 })
3665 }
3666}
3667
3668#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3670#[non_exhaustive]
3671pub enum StopLossOrderReason {
3672 ClientOrder,
3674 Replacement,
3676 OnFill,
3679 Unknown(String),
3681}
3682
3683impl StopLossOrderReason {
3684 pub fn as_str(&self) -> &str {
3686 match self {
3687 Self::ClientOrder => "CLIENT_ORDER",
3688 Self::Replacement => "REPLACEMENT",
3689 Self::OnFill => "ON_FILL",
3690 Self::Unknown(value) => value,
3691 }
3692 }
3693}
3694
3695impl Serialize for StopLossOrderReason {
3696 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3697 serializer.serialize_str(self.as_str())
3698 }
3699}
3700
3701impl<'de> Deserialize<'de> for StopLossOrderReason {
3702 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3703 let value = String::deserialize(deserializer)?;
3704 Ok(match value.as_str() {
3705 "CLIENT_ORDER" => Self::ClientOrder,
3706 "REPLACEMENT" => Self::Replacement,
3707 "ON_FILL" => Self::OnFill,
3708 _ => Self::Unknown(value),
3709 })
3710 }
3711}
3712
3713#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3715#[non_exhaustive]
3716pub enum GuaranteedStopLossOrderReason {
3717 ClientOrder,
3719 Replacement,
3721 OnFill,
3724 Unknown(String),
3726}
3727
3728impl GuaranteedStopLossOrderReason {
3729 pub fn as_str(&self) -> &str {
3731 match self {
3732 Self::ClientOrder => "CLIENT_ORDER",
3733 Self::Replacement => "REPLACEMENT",
3734 Self::OnFill => "ON_FILL",
3735 Self::Unknown(value) => value,
3736 }
3737 }
3738}
3739
3740impl Serialize for GuaranteedStopLossOrderReason {
3741 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3742 serializer.serialize_str(self.as_str())
3743 }
3744}
3745
3746impl<'de> Deserialize<'de> for GuaranteedStopLossOrderReason {
3747 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3748 let value = String::deserialize(deserializer)?;
3749 Ok(match value.as_str() {
3750 "CLIENT_ORDER" => Self::ClientOrder,
3751 "REPLACEMENT" => Self::Replacement,
3752 "ON_FILL" => Self::OnFill,
3753 _ => Self::Unknown(value),
3754 })
3755 }
3756}
3757
3758#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3760#[non_exhaustive]
3761pub enum TrailingStopLossOrderReason {
3762 ClientOrder,
3764 Replacement,
3766 OnFill,
3769 Unknown(String),
3771}
3772
3773impl TrailingStopLossOrderReason {
3774 pub fn as_str(&self) -> &str {
3776 match self {
3777 Self::ClientOrder => "CLIENT_ORDER",
3778 Self::Replacement => "REPLACEMENT",
3779 Self::OnFill => "ON_FILL",
3780 Self::Unknown(value) => value,
3781 }
3782 }
3783}
3784
3785impl Serialize for TrailingStopLossOrderReason {
3786 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3787 serializer.serialize_str(self.as_str())
3788 }
3789}
3790
3791impl<'de> Deserialize<'de> for TrailingStopLossOrderReason {
3792 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3793 let value = String::deserialize(deserializer)?;
3794 Ok(match value.as_str() {
3795 "CLIENT_ORDER" => Self::ClientOrder,
3796 "REPLACEMENT" => Self::Replacement,
3797 "ON_FILL" => Self::OnFill,
3798 _ => Self::Unknown(value),
3799 })
3800 }
3801}
3802
3803#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3805#[non_exhaustive]
3806pub enum OrderFillReason {
3807 LimitOrder,
3809 StopOrder,
3811 MarketIfTouchedOrder,
3813 TakeProfitOrder,
3815 StopLossOrder,
3817 GuaranteedStopLossOrder,
3819 TrailingStopLossOrder,
3821 MarketOrder,
3823 MarketOrderTradeClose,
3825 MarketOrderPositionCloseout,
3827 MarketOrderMarginCloseout,
3829 MarketOrderDelayedTradeClose,
3831 FixedPriceOrder,
3833 FixedPriceOrderPlatformAccountMigration,
3835 FixedPriceOrderDivisionAccountMigration,
3837 FixedPriceOrderAdministrativeAction,
3839 Unknown(String),
3841}
3842
3843impl OrderFillReason {
3844 pub fn as_str(&self) -> &str {
3846 match self {
3847 Self::LimitOrder => "LIMIT_ORDER",
3848 Self::StopOrder => "STOP_ORDER",
3849 Self::MarketIfTouchedOrder => "MARKET_IF_TOUCHED_ORDER",
3850 Self::TakeProfitOrder => "TAKE_PROFIT_ORDER",
3851 Self::StopLossOrder => "STOP_LOSS_ORDER",
3852 Self::GuaranteedStopLossOrder => "GUARANTEED_STOP_LOSS_ORDER",
3853 Self::TrailingStopLossOrder => "TRAILING_STOP_LOSS_ORDER",
3854 Self::MarketOrder => "MARKET_ORDER",
3855 Self::MarketOrderTradeClose => "MARKET_ORDER_TRADE_CLOSE",
3856 Self::MarketOrderPositionCloseout => "MARKET_ORDER_POSITION_CLOSEOUT",
3857 Self::MarketOrderMarginCloseout => "MARKET_ORDER_MARGIN_CLOSEOUT",
3858 Self::MarketOrderDelayedTradeClose => "MARKET_ORDER_DELAYED_TRADE_CLOSE",
3859 Self::FixedPriceOrder => "FIXED_PRICE_ORDER",
3860 Self::FixedPriceOrderPlatformAccountMigration => {
3861 "FIXED_PRICE_ORDER_PLATFORM_ACCOUNT_MIGRATION"
3862 }
3863 Self::FixedPriceOrderDivisionAccountMigration => {
3864 "FIXED_PRICE_ORDER_DIVISION_ACCOUNT_MIGRATION"
3865 }
3866 Self::FixedPriceOrderAdministrativeAction => "FIXED_PRICE_ORDER_ADMINISTRATIVE_ACTION",
3867 Self::Unknown(value) => value,
3868 }
3869 }
3870}
3871
3872impl Serialize for OrderFillReason {
3873 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
3874 serializer.serialize_str(self.as_str())
3875 }
3876}
3877
3878impl<'de> Deserialize<'de> for OrderFillReason {
3879 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
3880 let value = String::deserialize(deserializer)?;
3881 Ok(match value.as_str() {
3882 "LIMIT_ORDER" => Self::LimitOrder,
3883 "STOP_ORDER" => Self::StopOrder,
3884 "MARKET_IF_TOUCHED_ORDER" => Self::MarketIfTouchedOrder,
3885 "TAKE_PROFIT_ORDER" => Self::TakeProfitOrder,
3886 "STOP_LOSS_ORDER" => Self::StopLossOrder,
3887 "GUARANTEED_STOP_LOSS_ORDER" => Self::GuaranteedStopLossOrder,
3888 "TRAILING_STOP_LOSS_ORDER" => Self::TrailingStopLossOrder,
3889 "MARKET_ORDER" => Self::MarketOrder,
3890 "MARKET_ORDER_TRADE_CLOSE" => Self::MarketOrderTradeClose,
3891 "MARKET_ORDER_POSITION_CLOSEOUT" => Self::MarketOrderPositionCloseout,
3892 "MARKET_ORDER_MARGIN_CLOSEOUT" => Self::MarketOrderMarginCloseout,
3893 "MARKET_ORDER_DELAYED_TRADE_CLOSE" => Self::MarketOrderDelayedTradeClose,
3894 "FIXED_PRICE_ORDER" => Self::FixedPriceOrder,
3895 "FIXED_PRICE_ORDER_PLATFORM_ACCOUNT_MIGRATION" => {
3896 Self::FixedPriceOrderPlatformAccountMigration
3897 }
3898 "FIXED_PRICE_ORDER_DIVISION_ACCOUNT_MIGRATION" => {
3899 Self::FixedPriceOrderDivisionAccountMigration
3900 }
3901 "FIXED_PRICE_ORDER_ADMINISTRATIVE_ACTION" => Self::FixedPriceOrderAdministrativeAction,
3902 _ => Self::Unknown(value),
3903 })
3904 }
3905}
3906
3907#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3909#[non_exhaustive]
3910pub enum OrderCancelReason {
3911 InternalServerError,
3913 AccountLocked,
3915 AccountNewPositionsLocked,
3917 AccountOrderCreationLocked,
3920 AccountOrderFillLocked,
3922 ClientRequest,
3924 Migration,
3926 MarketHalted,
3928 LinkedTradeClosed,
3930 TimeInForceExpired,
3932 InsufficientMargin,
3934 FifoViolation,
3936 BoundsViolation,
3938 ClientRequestReplaced,
3940 DividendAdjustmentReplaced,
3943 InsufficientLiquidity,
3945 TakeProfitOnFillGtdTimestampInPast,
3947 TakeProfitOnFillLoss,
3950 LosingTakeProfit,
3953 StopLossOnFillGtdTimestampInPast,
3955 StopLossOnFillLoss,
3958 StopLossOnFillPriceDistanceMaximumExceeded,
3961 StopLossOnFillRequired,
3964 StopLossOnFillGuaranteedRequired,
3967 StopLossOnFillGuaranteedNotAllowed,
3970 StopLossOnFillGuaranteedMinimumDistanceNotMet,
3973 StopLossOnFillGuaranteedLevelRestrictionExceeded,
3976 StopLossOnFillGuaranteedHedgingNotAllowed,
3980 StopLossOnFillTimeInForceInvalid,
3984 StopLossOnFillTriggerConditionInvalid,
3988 GuaranteedStopLossOnFillGtdTimestampInPast,
3991 GuaranteedStopLossOnFillLoss,
3994 GuaranteedStopLossOnFillPriceDistanceMaximumExceeded,
3997 GuaranteedStopLossOnFillRequired,
4000 GuaranteedStopLossOnFillNotAllowed,
4003 GuaranteedStopLossOnFillMinimumDistanceNotMet,
4006 GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded,
4009 GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded,
4012 GuaranteedStopLossOnFillHedgingNotAllowed,
4016 GuaranteedStopLossOnFillTimeInForceInvalid,
4020 GuaranteedStopLossOnFillTriggerConditionInvalid,
4024 TakeProfitOnFillPriceDistanceMaximumExceeded,
4027 TrailingStopLossOnFillGtdTimestampInPast,
4030 ClientTradeIdAlreadyExists,
4032 PositionCloseoutFailed,
4034 OpenTradesAllowedExceeded,
4036 PendingOrdersAllowedExceeded,
4038 TakeProfitOnFillClientOrderIdAlreadyExists,
4041 StopLossOnFillClientOrderIdAlreadyExists,
4044 GuaranteedStopLossOnFillClientOrderIdAlreadyExists,
4047 TrailingStopLossOnFillClientOrderIdAlreadyExists,
4050 PositionSizeExceeded,
4053 HedgingGsloViolation,
4057 AccountPositionValueLimitExceeded,
4060 InstrumentBidReduceOnly,
4064 InstrumentAskReduceOnly,
4068 InstrumentBidHalted,
4071 InstrumentAskHalted,
4074 StopLossOnFillGuaranteedBidHalted,
4078 StopLossOnFillGuaranteedAskHalted,
4082 GuaranteedStopLossOnFillBidHalted,
4086 GuaranteedStopLossOnFillAskHalted,
4090 FifoViolationSafeguardViolation,
4093 FifoViolationSafeguardPartialCloseViolation,
4096 OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation,
4099 Unknown(String),
4101}
4102
4103impl OrderCancelReason {
4104 pub fn as_str(&self) -> &str {
4106 match self {
4107 Self::InternalServerError => "INTERNAL_SERVER_ERROR",
4108 Self::AccountLocked => "ACCOUNT_LOCKED",
4109 Self::AccountNewPositionsLocked => "ACCOUNT_NEW_POSITIONS_LOCKED",
4110 Self::AccountOrderCreationLocked => "ACCOUNT_ORDER_CREATION_LOCKED",
4111 Self::AccountOrderFillLocked => "ACCOUNT_ORDER_FILL_LOCKED",
4112 Self::ClientRequest => "CLIENT_REQUEST",
4113 Self::Migration => "MIGRATION",
4114 Self::MarketHalted => "MARKET_HALTED",
4115 Self::LinkedTradeClosed => "LINKED_TRADE_CLOSED",
4116 Self::TimeInForceExpired => "TIME_IN_FORCE_EXPIRED",
4117 Self::InsufficientMargin => "INSUFFICIENT_MARGIN",
4118 Self::FifoViolation => "FIFO_VIOLATION",
4119 Self::BoundsViolation => "BOUNDS_VIOLATION",
4120 Self::ClientRequestReplaced => "CLIENT_REQUEST_REPLACED",
4121 Self::DividendAdjustmentReplaced => "DIVIDEND_ADJUSTMENT_REPLACED",
4122 Self::InsufficientLiquidity => "INSUFFICIENT_LIQUIDITY",
4123 Self::TakeProfitOnFillGtdTimestampInPast => "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST",
4124 Self::TakeProfitOnFillLoss => "TAKE_PROFIT_ON_FILL_LOSS",
4125 Self::LosingTakeProfit => "LOSING_TAKE_PROFIT",
4126 Self::StopLossOnFillGtdTimestampInPast => "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST",
4127 Self::StopLossOnFillLoss => "STOP_LOSS_ON_FILL_LOSS",
4128 Self::StopLossOnFillPriceDistanceMaximumExceeded => {
4129 "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
4130 }
4131 Self::StopLossOnFillRequired => "STOP_LOSS_ON_FILL_REQUIRED",
4132 Self::StopLossOnFillGuaranteedRequired => "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED",
4133 Self::StopLossOnFillGuaranteedNotAllowed => "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED",
4134 Self::StopLossOnFillGuaranteedMinimumDistanceNotMet => {
4135 "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"
4136 }
4137 Self::StopLossOnFillGuaranteedLevelRestrictionExceeded => {
4138 "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"
4139 }
4140 Self::StopLossOnFillGuaranteedHedgingNotAllowed => {
4141 "STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED"
4142 }
4143 Self::StopLossOnFillTimeInForceInvalid => "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID",
4144 Self::StopLossOnFillTriggerConditionInvalid => {
4145 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
4146 }
4147 Self::GuaranteedStopLossOnFillGtdTimestampInPast => {
4148 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"
4149 }
4150 Self::GuaranteedStopLossOnFillLoss => "GUARANTEED_STOP_LOSS_ON_FILL_LOSS",
4151 Self::GuaranteedStopLossOnFillPriceDistanceMaximumExceeded => {
4152 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
4153 }
4154 Self::GuaranteedStopLossOnFillRequired => "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED",
4155 Self::GuaranteedStopLossOnFillNotAllowed => "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED",
4156 Self::GuaranteedStopLossOnFillMinimumDistanceNotMet => {
4157 "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET"
4158 }
4159 Self::GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded => {
4160 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED"
4161 }
4162 Self::GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded => {
4163 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED"
4164 }
4165 Self::GuaranteedStopLossOnFillHedgingNotAllowed => {
4166 "GUARANTEED_STOP_LOSS_ON_FILL_HEDGING_NOT_ALLOWED"
4167 }
4168 Self::GuaranteedStopLossOnFillTimeInForceInvalid => {
4169 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"
4170 }
4171 Self::GuaranteedStopLossOnFillTriggerConditionInvalid => {
4172 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
4173 }
4174 Self::TakeProfitOnFillPriceDistanceMaximumExceeded => {
4175 "TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
4176 }
4177 Self::TrailingStopLossOnFillGtdTimestampInPast => {
4178 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"
4179 }
4180 Self::ClientTradeIdAlreadyExists => "CLIENT_TRADE_ID_ALREADY_EXISTS",
4181 Self::PositionCloseoutFailed => "POSITION_CLOSEOUT_FAILED",
4182 Self::OpenTradesAllowedExceeded => "OPEN_TRADES_ALLOWED_EXCEEDED",
4183 Self::PendingOrdersAllowedExceeded => "PENDING_ORDERS_ALLOWED_EXCEEDED",
4184 Self::TakeProfitOnFillClientOrderIdAlreadyExists => {
4185 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"
4186 }
4187 Self::StopLossOnFillClientOrderIdAlreadyExists => {
4188 "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"
4189 }
4190 Self::GuaranteedStopLossOnFillClientOrderIdAlreadyExists => {
4191 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"
4192 }
4193 Self::TrailingStopLossOnFillClientOrderIdAlreadyExists => {
4194 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"
4195 }
4196 Self::PositionSizeExceeded => "POSITION_SIZE_EXCEEDED",
4197 Self::HedgingGsloViolation => "HEDGING_GSLO_VIOLATION",
4198 Self::AccountPositionValueLimitExceeded => "ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED",
4199 Self::InstrumentBidReduceOnly => "INSTRUMENT_BID_REDUCE_ONLY",
4200 Self::InstrumentAskReduceOnly => "INSTRUMENT_ASK_REDUCE_ONLY",
4201 Self::InstrumentBidHalted => "INSTRUMENT_BID_HALTED",
4202 Self::InstrumentAskHalted => "INSTRUMENT_ASK_HALTED",
4203 Self::StopLossOnFillGuaranteedBidHalted => "STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED",
4204 Self::StopLossOnFillGuaranteedAskHalted => "STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED",
4205 Self::GuaranteedStopLossOnFillBidHalted => "GUARANTEED_STOP_LOSS_ON_FILL_BID_HALTED",
4206 Self::GuaranteedStopLossOnFillAskHalted => "GUARANTEED_STOP_LOSS_ON_FILL_ASK_HALTED",
4207 Self::FifoViolationSafeguardViolation => "FIFO_VIOLATION_SAFEGUARD_VIOLATION",
4208 Self::FifoViolationSafeguardPartialCloseViolation => {
4209 "FIFO_VIOLATION_SAFEGUARD_PARTIAL_CLOSE_VIOLATION"
4210 }
4211 Self::OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation => {
4212 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
4213 }
4214 Self::Unknown(value) => value,
4215 }
4216 }
4217}
4218
4219impl Serialize for OrderCancelReason {
4220 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
4221 serializer.serialize_str(self.as_str())
4222 }
4223}
4224
4225impl<'de> Deserialize<'de> for OrderCancelReason {
4226 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4227 let value = String::deserialize(deserializer)?;
4228 Ok(match value.as_str() {
4229 "INTERNAL_SERVER_ERROR" => Self::InternalServerError,
4230 "ACCOUNT_LOCKED" => Self::AccountLocked,
4231 "ACCOUNT_NEW_POSITIONS_LOCKED" => Self::AccountNewPositionsLocked,
4232 "ACCOUNT_ORDER_CREATION_LOCKED" => Self::AccountOrderCreationLocked,
4233 "ACCOUNT_ORDER_FILL_LOCKED" => Self::AccountOrderFillLocked,
4234 "CLIENT_REQUEST" => Self::ClientRequest,
4235 "MIGRATION" => Self::Migration,
4236 "MARKET_HALTED" => Self::MarketHalted,
4237 "LINKED_TRADE_CLOSED" => Self::LinkedTradeClosed,
4238 "TIME_IN_FORCE_EXPIRED" => Self::TimeInForceExpired,
4239 "INSUFFICIENT_MARGIN" => Self::InsufficientMargin,
4240 "FIFO_VIOLATION" => Self::FifoViolation,
4241 "BOUNDS_VIOLATION" => Self::BoundsViolation,
4242 "CLIENT_REQUEST_REPLACED" => Self::ClientRequestReplaced,
4243 "DIVIDEND_ADJUSTMENT_REPLACED" => Self::DividendAdjustmentReplaced,
4244 "INSUFFICIENT_LIQUIDITY" => Self::InsufficientLiquidity,
4245 "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST" => Self::TakeProfitOnFillGtdTimestampInPast,
4246 "TAKE_PROFIT_ON_FILL_LOSS" => Self::TakeProfitOnFillLoss,
4247 "LOSING_TAKE_PROFIT" => Self::LosingTakeProfit,
4248 "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => Self::StopLossOnFillGtdTimestampInPast,
4249 "STOP_LOSS_ON_FILL_LOSS" => Self::StopLossOnFillLoss,
4250 "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
4251 Self::StopLossOnFillPriceDistanceMaximumExceeded
4252 }
4253 "STOP_LOSS_ON_FILL_REQUIRED" => Self::StopLossOnFillRequired,
4254 "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED" => Self::StopLossOnFillGuaranteedRequired,
4255 "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED" => Self::StopLossOnFillGuaranteedNotAllowed,
4256 "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" => {
4257 Self::StopLossOnFillGuaranteedMinimumDistanceNotMet
4258 }
4259 "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" => {
4260 Self::StopLossOnFillGuaranteedLevelRestrictionExceeded
4261 }
4262 "STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED" => {
4263 Self::StopLossOnFillGuaranteedHedgingNotAllowed
4264 }
4265 "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => Self::StopLossOnFillTimeInForceInvalid,
4266 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
4267 Self::StopLossOnFillTriggerConditionInvalid
4268 }
4269 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => {
4270 Self::GuaranteedStopLossOnFillGtdTimestampInPast
4271 }
4272 "GUARANTEED_STOP_LOSS_ON_FILL_LOSS" => Self::GuaranteedStopLossOnFillLoss,
4273 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
4274 Self::GuaranteedStopLossOnFillPriceDistanceMaximumExceeded
4275 }
4276 "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED" => Self::GuaranteedStopLossOnFillRequired,
4277 "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED" => Self::GuaranteedStopLossOnFillNotAllowed,
4278 "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET" => {
4279 Self::GuaranteedStopLossOnFillMinimumDistanceNotMet
4280 }
4281 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED" => {
4282 Self::GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded
4283 }
4284 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" => {
4285 Self::GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded
4286 }
4287 "GUARANTEED_STOP_LOSS_ON_FILL_HEDGING_NOT_ALLOWED" => {
4288 Self::GuaranteedStopLossOnFillHedgingNotAllowed
4289 }
4290 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => {
4291 Self::GuaranteedStopLossOnFillTimeInForceInvalid
4292 }
4293 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
4294 Self::GuaranteedStopLossOnFillTriggerConditionInvalid
4295 }
4296 "TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
4297 Self::TakeProfitOnFillPriceDistanceMaximumExceeded
4298 }
4299 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => {
4300 Self::TrailingStopLossOnFillGtdTimestampInPast
4301 }
4302 "CLIENT_TRADE_ID_ALREADY_EXISTS" => Self::ClientTradeIdAlreadyExists,
4303 "POSITION_CLOSEOUT_FAILED" => Self::PositionCloseoutFailed,
4304 "OPEN_TRADES_ALLOWED_EXCEEDED" => Self::OpenTradesAllowedExceeded,
4305 "PENDING_ORDERS_ALLOWED_EXCEEDED" => Self::PendingOrdersAllowedExceeded,
4306 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" => {
4307 Self::TakeProfitOnFillClientOrderIdAlreadyExists
4308 }
4309 "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" => {
4310 Self::StopLossOnFillClientOrderIdAlreadyExists
4311 }
4312 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" => {
4313 Self::GuaranteedStopLossOnFillClientOrderIdAlreadyExists
4314 }
4315 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS" => {
4316 Self::TrailingStopLossOnFillClientOrderIdAlreadyExists
4317 }
4318 "POSITION_SIZE_EXCEEDED" => Self::PositionSizeExceeded,
4319 "HEDGING_GSLO_VIOLATION" => Self::HedgingGsloViolation,
4320 "ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED" => Self::AccountPositionValueLimitExceeded,
4321 "INSTRUMENT_BID_REDUCE_ONLY" => Self::InstrumentBidReduceOnly,
4322 "INSTRUMENT_ASK_REDUCE_ONLY" => Self::InstrumentAskReduceOnly,
4323 "INSTRUMENT_BID_HALTED" => Self::InstrumentBidHalted,
4324 "INSTRUMENT_ASK_HALTED" => Self::InstrumentAskHalted,
4325 "STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED" => Self::StopLossOnFillGuaranteedBidHalted,
4326 "STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED" => Self::StopLossOnFillGuaranteedAskHalted,
4327 "GUARANTEED_STOP_LOSS_ON_FILL_BID_HALTED" => Self::GuaranteedStopLossOnFillBidHalted,
4328 "GUARANTEED_STOP_LOSS_ON_FILL_ASK_HALTED" => Self::GuaranteedStopLossOnFillAskHalted,
4329 "FIFO_VIOLATION_SAFEGUARD_VIOLATION" => Self::FifoViolationSafeguardViolation,
4330 "FIFO_VIOLATION_SAFEGUARD_PARTIAL_CLOSE_VIOLATION" => {
4331 Self::FifoViolationSafeguardPartialCloseViolation
4332 }
4333 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
4334 Self::OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation
4335 }
4336 _ => Self::Unknown(value),
4337 })
4338 }
4339}
4340
4341#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4343#[serde(rename_all = "camelCase")]
4344pub struct OpenTradeDividendAdjustment {
4345 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4347 pub trade_id: Option<TradeID>,
4348 #[serde(
4350 rename = "dividendAdjustment",
4351 default,
4352 skip_serializing_if = "Option::is_none"
4353 )]
4354 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4355 pub dividend_adjustment: Option<Decimal>,
4356 #[serde(
4358 rename = "quoteDividendAdjustment",
4359 default,
4360 skip_serializing_if = "Option::is_none"
4361 )]
4362 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4363 pub quote_dividend_adjustment: Option<Decimal>,
4364}
4365
4366#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4369#[serde(rename_all = "camelCase")]
4370pub struct ClientExtensions {
4371 #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
4373 pub id: Option<ClientID>,
4374 #[serde(rename = "tag", default, skip_serializing_if = "Option::is_none")]
4376 pub tag: Option<ClientTag>,
4377 #[serde(rename = "comment", default, skip_serializing_if = "Option::is_none")]
4379 pub comment: Option<ClientComment>,
4380}
4381
4382#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4386#[serde(rename_all = "camelCase")]
4387pub struct TakeProfitDetails {
4388 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4391 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4392 pub price: Option<Decimal>,
4393 #[serde(
4395 rename = "timeInForce",
4396 default,
4397 skip_serializing_if = "Option::is_none"
4398 )]
4399 pub time_in_force: Option<TimeInForce>,
4400 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
4402 pub gtd_time: Option<Timestamp>,
4403 #[serde(
4405 rename = "clientExtensions",
4406 default,
4407 skip_serializing_if = "Option::is_none"
4408 )]
4409 pub client_extensions: Option<ClientExtensions>,
4410}
4411
4412#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4416#[serde(rename_all = "camelCase")]
4417pub struct StopLossDetails {
4418 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4421 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4422 pub price: Option<Decimal>,
4423 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
4426 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4427 pub distance: Option<Decimal>,
4428 #[serde(
4430 rename = "timeInForce",
4431 default,
4432 skip_serializing_if = "Option::is_none"
4433 )]
4434 pub time_in_force: Option<TimeInForce>,
4435 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
4437 pub gtd_time: Option<Timestamp>,
4438 #[serde(
4440 rename = "clientExtensions",
4441 default,
4442 skip_serializing_if = "Option::is_none"
4443 )]
4444 pub client_extensions: Option<ClientExtensions>,
4445 #[serde(
4449 rename = "guaranteed",
4450 default,
4451 skip_serializing_if = "Option::is_none"
4452 )]
4453 pub guaranteed: Option<bool>,
4454}
4455
4456#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4460#[serde(rename_all = "camelCase")]
4461pub struct GuaranteedStopLossDetails {
4462 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4465 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4466 pub price: Option<Decimal>,
4467 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
4470 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4471 pub distance: Option<Decimal>,
4472 #[serde(
4474 rename = "timeInForce",
4475 default,
4476 skip_serializing_if = "Option::is_none"
4477 )]
4478 pub time_in_force: Option<TimeInForce>,
4479 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
4481 pub gtd_time: Option<Timestamp>,
4482 #[serde(
4484 rename = "clientExtensions",
4485 default,
4486 skip_serializing_if = "Option::is_none"
4487 )]
4488 pub client_extensions: Option<ClientExtensions>,
4489}
4490
4491#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4495#[serde(rename_all = "camelCase")]
4496pub struct TrailingStopLossDetails {
4497 #[serde(rename = "distance", default, skip_serializing_if = "Option::is_none")]
4500 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4501 pub distance: Option<Decimal>,
4502 #[serde(
4504 rename = "timeInForce",
4505 default,
4506 skip_serializing_if = "Option::is_none"
4507 )]
4508 pub time_in_force: Option<TimeInForce>,
4509 #[serde(rename = "gtdTime", default, skip_serializing_if = "Option::is_none")]
4511 pub gtd_time: Option<Timestamp>,
4512 #[serde(
4514 rename = "clientExtensions",
4515 default,
4516 skip_serializing_if = "Option::is_none"
4517 )]
4518 pub client_extensions: Option<ClientExtensions>,
4519}
4520
4521#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4525#[serde(rename_all = "camelCase")]
4526pub struct TradeOpen {
4527 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4529 pub trade_id: Option<TradeID>,
4530 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
4532 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4533 pub units: Option<Decimal>,
4534 #[serde(rename = "price", default, skip_serializing_if = "Option::is_none")]
4536 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4537 pub price: Option<Decimal>,
4538 #[serde(
4540 rename = "guaranteedExecutionFee",
4541 default,
4542 skip_serializing_if = "Option::is_none"
4543 )]
4544 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4545 pub guaranteed_execution_fee: Option<Decimal>,
4546 #[serde(
4549 rename = "quoteGuaranteedExecutionFee",
4550 default,
4551 skip_serializing_if = "Option::is_none"
4552 )]
4553 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4554 pub quote_guaranteed_execution_fee: Option<Decimal>,
4555 #[serde(
4557 rename = "clientExtensions",
4558 default,
4559 skip_serializing_if = "Option::is_none"
4560 )]
4561 pub client_extensions: Option<ClientExtensions>,
4562 #[serde(
4565 rename = "halfSpreadCost",
4566 default,
4567 skip_serializing_if = "Option::is_none"
4568 )]
4569 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4570 pub half_spread_cost: Option<Decimal>,
4571 #[serde(
4574 rename = "initialMarginRequired",
4575 default,
4576 skip_serializing_if = "Option::is_none"
4577 )]
4578 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4579 pub initial_margin_required: Option<Decimal>,
4580}
4581
4582#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4586#[serde(rename_all = "camelCase")]
4587pub struct TradeReduce {
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")]
4598 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4599 pub price: Option<Decimal>,
4600 #[serde(
4602 rename = "realizedPL",
4603 default,
4604 skip_serializing_if = "Option::is_none"
4605 )]
4606 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4607 pub realized_pl: Option<Decimal>,
4608 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
4610 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4611 pub financing: Option<Decimal>,
4612 #[serde(
4614 rename = "baseFinancing",
4615 default,
4616 skip_serializing_if = "Option::is_none"
4617 )]
4618 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4619 pub base_financing: Option<Decimal>,
4620 #[serde(
4622 rename = "quoteFinancing",
4623 default,
4624 skip_serializing_if = "Option::is_none"
4625 )]
4626 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4627 pub quote_financing: Option<Decimal>,
4628 #[serde(
4633 rename = "financingRate",
4634 default,
4635 skip_serializing_if = "Option::is_none"
4636 )]
4637 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4638 pub financing_rate: Option<Decimal>,
4639 #[serde(
4642 rename = "guaranteedExecutionFee",
4643 default,
4644 skip_serializing_if = "Option::is_none"
4645 )]
4646 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4647 pub guaranteed_execution_fee: Option<Decimal>,
4648 #[serde(
4651 rename = "quoteGuaranteedExecutionFee",
4652 default,
4653 skip_serializing_if = "Option::is_none"
4654 )]
4655 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4656 pub quote_guaranteed_execution_fee: Option<Decimal>,
4657 #[serde(
4660 rename = "halfSpreadCost",
4661 default,
4662 skip_serializing_if = "Option::is_none"
4663 )]
4664 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4665 pub half_spread_cost: Option<Decimal>,
4666}
4667
4668#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4671#[serde(rename_all = "camelCase")]
4672pub struct MarketOrderTradeClose {
4673 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4675 pub trade_id: Option<TradeID>,
4676 #[serde(
4678 rename = "clientTradeID",
4679 default,
4680 skip_serializing_if = "Option::is_none"
4681 )]
4682 pub client_trade_id: Option<String>,
4683 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
4686 pub units: Option<String>,
4687}
4688
4689#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4692#[serde(rename_all = "camelCase")]
4693pub struct MarketOrderMarginCloseout {
4694 #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
4696 pub reason: Option<MarketOrderMarginCloseoutReason>,
4697}
4698
4699#[derive(Debug, Clone, PartialEq, Eq, Hash)]
4701#[non_exhaustive]
4702pub enum MarketOrderMarginCloseoutReason {
4703 MarginCheckViolation,
4705 RegulatoryMarginCallViolation,
4708 RegulatoryMarginCheckViolation,
4710 Unknown(String),
4712}
4713
4714impl MarketOrderMarginCloseoutReason {
4715 pub fn as_str(&self) -> &str {
4717 match self {
4718 Self::MarginCheckViolation => "MARGIN_CHECK_VIOLATION",
4719 Self::RegulatoryMarginCallViolation => "REGULATORY_MARGIN_CALL_VIOLATION",
4720 Self::RegulatoryMarginCheckViolation => "REGULATORY_MARGIN_CHECK_VIOLATION",
4721 Self::Unknown(value) => value,
4722 }
4723 }
4724}
4725
4726impl Serialize for MarketOrderMarginCloseoutReason {
4727 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
4728 serializer.serialize_str(self.as_str())
4729 }
4730}
4731
4732impl<'de> Deserialize<'de> for MarketOrderMarginCloseoutReason {
4733 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
4734 let value = String::deserialize(deserializer)?;
4735 Ok(match value.as_str() {
4736 "MARGIN_CHECK_VIOLATION" => Self::MarginCheckViolation,
4737 "REGULATORY_MARGIN_CALL_VIOLATION" => Self::RegulatoryMarginCallViolation,
4738 "REGULATORY_MARGIN_CHECK_VIOLATION" => Self::RegulatoryMarginCheckViolation,
4739 _ => Self::Unknown(value),
4740 })
4741 }
4742}
4743
4744#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4748#[serde(rename_all = "camelCase")]
4749pub struct MarketOrderDelayedTradeClose {
4750 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4752 pub trade_id: Option<TradeID>,
4753 #[serde(
4755 rename = "clientTradeID",
4756 default,
4757 skip_serializing_if = "Option::is_none"
4758 )]
4759 pub client_trade_id: Option<TradeID>,
4760 #[serde(
4762 rename = "sourceTransactionID",
4763 default,
4764 skip_serializing_if = "Option::is_none"
4765 )]
4766 pub source_transaction_id: Option<TransactionID>,
4767}
4768
4769#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4772#[serde(rename_all = "camelCase")]
4773pub struct MarketOrderPositionCloseout {
4774 #[serde(
4776 rename = "instrument",
4777 default,
4778 skip_serializing_if = "Option::is_none"
4779 )]
4780 pub instrument: Option<InstrumentName>,
4781 #[serde(rename = "units", default, skip_serializing_if = "Option::is_none")]
4785 pub units: Option<String>,
4786}
4787
4788#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4793#[serde(rename_all = "camelCase")]
4794pub struct LiquidityRegenerationSchedule {
4795 #[serde(rename = "steps", default, skip_serializing_if = "Option::is_none")]
4797 pub steps: Option<Vec<LiquidityRegenerationScheduleStep>>,
4798}
4799
4800#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4803#[serde(rename_all = "camelCase")]
4804pub struct LiquidityRegenerationScheduleStep {
4805 #[serde(rename = "timestamp", default, skip_serializing_if = "Option::is_none")]
4807 pub timestamp: Option<Timestamp>,
4808 #[serde(
4810 rename = "bidLiquidityUsed",
4811 default,
4812 skip_serializing_if = "Option::is_none"
4813 )]
4814 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4815 pub bid_liquidity_used: Option<Decimal>,
4816 #[serde(
4818 rename = "askLiquidityUsed",
4819 default,
4820 skip_serializing_if = "Option::is_none"
4821 )]
4822 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4823 pub ask_liquidity_used: Option<Decimal>,
4824}
4825
4826#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4828#[serde(rename_all = "camelCase")]
4829pub struct OpenTradeFinancing {
4830 #[serde(rename = "tradeID", default, skip_serializing_if = "Option::is_none")]
4832 pub trade_id: Option<TradeID>,
4833 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
4835 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4836 pub financing: Option<Decimal>,
4837 #[serde(
4839 rename = "baseFinancing",
4840 default,
4841 skip_serializing_if = "Option::is_none"
4842 )]
4843 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4844 pub base_financing: Option<Decimal>,
4845 #[serde(
4847 rename = "quoteFinancing",
4848 default,
4849 skip_serializing_if = "Option::is_none"
4850 )]
4851 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4852 pub quote_financing: Option<Decimal>,
4853 #[serde(
4858 rename = "financingRate",
4859 default,
4860 skip_serializing_if = "Option::is_none"
4861 )]
4862 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4863 pub financing_rate: Option<Decimal>,
4864}
4865
4866#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4868#[serde(rename_all = "camelCase")]
4869pub struct PositionFinancing {
4870 #[serde(
4872 rename = "instrument",
4873 default,
4874 skip_serializing_if = "Option::is_none"
4875 )]
4876 pub instrument: Option<InstrumentName>,
4877 #[serde(rename = "financing", default, skip_serializing_if = "Option::is_none")]
4879 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4880 pub financing: Option<Decimal>,
4881 #[serde(
4883 rename = "baseFinancing",
4884 default,
4885 skip_serializing_if = "Option::is_none"
4886 )]
4887 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4888 pub base_financing: Option<Decimal>,
4889 #[serde(
4891 rename = "quoteFinancing",
4892 default,
4893 skip_serializing_if = "Option::is_none"
4894 )]
4895 #[serde(deserialize_with = "crate::decimal_wire::optional_number_or_string")]
4896 pub quote_financing: Option<Decimal>,
4897 #[serde(
4899 rename = "homeConversionFactors",
4900 default,
4901 skip_serializing_if = "Option::is_none"
4902 )]
4903 pub home_conversion_factors: Option<HomeConversionFactors>,
4904 #[serde(
4906 rename = "openTradeFinancings",
4907 default,
4908 skip_serializing_if = "Option::is_none"
4909 )]
4910 pub open_trade_financings: Option<Vec<OpenTradeFinancing>>,
4911 #[serde(
4913 rename = "accountFinancingMode",
4914 default,
4915 skip_serializing_if = "Option::is_none"
4916 )]
4917 pub account_financing_mode: Option<AccountFinancingMode>,
4918}
4919
4920#[derive(Debug, Clone, PartialEq, Eq, Hash)]
4922#[non_exhaustive]
4923pub enum TransactionRejectReason {
4924 InternalServerError,
4926 InstrumentPriceUnknown,
4928 AccountNotActive,
4930 AccountLocked,
4932 AccountOrderCreationLocked,
4934 AccountConfigurationLocked,
4936 AccountDepositLocked,
4938 AccountWithdrawalLocked,
4940 AccountOrderCancelLocked,
4942 InstrumentNotTradeable,
4944 PendingOrdersAllowedExceeded,
4946 OrderIdUnspecified,
4948 OrderDoesntExist,
4950 OrderIdentifierInconsistency,
4952 TradeIdUnspecified,
4954 TradeDoesntExist,
4956 TradeIdentifierInconsistency,
4958 InsufficientMargin,
4961 InstrumentMissing,
4963 InstrumentUnknown,
4965 UnitsMissing,
4967 UnitsInvalid,
4969 UnitsPrecisionExceeded,
4971 UnitsLimitExceeded,
4973 UnitsMinimumNotMet,
4975 PriceMissing,
4977 PriceInvalid,
4979 PricePrecisionExceeded,
4981 PriceDistanceMissing,
4983 PriceDistanceInvalid,
4985 PriceDistancePrecisionExceeded,
4987 PriceDistanceMaximumExceeded,
4989 PriceDistanceMinimumNotMet,
4991 TimeInForceMissing,
4993 TimeInForceInvalid,
4995 TimeInForceGtdTimestampMissing,
4997 TimeInForceGtdTimestampInPast,
4999 PriceBoundInvalid,
5001 PriceBoundPrecisionExceeded,
5003 OrdersOnFillDuplicateClientOrderIds,
5005 TradeOnFillClientExtensionsNotSupported,
5007 ClientOrderIdInvalid,
5009 ClientOrderIdAlreadyExists,
5011 ClientOrderTagInvalid,
5013 ClientOrderCommentInvalid,
5015 ClientTradeIdInvalid,
5017 ClientTradeIdAlreadyExists,
5019 ClientTradeTagInvalid,
5021 ClientTradeCommentInvalid,
5023 OrderFillPositionActionMissing,
5025 OrderFillPositionActionInvalid,
5027 TriggerConditionMissing,
5029 TriggerConditionInvalid,
5031 OrderPartialFillOptionMissing,
5033 OrderPartialFillOptionInvalid,
5035 InvalidReissueImmediatePartialFill,
5038 OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation,
5041 OrdersOnFillRmoMutualExclusivityGsloExcludesOthersViolation,
5045 TakeProfitOrderAlreadyExists,
5047 TakeProfitOrderWouldViolateFifoViolationSafeguard,
5050 TakeProfitOnFillPriceMissing,
5052 TakeProfitOnFillPriceInvalid,
5054 TakeProfitOnFillPricePrecisionExceeded,
5057 TakeProfitOnFillTimeInForceMissing,
5059 TakeProfitOnFillTimeInForceInvalid,
5061 TakeProfitOnFillGtdTimestampMissing,
5063 TakeProfitOnFillGtdTimestampInPast,
5065 TakeProfitOnFillClientOrderIdInvalid,
5067 TakeProfitOnFillClientOrderTagInvalid,
5069 TakeProfitOnFillClientOrderCommentInvalid,
5071 TakeProfitOnFillTriggerConditionMissing,
5073 TakeProfitOnFillTriggerConditionInvalid,
5075 StopLossOrderAlreadyExists,
5077 StopLossOrderGuaranteedRequired,
5080 StopLossOrderGuaranteedPriceWithinSpread,
5083 StopLossOrderGuaranteedNotAllowed,
5086 StopLossOrderGuaranteedHaltedCreateViolation,
5088 StopLossOrderGuaranteedHaltedTightenViolation,
5091 StopLossOrderGuaranteedHedgingNotAllowed,
5095 StopLossOrderGuaranteedMinimumDistanceNotMet,
5098 StopLossOrderNotCancelable,
5101 StopLossOrderNotReplaceable,
5104 StopLossOrderGuaranteedLevelRestrictionExceeded,
5107 StopLossOrderPriceAndDistanceBothSpecified,
5109 StopLossOrderPriceAndDistanceBothMissing,
5111 StopLossOrderWouldViolateFifoViolationSafeguard,
5114 StopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation,
5117 StopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation,
5121 StopLossOnFillRequiredForPendingOrder,
5124 StopLossOnFillGuaranteedNotAllowed,
5128 StopLossOnFillGuaranteedRequired,
5132 StopLossOnFillPriceMissing,
5134 StopLossOnFillPriceInvalid,
5136 StopLossOnFillPricePrecisionExceeded,
5138 StopLossOnFillGuaranteedMinimumDistanceNotMet,
5142 StopLossOnFillGuaranteedLevelRestrictionExceeded,
5145 StopLossOnFillDistanceInvalid,
5147 StopLossOnFillPriceDistanceMaximumExceeded,
5149 StopLossOnFillDistancePrecisionExceeded,
5151 StopLossOnFillPriceAndDistanceBothSpecified,
5153 StopLossOnFillPriceAndDistanceBothMissing,
5155 StopLossOnFillTimeInForceMissing,
5157 StopLossOnFillTimeInForceInvalid,
5159 StopLossOnFillGtdTimestampMissing,
5161 StopLossOnFillGtdTimestampInPast,
5163 StopLossOnFillClientOrderIdInvalid,
5165 StopLossOnFillClientOrderTagInvalid,
5167 StopLossOnFillClientOrderCommentInvalid,
5169 StopLossOnFillTriggerConditionMissing,
5171 StopLossOnFillTriggerConditionInvalid,
5173 GuaranteedStopLossOrderAlreadyExists,
5175 GuaranteedStopLossOrderRequired,
5178 GuaranteedStopLossOrderPriceWithinSpread,
5181 GuaranteedStopLossOrderNotAllowed,
5184 GuaranteedStopLossOrderHaltedCreateViolation,
5186 GuaranteedStopLossOrderCreateViolation,
5188 GuaranteedStopLossOrderHaltedTightenViolation,
5191 GuaranteedStopLossOrderTightenViolation,
5194 GuaranteedStopLossOrderHedgingNotAllowed,
5198 GuaranteedStopLossOrderMinimumDistanceNotMet,
5201 GuaranteedStopLossOrderNotCancelable,
5204 GuaranteedStopLossOrderHaltedNotCancelable,
5207 GuaranteedStopLossOrderNotReplaceable,
5210 GuaranteedStopLossOrderHaltedNotReplaceable,
5213 GuaranteedStopLossOrderLevelRestrictionVolumeExceeded,
5216 GuaranteedStopLossOrderLevelRestrictionPriceRangeExceeded,
5219 GuaranteedStopLossOrderPriceAndDistanceBothSpecified,
5221 GuaranteedStopLossOrderPriceAndDistanceBothMissing,
5223 GuaranteedStopLossOrderWouldViolateFifoViolationSafeguard,
5226 GuaranteedStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation,
5229 GuaranteedStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation,
5233 GuaranteedStopLossOnFillRequiredForPendingOrder,
5236 GuaranteedStopLossOnFillNotAllowed,
5240 GuaranteedStopLossOnFillRequired,
5244 GuaranteedStopLossOnFillPriceMissing,
5246 GuaranteedStopLossOnFillPriceInvalid,
5248 GuaranteedStopLossOnFillPricePrecisionExceeded,
5251 GuaranteedStopLossOnFillMinimumDistanceNotMet,
5255 GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded,
5258 GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded,
5261 GuaranteedStopLossOnFillDistanceInvalid,
5263 GuaranteedStopLossOnFillPriceDistanceMaximumExceeded,
5265 GuaranteedStopLossOnFillDistancePrecisionExceeded,
5267 GuaranteedStopLossOnFillPriceAndDistanceBothSpecified,
5269 GuaranteedStopLossOnFillPriceAndDistanceBothMissing,
5271 GuaranteedStopLossOnFillTimeInForceMissing,
5273 GuaranteedStopLossOnFillTimeInForceInvalid,
5275 GuaranteedStopLossOnFillGtdTimestampMissing,
5277 GuaranteedStopLossOnFillGtdTimestampInPast,
5279 GuaranteedStopLossOnFillClientOrderIdInvalid,
5281 GuaranteedStopLossOnFillClientOrderTagInvalid,
5283 GuaranteedStopLossOnFillClientOrderCommentInvalid,
5285 GuaranteedStopLossOnFillTriggerConditionMissing,
5287 GuaranteedStopLossOnFillTriggerConditionInvalid,
5289 TrailingStopLossOrderAlreadyExists,
5291 TrailingStopLossOrderWouldViolateFifoViolationSafeguard,
5294 TrailingStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation,
5297 TrailingStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation,
5301 TrailingStopLossOnFillPriceDistanceMissing,
5303 TrailingStopLossOnFillPriceDistanceInvalid,
5305 TrailingStopLossOnFillPriceDistancePrecisionExceeded,
5307 TrailingStopLossOnFillPriceDistanceMaximumExceeded,
5309 TrailingStopLossOnFillPriceDistanceMinimumNotMet,
5311 TrailingStopLossOnFillTimeInForceMissing,
5313 TrailingStopLossOnFillTimeInForceInvalid,
5315 TrailingStopLossOnFillGtdTimestampMissing,
5317 TrailingStopLossOnFillGtdTimestampInPast,
5319 TrailingStopLossOnFillClientOrderIdInvalid,
5321 TrailingStopLossOnFillClientOrderTagInvalid,
5323 TrailingStopLossOnFillClientOrderCommentInvalid,
5325 TrailingStopLossOrdersNotSupported,
5328 TrailingStopLossOnFillTriggerConditionMissing,
5330 TrailingStopLossOnFillTriggerConditionInvalid,
5332 CloseTradeTypeMissing,
5334 CloseTradePartialUnitsMissing,
5336 CloseTradeUnitsExceedTradeSize,
5339 CloseoutPositionDoesntExist,
5341 CloseoutPositionIncompleteSpecification,
5343 CloseoutPositionUnitsExceedPositionSize,
5345 CloseoutPositionReject,
5347 CloseoutPositionPartialUnitsMissing,
5349 MarkupGroupIdInvalid,
5351 PositionAggregationModeInvalid,
5353 AdminConfigureDataMissing,
5355 MarginRateInvalid,
5357 MarginRateWouldTriggerCloseout,
5359 AliasInvalid,
5361 ClientConfigureDataMissing,
5363 MarginRateWouldTriggerMarginCall,
5365 AmountInvalid,
5367 InsufficientFunds,
5369 AmountMissing,
5371 FundingReasonMissing,
5373 OcaOrderIdsStopLossNotAllowed,
5376 ClientExtensionsDataMissing,
5378 ReplacingOrderInvalid,
5380 ReplacingTradeIdInvalid,
5382 OrderCancelWouldTriggerCloseout,
5384 Unknown(String),
5386}
5387
5388impl TransactionRejectReason {
5389 pub fn as_str(&self) -> &str {
5391 match self {
5392 Self::InternalServerError => "INTERNAL_SERVER_ERROR",
5393 Self::InstrumentPriceUnknown => "INSTRUMENT_PRICE_UNKNOWN",
5394 Self::AccountNotActive => "ACCOUNT_NOT_ACTIVE",
5395 Self::AccountLocked => "ACCOUNT_LOCKED",
5396 Self::AccountOrderCreationLocked => "ACCOUNT_ORDER_CREATION_LOCKED",
5397 Self::AccountConfigurationLocked => "ACCOUNT_CONFIGURATION_LOCKED",
5398 Self::AccountDepositLocked => "ACCOUNT_DEPOSIT_LOCKED",
5399 Self::AccountWithdrawalLocked => "ACCOUNT_WITHDRAWAL_LOCKED",
5400 Self::AccountOrderCancelLocked => "ACCOUNT_ORDER_CANCEL_LOCKED",
5401 Self::InstrumentNotTradeable => "INSTRUMENT_NOT_TRADEABLE",
5402 Self::PendingOrdersAllowedExceeded => "PENDING_ORDERS_ALLOWED_EXCEEDED",
5403 Self::OrderIdUnspecified => "ORDER_ID_UNSPECIFIED",
5404 Self::OrderDoesntExist => "ORDER_DOESNT_EXIST",
5405 Self::OrderIdentifierInconsistency => "ORDER_IDENTIFIER_INCONSISTENCY",
5406 Self::TradeIdUnspecified => "TRADE_ID_UNSPECIFIED",
5407 Self::TradeDoesntExist => "TRADE_DOESNT_EXIST",
5408 Self::TradeIdentifierInconsistency => "TRADE_IDENTIFIER_INCONSISTENCY",
5409 Self::InsufficientMargin => "INSUFFICIENT_MARGIN",
5410 Self::InstrumentMissing => "INSTRUMENT_MISSING",
5411 Self::InstrumentUnknown => "INSTRUMENT_UNKNOWN",
5412 Self::UnitsMissing => "UNITS_MISSING",
5413 Self::UnitsInvalid => "UNITS_INVALID",
5414 Self::UnitsPrecisionExceeded => "UNITS_PRECISION_EXCEEDED",
5415 Self::UnitsLimitExceeded => "UNITS_LIMIT_EXCEEDED",
5416 Self::UnitsMinimumNotMet => "UNITS_MINIMUM_NOT_MET",
5417 Self::PriceMissing => "PRICE_MISSING",
5418 Self::PriceInvalid => "PRICE_INVALID",
5419 Self::PricePrecisionExceeded => "PRICE_PRECISION_EXCEEDED",
5420 Self::PriceDistanceMissing => "PRICE_DISTANCE_MISSING",
5421 Self::PriceDistanceInvalid => "PRICE_DISTANCE_INVALID",
5422 Self::PriceDistancePrecisionExceeded => "PRICE_DISTANCE_PRECISION_EXCEEDED",
5423 Self::PriceDistanceMaximumExceeded => "PRICE_DISTANCE_MAXIMUM_EXCEEDED",
5424 Self::PriceDistanceMinimumNotMet => "PRICE_DISTANCE_MINIMUM_NOT_MET",
5425 Self::TimeInForceMissing => "TIME_IN_FORCE_MISSING",
5426 Self::TimeInForceInvalid => "TIME_IN_FORCE_INVALID",
5427 Self::TimeInForceGtdTimestampMissing => "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING",
5428 Self::TimeInForceGtdTimestampInPast => "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST",
5429 Self::PriceBoundInvalid => "PRICE_BOUND_INVALID",
5430 Self::PriceBoundPrecisionExceeded => "PRICE_BOUND_PRECISION_EXCEEDED",
5431 Self::OrdersOnFillDuplicateClientOrderIds => {
5432 "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS"
5433 }
5434 Self::TradeOnFillClientExtensionsNotSupported => {
5435 "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED"
5436 }
5437 Self::ClientOrderIdInvalid => "CLIENT_ORDER_ID_INVALID",
5438 Self::ClientOrderIdAlreadyExists => "CLIENT_ORDER_ID_ALREADY_EXISTS",
5439 Self::ClientOrderTagInvalid => "CLIENT_ORDER_TAG_INVALID",
5440 Self::ClientOrderCommentInvalid => "CLIENT_ORDER_COMMENT_INVALID",
5441 Self::ClientTradeIdInvalid => "CLIENT_TRADE_ID_INVALID",
5442 Self::ClientTradeIdAlreadyExists => "CLIENT_TRADE_ID_ALREADY_EXISTS",
5443 Self::ClientTradeTagInvalid => "CLIENT_TRADE_TAG_INVALID",
5444 Self::ClientTradeCommentInvalid => "CLIENT_TRADE_COMMENT_INVALID",
5445 Self::OrderFillPositionActionMissing => "ORDER_FILL_POSITION_ACTION_MISSING",
5446 Self::OrderFillPositionActionInvalid => "ORDER_FILL_POSITION_ACTION_INVALID",
5447 Self::TriggerConditionMissing => "TRIGGER_CONDITION_MISSING",
5448 Self::TriggerConditionInvalid => "TRIGGER_CONDITION_INVALID",
5449 Self::OrderPartialFillOptionMissing => "ORDER_PARTIAL_FILL_OPTION_MISSING",
5450 Self::OrderPartialFillOptionInvalid => "ORDER_PARTIAL_FILL_OPTION_INVALID",
5451 Self::InvalidReissueImmediatePartialFill => "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL",
5452 Self::OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation => {
5453 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
5454 }
5455 Self::OrdersOnFillRmoMutualExclusivityGsloExcludesOthersViolation => {
5456 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION"
5457 }
5458 Self::TakeProfitOrderAlreadyExists => "TAKE_PROFIT_ORDER_ALREADY_EXISTS",
5459 Self::TakeProfitOrderWouldViolateFifoViolationSafeguard => {
5460 "TAKE_PROFIT_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD"
5461 }
5462 Self::TakeProfitOnFillPriceMissing => "TAKE_PROFIT_ON_FILL_PRICE_MISSING",
5463 Self::TakeProfitOnFillPriceInvalid => "TAKE_PROFIT_ON_FILL_PRICE_INVALID",
5464 Self::TakeProfitOnFillPricePrecisionExceeded => {
5465 "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED"
5466 }
5467 Self::TakeProfitOnFillTimeInForceMissing => "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING",
5468 Self::TakeProfitOnFillTimeInForceInvalid => "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID",
5469 Self::TakeProfitOnFillGtdTimestampMissing => {
5470 "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING"
5471 }
5472 Self::TakeProfitOnFillGtdTimestampInPast => "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST",
5473 Self::TakeProfitOnFillClientOrderIdInvalid => {
5474 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID"
5475 }
5476 Self::TakeProfitOnFillClientOrderTagInvalid => {
5477 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID"
5478 }
5479 Self::TakeProfitOnFillClientOrderCommentInvalid => {
5480 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"
5481 }
5482 Self::TakeProfitOnFillTriggerConditionMissing => {
5483 "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING"
5484 }
5485 Self::TakeProfitOnFillTriggerConditionInvalid => {
5486 "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID"
5487 }
5488 Self::StopLossOrderAlreadyExists => "STOP_LOSS_ORDER_ALREADY_EXISTS",
5489 Self::StopLossOrderGuaranteedRequired => "STOP_LOSS_ORDER_GUARANTEED_REQUIRED",
5490 Self::StopLossOrderGuaranteedPriceWithinSpread => {
5491 "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD"
5492 }
5493 Self::StopLossOrderGuaranteedNotAllowed => "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED",
5494 Self::StopLossOrderGuaranteedHaltedCreateViolation => {
5495 "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION"
5496 }
5497 Self::StopLossOrderGuaranteedHaltedTightenViolation => {
5498 "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION"
5499 }
5500 Self::StopLossOrderGuaranteedHedgingNotAllowed => {
5501 "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED"
5502 }
5503 Self::StopLossOrderGuaranteedMinimumDistanceNotMet => {
5504 "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"
5505 }
5506 Self::StopLossOrderNotCancelable => "STOP_LOSS_ORDER_NOT_CANCELABLE",
5507 Self::StopLossOrderNotReplaceable => "STOP_LOSS_ORDER_NOT_REPLACEABLE",
5508 Self::StopLossOrderGuaranteedLevelRestrictionExceeded => {
5509 "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"
5510 }
5511 Self::StopLossOrderPriceAndDistanceBothSpecified => {
5512 "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED"
5513 }
5514 Self::StopLossOrderPriceAndDistanceBothMissing => {
5515 "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING"
5516 }
5517 Self::StopLossOrderWouldViolateFifoViolationSafeguard => {
5518 "STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD"
5519 }
5520 Self::StopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation => {
5521 "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
5522 }
5523 Self::StopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation => {
5524 "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION"
5525 }
5526 Self::StopLossOnFillRequiredForPendingOrder => {
5527 "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER"
5528 }
5529 Self::StopLossOnFillGuaranteedNotAllowed => "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED",
5530 Self::StopLossOnFillGuaranteedRequired => "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED",
5531 Self::StopLossOnFillPriceMissing => "STOP_LOSS_ON_FILL_PRICE_MISSING",
5532 Self::StopLossOnFillPriceInvalid => "STOP_LOSS_ON_FILL_PRICE_INVALID",
5533 Self::StopLossOnFillPricePrecisionExceeded => {
5534 "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED"
5535 }
5536 Self::StopLossOnFillGuaranteedMinimumDistanceNotMet => {
5537 "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"
5538 }
5539 Self::StopLossOnFillGuaranteedLevelRestrictionExceeded => {
5540 "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"
5541 }
5542 Self::StopLossOnFillDistanceInvalid => "STOP_LOSS_ON_FILL_DISTANCE_INVALID",
5543 Self::StopLossOnFillPriceDistanceMaximumExceeded => {
5544 "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
5545 }
5546 Self::StopLossOnFillDistancePrecisionExceeded => {
5547 "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED"
5548 }
5549 Self::StopLossOnFillPriceAndDistanceBothSpecified => {
5550 "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED"
5551 }
5552 Self::StopLossOnFillPriceAndDistanceBothMissing => {
5553 "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING"
5554 }
5555 Self::StopLossOnFillTimeInForceMissing => "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING",
5556 Self::StopLossOnFillTimeInForceInvalid => "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID",
5557 Self::StopLossOnFillGtdTimestampMissing => "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING",
5558 Self::StopLossOnFillGtdTimestampInPast => "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST",
5559 Self::StopLossOnFillClientOrderIdInvalid => "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID",
5560 Self::StopLossOnFillClientOrderTagInvalid => {
5561 "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"
5562 }
5563 Self::StopLossOnFillClientOrderCommentInvalid => {
5564 "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"
5565 }
5566 Self::StopLossOnFillTriggerConditionMissing => {
5567 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"
5568 }
5569 Self::StopLossOnFillTriggerConditionInvalid => {
5570 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
5571 }
5572 Self::GuaranteedStopLossOrderAlreadyExists => {
5573 "GUARANTEED_STOP_LOSS_ORDER_ALREADY_EXISTS"
5574 }
5575 Self::GuaranteedStopLossOrderRequired => "GUARANTEED_STOP_LOSS_ORDER_REQUIRED",
5576 Self::GuaranteedStopLossOrderPriceWithinSpread => {
5577 "GUARANTEED_STOP_LOSS_ORDER_PRICE_WITHIN_SPREAD"
5578 }
5579 Self::GuaranteedStopLossOrderNotAllowed => "GUARANTEED_STOP_LOSS_ORDER_NOT_ALLOWED",
5580 Self::GuaranteedStopLossOrderHaltedCreateViolation => {
5581 "GUARANTEED_STOP_LOSS_ORDER_HALTED_CREATE_VIOLATION"
5582 }
5583 Self::GuaranteedStopLossOrderCreateViolation => {
5584 "GUARANTEED_STOP_LOSS_ORDER_CREATE_VIOLATION"
5585 }
5586 Self::GuaranteedStopLossOrderHaltedTightenViolation => {
5587 "GUARANTEED_STOP_LOSS_ORDER_HALTED_TIGHTEN_VIOLATION"
5588 }
5589 Self::GuaranteedStopLossOrderTightenViolation => {
5590 "GUARANTEED_STOP_LOSS_ORDER_TIGHTEN_VIOLATION"
5591 }
5592 Self::GuaranteedStopLossOrderHedgingNotAllowed => {
5593 "GUARANTEED_STOP_LOSS_ORDER_HEDGING_NOT_ALLOWED"
5594 }
5595 Self::GuaranteedStopLossOrderMinimumDistanceNotMet => {
5596 "GUARANTEED_STOP_LOSS_ORDER_MINIMUM_DISTANCE_NOT_MET"
5597 }
5598 Self::GuaranteedStopLossOrderNotCancelable => {
5599 "GUARANTEED_STOP_LOSS_ORDER_NOT_CANCELABLE"
5600 }
5601 Self::GuaranteedStopLossOrderHaltedNotCancelable => {
5602 "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_CANCELABLE"
5603 }
5604 Self::GuaranteedStopLossOrderNotReplaceable => {
5605 "GUARANTEED_STOP_LOSS_ORDER_NOT_REPLACEABLE"
5606 }
5607 Self::GuaranteedStopLossOrderHaltedNotReplaceable => {
5608 "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_REPLACEABLE"
5609 }
5610 Self::GuaranteedStopLossOrderLevelRestrictionVolumeExceeded => {
5611 "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_VOLUME_EXCEEDED"
5612 }
5613 Self::GuaranteedStopLossOrderLevelRestrictionPriceRangeExceeded => {
5614 "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED"
5615 }
5616 Self::GuaranteedStopLossOrderPriceAndDistanceBothSpecified => {
5617 "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED"
5618 }
5619 Self::GuaranteedStopLossOrderPriceAndDistanceBothMissing => {
5620 "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING"
5621 }
5622 Self::GuaranteedStopLossOrderWouldViolateFifoViolationSafeguard => {
5623 "GUARANTEED_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD"
5624 }
5625 Self::GuaranteedStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation => {
5626 "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
5627 }
5628 Self::GuaranteedStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation => {
5629 "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION"
5630 }
5631 Self::GuaranteedStopLossOnFillRequiredForPendingOrder => {
5632 "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER"
5633 }
5634 Self::GuaranteedStopLossOnFillNotAllowed => "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED",
5635 Self::GuaranteedStopLossOnFillRequired => "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED",
5636 Self::GuaranteedStopLossOnFillPriceMissing => {
5637 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_MISSING"
5638 }
5639 Self::GuaranteedStopLossOnFillPriceInvalid => {
5640 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_INVALID"
5641 }
5642 Self::GuaranteedStopLossOnFillPricePrecisionExceeded => {
5643 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED"
5644 }
5645 Self::GuaranteedStopLossOnFillMinimumDistanceNotMet => {
5646 "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET"
5647 }
5648 Self::GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded => {
5649 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED"
5650 }
5651 Self::GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded => {
5652 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED"
5653 }
5654 Self::GuaranteedStopLossOnFillDistanceInvalid => {
5655 "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_INVALID"
5656 }
5657 Self::GuaranteedStopLossOnFillPriceDistanceMaximumExceeded => {
5658 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
5659 }
5660 Self::GuaranteedStopLossOnFillDistancePrecisionExceeded => {
5661 "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED"
5662 }
5663 Self::GuaranteedStopLossOnFillPriceAndDistanceBothSpecified => {
5664 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED"
5665 }
5666 Self::GuaranteedStopLossOnFillPriceAndDistanceBothMissing => {
5667 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING"
5668 }
5669 Self::GuaranteedStopLossOnFillTimeInForceMissing => {
5670 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING"
5671 }
5672 Self::GuaranteedStopLossOnFillTimeInForceInvalid => {
5673 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"
5674 }
5675 Self::GuaranteedStopLossOnFillGtdTimestampMissing => {
5676 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING"
5677 }
5678 Self::GuaranteedStopLossOnFillGtdTimestampInPast => {
5679 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"
5680 }
5681 Self::GuaranteedStopLossOnFillClientOrderIdInvalid => {
5682 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID"
5683 }
5684 Self::GuaranteedStopLossOnFillClientOrderTagInvalid => {
5685 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"
5686 }
5687 Self::GuaranteedStopLossOnFillClientOrderCommentInvalid => {
5688 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"
5689 }
5690 Self::GuaranteedStopLossOnFillTriggerConditionMissing => {
5691 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"
5692 }
5693 Self::GuaranteedStopLossOnFillTriggerConditionInvalid => {
5694 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
5695 }
5696 Self::TrailingStopLossOrderAlreadyExists => "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS",
5697 Self::TrailingStopLossOrderWouldViolateFifoViolationSafeguard => {
5698 "TRAILING_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD"
5699 }
5700 Self::TrailingStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation => {
5701 "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION"
5702 }
5703 Self::TrailingStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation => {
5704 "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION"
5705 }
5706 Self::TrailingStopLossOnFillPriceDistanceMissing => {
5707 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING"
5708 }
5709 Self::TrailingStopLossOnFillPriceDistanceInvalid => {
5710 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID"
5711 }
5712 Self::TrailingStopLossOnFillPriceDistancePrecisionExceeded => {
5713 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED"
5714 }
5715 Self::TrailingStopLossOnFillPriceDistanceMaximumExceeded => {
5716 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"
5717 }
5718 Self::TrailingStopLossOnFillPriceDistanceMinimumNotMet => {
5719 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET"
5720 }
5721 Self::TrailingStopLossOnFillTimeInForceMissing => {
5722 "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING"
5723 }
5724 Self::TrailingStopLossOnFillTimeInForceInvalid => {
5725 "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"
5726 }
5727 Self::TrailingStopLossOnFillGtdTimestampMissing => {
5728 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING"
5729 }
5730 Self::TrailingStopLossOnFillGtdTimestampInPast => {
5731 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"
5732 }
5733 Self::TrailingStopLossOnFillClientOrderIdInvalid => {
5734 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID"
5735 }
5736 Self::TrailingStopLossOnFillClientOrderTagInvalid => {
5737 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"
5738 }
5739 Self::TrailingStopLossOnFillClientOrderCommentInvalid => {
5740 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"
5741 }
5742 Self::TrailingStopLossOrdersNotSupported => "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED",
5743 Self::TrailingStopLossOnFillTriggerConditionMissing => {
5744 "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"
5745 }
5746 Self::TrailingStopLossOnFillTriggerConditionInvalid => {
5747 "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"
5748 }
5749 Self::CloseTradeTypeMissing => "CLOSE_TRADE_TYPE_MISSING",
5750 Self::CloseTradePartialUnitsMissing => "CLOSE_TRADE_PARTIAL_UNITS_MISSING",
5751 Self::CloseTradeUnitsExceedTradeSize => "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE",
5752 Self::CloseoutPositionDoesntExist => "CLOSEOUT_POSITION_DOESNT_EXIST",
5753 Self::CloseoutPositionIncompleteSpecification => {
5754 "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION"
5755 }
5756 Self::CloseoutPositionUnitsExceedPositionSize => {
5757 "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE"
5758 }
5759 Self::CloseoutPositionReject => "CLOSEOUT_POSITION_REJECT",
5760 Self::CloseoutPositionPartialUnitsMissing => "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING",
5761 Self::MarkupGroupIdInvalid => "MARKUP_GROUP_ID_INVALID",
5762 Self::PositionAggregationModeInvalid => "POSITION_AGGREGATION_MODE_INVALID",
5763 Self::AdminConfigureDataMissing => "ADMIN_CONFIGURE_DATA_MISSING",
5764 Self::MarginRateInvalid => "MARGIN_RATE_INVALID",
5765 Self::MarginRateWouldTriggerCloseout => "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT",
5766 Self::AliasInvalid => "ALIAS_INVALID",
5767 Self::ClientConfigureDataMissing => "CLIENT_CONFIGURE_DATA_MISSING",
5768 Self::MarginRateWouldTriggerMarginCall => "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL",
5769 Self::AmountInvalid => "AMOUNT_INVALID",
5770 Self::InsufficientFunds => "INSUFFICIENT_FUNDS",
5771 Self::AmountMissing => "AMOUNT_MISSING",
5772 Self::FundingReasonMissing => "FUNDING_REASON_MISSING",
5773 Self::OcaOrderIdsStopLossNotAllowed => "OCA_ORDER_IDS_STOP_LOSS_NOT_ALLOWED",
5774 Self::ClientExtensionsDataMissing => "CLIENT_EXTENSIONS_DATA_MISSING",
5775 Self::ReplacingOrderInvalid => "REPLACING_ORDER_INVALID",
5776 Self::ReplacingTradeIdInvalid => "REPLACING_TRADE_ID_INVALID",
5777 Self::OrderCancelWouldTriggerCloseout => "ORDER_CANCEL_WOULD_TRIGGER_CLOSEOUT",
5778 Self::Unknown(value) => value,
5779 }
5780 }
5781}
5782
5783impl Serialize for TransactionRejectReason {
5784 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
5785 serializer.serialize_str(self.as_str())
5786 }
5787}
5788
5789impl<'de> Deserialize<'de> for TransactionRejectReason {
5790 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
5791 let value = String::deserialize(deserializer)?;
5792 Ok(match value.as_str() {
5793 "INTERNAL_SERVER_ERROR" => Self::InternalServerError,
5794 "INSTRUMENT_PRICE_UNKNOWN" => Self::InstrumentPriceUnknown,
5795 "ACCOUNT_NOT_ACTIVE" => Self::AccountNotActive,
5796 "ACCOUNT_LOCKED" => Self::AccountLocked,
5797 "ACCOUNT_ORDER_CREATION_LOCKED" => Self::AccountOrderCreationLocked,
5798 "ACCOUNT_CONFIGURATION_LOCKED" => Self::AccountConfigurationLocked,
5799 "ACCOUNT_DEPOSIT_LOCKED" => Self::AccountDepositLocked,
5800 "ACCOUNT_WITHDRAWAL_LOCKED" => Self::AccountWithdrawalLocked,
5801 "ACCOUNT_ORDER_CANCEL_LOCKED" => Self::AccountOrderCancelLocked,
5802 "INSTRUMENT_NOT_TRADEABLE" => Self::InstrumentNotTradeable,
5803 "PENDING_ORDERS_ALLOWED_EXCEEDED" => Self::PendingOrdersAllowedExceeded,
5804 "ORDER_ID_UNSPECIFIED" => Self::OrderIdUnspecified,
5805 "ORDER_DOESNT_EXIST" => Self::OrderDoesntExist,
5806 "ORDER_IDENTIFIER_INCONSISTENCY" => Self::OrderIdentifierInconsistency,
5807 "TRADE_ID_UNSPECIFIED" => Self::TradeIdUnspecified,
5808 "TRADE_DOESNT_EXIST" => Self::TradeDoesntExist,
5809 "TRADE_IDENTIFIER_INCONSISTENCY" => Self::TradeIdentifierInconsistency,
5810 "INSUFFICIENT_MARGIN" => Self::InsufficientMargin,
5811 "INSTRUMENT_MISSING" => Self::InstrumentMissing,
5812 "INSTRUMENT_UNKNOWN" => Self::InstrumentUnknown,
5813 "UNITS_MISSING" => Self::UnitsMissing,
5814 "UNITS_INVALID" => Self::UnitsInvalid,
5815 "UNITS_PRECISION_EXCEEDED" => Self::UnitsPrecisionExceeded,
5816 "UNITS_LIMIT_EXCEEDED" => Self::UnitsLimitExceeded,
5817 "UNITS_MINIMUM_NOT_MET" => Self::UnitsMinimumNotMet,
5818 "PRICE_MISSING" => Self::PriceMissing,
5819 "PRICE_INVALID" => Self::PriceInvalid,
5820 "PRICE_PRECISION_EXCEEDED" => Self::PricePrecisionExceeded,
5821 "PRICE_DISTANCE_MISSING" => Self::PriceDistanceMissing,
5822 "PRICE_DISTANCE_INVALID" => Self::PriceDistanceInvalid,
5823 "PRICE_DISTANCE_PRECISION_EXCEEDED" => Self::PriceDistancePrecisionExceeded,
5824 "PRICE_DISTANCE_MAXIMUM_EXCEEDED" => Self::PriceDistanceMaximumExceeded,
5825 "PRICE_DISTANCE_MINIMUM_NOT_MET" => Self::PriceDistanceMinimumNotMet,
5826 "TIME_IN_FORCE_MISSING" => Self::TimeInForceMissing,
5827 "TIME_IN_FORCE_INVALID" => Self::TimeInForceInvalid,
5828 "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING" => Self::TimeInForceGtdTimestampMissing,
5829 "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST" => Self::TimeInForceGtdTimestampInPast,
5830 "PRICE_BOUND_INVALID" => Self::PriceBoundInvalid,
5831 "PRICE_BOUND_PRECISION_EXCEEDED" => Self::PriceBoundPrecisionExceeded,
5832 "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS" => {
5833 Self::OrdersOnFillDuplicateClientOrderIds
5834 }
5835 "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED" => {
5836 Self::TradeOnFillClientExtensionsNotSupported
5837 }
5838 "CLIENT_ORDER_ID_INVALID" => Self::ClientOrderIdInvalid,
5839 "CLIENT_ORDER_ID_ALREADY_EXISTS" => Self::ClientOrderIdAlreadyExists,
5840 "CLIENT_ORDER_TAG_INVALID" => Self::ClientOrderTagInvalid,
5841 "CLIENT_ORDER_COMMENT_INVALID" => Self::ClientOrderCommentInvalid,
5842 "CLIENT_TRADE_ID_INVALID" => Self::ClientTradeIdInvalid,
5843 "CLIENT_TRADE_ID_ALREADY_EXISTS" => Self::ClientTradeIdAlreadyExists,
5844 "CLIENT_TRADE_TAG_INVALID" => Self::ClientTradeTagInvalid,
5845 "CLIENT_TRADE_COMMENT_INVALID" => Self::ClientTradeCommentInvalid,
5846 "ORDER_FILL_POSITION_ACTION_MISSING" => Self::OrderFillPositionActionMissing,
5847 "ORDER_FILL_POSITION_ACTION_INVALID" => Self::OrderFillPositionActionInvalid,
5848 "TRIGGER_CONDITION_MISSING" => Self::TriggerConditionMissing,
5849 "TRIGGER_CONDITION_INVALID" => Self::TriggerConditionInvalid,
5850 "ORDER_PARTIAL_FILL_OPTION_MISSING" => Self::OrderPartialFillOptionMissing,
5851 "ORDER_PARTIAL_FILL_OPTION_INVALID" => Self::OrderPartialFillOptionInvalid,
5852 "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL" => Self::InvalidReissueImmediatePartialFill,
5853 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
5854 Self::OrdersOnFillRmoMutualExclusivityMutuallyExclusiveViolation
5855 }
5856 "ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" => {
5857 Self::OrdersOnFillRmoMutualExclusivityGsloExcludesOthersViolation
5858 }
5859 "TAKE_PROFIT_ORDER_ALREADY_EXISTS" => Self::TakeProfitOrderAlreadyExists,
5860 "TAKE_PROFIT_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" => {
5861 Self::TakeProfitOrderWouldViolateFifoViolationSafeguard
5862 }
5863 "TAKE_PROFIT_ON_FILL_PRICE_MISSING" => Self::TakeProfitOnFillPriceMissing,
5864 "TAKE_PROFIT_ON_FILL_PRICE_INVALID" => Self::TakeProfitOnFillPriceInvalid,
5865 "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED" => {
5866 Self::TakeProfitOnFillPricePrecisionExceeded
5867 }
5868 "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING" => Self::TakeProfitOnFillTimeInForceMissing,
5869 "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID" => Self::TakeProfitOnFillTimeInForceInvalid,
5870 "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING" => {
5871 Self::TakeProfitOnFillGtdTimestampMissing
5872 }
5873 "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST" => Self::TakeProfitOnFillGtdTimestampInPast,
5874 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID" => {
5875 Self::TakeProfitOnFillClientOrderIdInvalid
5876 }
5877 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID" => {
5878 Self::TakeProfitOnFillClientOrderTagInvalid
5879 }
5880 "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" => {
5881 Self::TakeProfitOnFillClientOrderCommentInvalid
5882 }
5883 "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING" => {
5884 Self::TakeProfitOnFillTriggerConditionMissing
5885 }
5886 "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID" => {
5887 Self::TakeProfitOnFillTriggerConditionInvalid
5888 }
5889 "STOP_LOSS_ORDER_ALREADY_EXISTS" => Self::StopLossOrderAlreadyExists,
5890 "STOP_LOSS_ORDER_GUARANTEED_REQUIRED" => Self::StopLossOrderGuaranteedRequired,
5891 "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD" => {
5892 Self::StopLossOrderGuaranteedPriceWithinSpread
5893 }
5894 "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED" => Self::StopLossOrderGuaranteedNotAllowed,
5895 "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION" => {
5896 Self::StopLossOrderGuaranteedHaltedCreateViolation
5897 }
5898 "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION" => {
5899 Self::StopLossOrderGuaranteedHaltedTightenViolation
5900 }
5901 "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED" => {
5902 Self::StopLossOrderGuaranteedHedgingNotAllowed
5903 }
5904 "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" => {
5905 Self::StopLossOrderGuaranteedMinimumDistanceNotMet
5906 }
5907 "STOP_LOSS_ORDER_NOT_CANCELABLE" => Self::StopLossOrderNotCancelable,
5908 "STOP_LOSS_ORDER_NOT_REPLACEABLE" => Self::StopLossOrderNotReplaceable,
5909 "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" => {
5910 Self::StopLossOrderGuaranteedLevelRestrictionExceeded
5911 }
5912 "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED" => {
5913 Self::StopLossOrderPriceAndDistanceBothSpecified
5914 }
5915 "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING" => {
5916 Self::StopLossOrderPriceAndDistanceBothMissing
5917 }
5918 "STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" => {
5919 Self::StopLossOrderWouldViolateFifoViolationSafeguard
5920 }
5921 "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
5922 Self::StopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation
5923 }
5924 "STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" => {
5925 Self::StopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation
5926 }
5927 "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER" => {
5928 Self::StopLossOnFillRequiredForPendingOrder
5929 }
5930 "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED" => Self::StopLossOnFillGuaranteedNotAllowed,
5931 "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED" => Self::StopLossOnFillGuaranteedRequired,
5932 "STOP_LOSS_ON_FILL_PRICE_MISSING" => Self::StopLossOnFillPriceMissing,
5933 "STOP_LOSS_ON_FILL_PRICE_INVALID" => Self::StopLossOnFillPriceInvalid,
5934 "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED" => {
5935 Self::StopLossOnFillPricePrecisionExceeded
5936 }
5937 "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET" => {
5938 Self::StopLossOnFillGuaranteedMinimumDistanceNotMet
5939 }
5940 "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED" => {
5941 Self::StopLossOnFillGuaranteedLevelRestrictionExceeded
5942 }
5943 "STOP_LOSS_ON_FILL_DISTANCE_INVALID" => Self::StopLossOnFillDistanceInvalid,
5944 "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
5945 Self::StopLossOnFillPriceDistanceMaximumExceeded
5946 }
5947 "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED" => {
5948 Self::StopLossOnFillDistancePrecisionExceeded
5949 }
5950 "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED" => {
5951 Self::StopLossOnFillPriceAndDistanceBothSpecified
5952 }
5953 "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING" => {
5954 Self::StopLossOnFillPriceAndDistanceBothMissing
5955 }
5956 "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" => Self::StopLossOnFillTimeInForceMissing,
5957 "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => Self::StopLossOnFillTimeInForceInvalid,
5958 "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" => Self::StopLossOnFillGtdTimestampMissing,
5959 "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => Self::StopLossOnFillGtdTimestampInPast,
5960 "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" => Self::StopLossOnFillClientOrderIdInvalid,
5961 "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" => {
5962 Self::StopLossOnFillClientOrderTagInvalid
5963 }
5964 "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" => {
5965 Self::StopLossOnFillClientOrderCommentInvalid
5966 }
5967 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" => {
5968 Self::StopLossOnFillTriggerConditionMissing
5969 }
5970 "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
5971 Self::StopLossOnFillTriggerConditionInvalid
5972 }
5973 "GUARANTEED_STOP_LOSS_ORDER_ALREADY_EXISTS" => {
5974 Self::GuaranteedStopLossOrderAlreadyExists
5975 }
5976 "GUARANTEED_STOP_LOSS_ORDER_REQUIRED" => Self::GuaranteedStopLossOrderRequired,
5977 "GUARANTEED_STOP_LOSS_ORDER_PRICE_WITHIN_SPREAD" => {
5978 Self::GuaranteedStopLossOrderPriceWithinSpread
5979 }
5980 "GUARANTEED_STOP_LOSS_ORDER_NOT_ALLOWED" => Self::GuaranteedStopLossOrderNotAllowed,
5981 "GUARANTEED_STOP_LOSS_ORDER_HALTED_CREATE_VIOLATION" => {
5982 Self::GuaranteedStopLossOrderHaltedCreateViolation
5983 }
5984 "GUARANTEED_STOP_LOSS_ORDER_CREATE_VIOLATION" => {
5985 Self::GuaranteedStopLossOrderCreateViolation
5986 }
5987 "GUARANTEED_STOP_LOSS_ORDER_HALTED_TIGHTEN_VIOLATION" => {
5988 Self::GuaranteedStopLossOrderHaltedTightenViolation
5989 }
5990 "GUARANTEED_STOP_LOSS_ORDER_TIGHTEN_VIOLATION" => {
5991 Self::GuaranteedStopLossOrderTightenViolation
5992 }
5993 "GUARANTEED_STOP_LOSS_ORDER_HEDGING_NOT_ALLOWED" => {
5994 Self::GuaranteedStopLossOrderHedgingNotAllowed
5995 }
5996 "GUARANTEED_STOP_LOSS_ORDER_MINIMUM_DISTANCE_NOT_MET" => {
5997 Self::GuaranteedStopLossOrderMinimumDistanceNotMet
5998 }
5999 "GUARANTEED_STOP_LOSS_ORDER_NOT_CANCELABLE" => {
6000 Self::GuaranteedStopLossOrderNotCancelable
6001 }
6002 "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_CANCELABLE" => {
6003 Self::GuaranteedStopLossOrderHaltedNotCancelable
6004 }
6005 "GUARANTEED_STOP_LOSS_ORDER_NOT_REPLACEABLE" => {
6006 Self::GuaranteedStopLossOrderNotReplaceable
6007 }
6008 "GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_REPLACEABLE" => {
6009 Self::GuaranteedStopLossOrderHaltedNotReplaceable
6010 }
6011 "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_VOLUME_EXCEEDED" => {
6012 Self::GuaranteedStopLossOrderLevelRestrictionVolumeExceeded
6013 }
6014 "GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" => {
6015 Self::GuaranteedStopLossOrderLevelRestrictionPriceRangeExceeded
6016 }
6017 "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED" => {
6018 Self::GuaranteedStopLossOrderPriceAndDistanceBothSpecified
6019 }
6020 "GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING" => {
6021 Self::GuaranteedStopLossOrderPriceAndDistanceBothMissing
6022 }
6023 "GUARANTEED_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" => {
6024 Self::GuaranteedStopLossOrderWouldViolateFifoViolationSafeguard
6025 }
6026 "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
6027 Self::GuaranteedStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation
6028 }
6029 "GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" => {
6030 Self::GuaranteedStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation
6031 }
6032 "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER" => {
6033 Self::GuaranteedStopLossOnFillRequiredForPendingOrder
6034 }
6035 "GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED" => Self::GuaranteedStopLossOnFillNotAllowed,
6036 "GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED" => Self::GuaranteedStopLossOnFillRequired,
6037 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_MISSING" => {
6038 Self::GuaranteedStopLossOnFillPriceMissing
6039 }
6040 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_INVALID" => {
6041 Self::GuaranteedStopLossOnFillPriceInvalid
6042 }
6043 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED" => {
6044 Self::GuaranteedStopLossOnFillPricePrecisionExceeded
6045 }
6046 "GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET" => {
6047 Self::GuaranteedStopLossOnFillMinimumDistanceNotMet
6048 }
6049 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED" => {
6050 Self::GuaranteedStopLossOnFillLevelRestrictionVolumeExceeded
6051 }
6052 "GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED" => {
6053 Self::GuaranteedStopLossOnFillLevelRestrictionPriceRangeExceeded
6054 }
6055 "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_INVALID" => {
6056 Self::GuaranteedStopLossOnFillDistanceInvalid
6057 }
6058 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
6059 Self::GuaranteedStopLossOnFillPriceDistanceMaximumExceeded
6060 }
6061 "GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED" => {
6062 Self::GuaranteedStopLossOnFillDistancePrecisionExceeded
6063 }
6064 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED" => {
6065 Self::GuaranteedStopLossOnFillPriceAndDistanceBothSpecified
6066 }
6067 "GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING" => {
6068 Self::GuaranteedStopLossOnFillPriceAndDistanceBothMissing
6069 }
6070 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" => {
6071 Self::GuaranteedStopLossOnFillTimeInForceMissing
6072 }
6073 "GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => {
6074 Self::GuaranteedStopLossOnFillTimeInForceInvalid
6075 }
6076 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" => {
6077 Self::GuaranteedStopLossOnFillGtdTimestampMissing
6078 }
6079 "GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => {
6080 Self::GuaranteedStopLossOnFillGtdTimestampInPast
6081 }
6082 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" => {
6083 Self::GuaranteedStopLossOnFillClientOrderIdInvalid
6084 }
6085 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" => {
6086 Self::GuaranteedStopLossOnFillClientOrderTagInvalid
6087 }
6088 "GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" => {
6089 Self::GuaranteedStopLossOnFillClientOrderCommentInvalid
6090 }
6091 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" => {
6092 Self::GuaranteedStopLossOnFillTriggerConditionMissing
6093 }
6094 "GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
6095 Self::GuaranteedStopLossOnFillTriggerConditionInvalid
6096 }
6097 "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS" => Self::TrailingStopLossOrderAlreadyExists,
6098 "TRAILING_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD" => {
6099 Self::TrailingStopLossOrderWouldViolateFifoViolationSafeguard
6100 }
6101 "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION" => {
6102 Self::TrailingStopLossOrderRmoMutualExclusivityMutuallyExclusiveViolation
6103 }
6104 "TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION" => {
6105 Self::TrailingStopLossOrderRmoMutualExclusivityGsloExcludesOthersViolation
6106 }
6107 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING" => {
6108 Self::TrailingStopLossOnFillPriceDistanceMissing
6109 }
6110 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID" => {
6111 Self::TrailingStopLossOnFillPriceDistanceInvalid
6112 }
6113 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED" => {
6114 Self::TrailingStopLossOnFillPriceDistancePrecisionExceeded
6115 }
6116 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED" => {
6117 Self::TrailingStopLossOnFillPriceDistanceMaximumExceeded
6118 }
6119 "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET" => {
6120 Self::TrailingStopLossOnFillPriceDistanceMinimumNotMet
6121 }
6122 "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING" => {
6123 Self::TrailingStopLossOnFillTimeInForceMissing
6124 }
6125 "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID" => {
6126 Self::TrailingStopLossOnFillTimeInForceInvalid
6127 }
6128 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING" => {
6129 Self::TrailingStopLossOnFillGtdTimestampMissing
6130 }
6131 "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST" => {
6132 Self::TrailingStopLossOnFillGtdTimestampInPast
6133 }
6134 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID" => {
6135 Self::TrailingStopLossOnFillClientOrderIdInvalid
6136 }
6137 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID" => {
6138 Self::TrailingStopLossOnFillClientOrderTagInvalid
6139 }
6140 "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID" => {
6141 Self::TrailingStopLossOnFillClientOrderCommentInvalid
6142 }
6143 "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED" => Self::TrailingStopLossOrdersNotSupported,
6144 "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING" => {
6145 Self::TrailingStopLossOnFillTriggerConditionMissing
6146 }
6147 "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID" => {
6148 Self::TrailingStopLossOnFillTriggerConditionInvalid
6149 }
6150 "CLOSE_TRADE_TYPE_MISSING" => Self::CloseTradeTypeMissing,
6151 "CLOSE_TRADE_PARTIAL_UNITS_MISSING" => Self::CloseTradePartialUnitsMissing,
6152 "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE" => Self::CloseTradeUnitsExceedTradeSize,
6153 "CLOSEOUT_POSITION_DOESNT_EXIST" => Self::CloseoutPositionDoesntExist,
6154 "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION" => {
6155 Self::CloseoutPositionIncompleteSpecification
6156 }
6157 "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE" => {
6158 Self::CloseoutPositionUnitsExceedPositionSize
6159 }
6160 "CLOSEOUT_POSITION_REJECT" => Self::CloseoutPositionReject,
6161 "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING" => Self::CloseoutPositionPartialUnitsMissing,
6162 "MARKUP_GROUP_ID_INVALID" => Self::MarkupGroupIdInvalid,
6163 "POSITION_AGGREGATION_MODE_INVALID" => Self::PositionAggregationModeInvalid,
6164 "ADMIN_CONFIGURE_DATA_MISSING" => Self::AdminConfigureDataMissing,
6165 "MARGIN_RATE_INVALID" => Self::MarginRateInvalid,
6166 "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT" => Self::MarginRateWouldTriggerCloseout,
6167 "ALIAS_INVALID" => Self::AliasInvalid,
6168 "CLIENT_CONFIGURE_DATA_MISSING" => Self::ClientConfigureDataMissing,
6169 "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL" => Self::MarginRateWouldTriggerMarginCall,
6170 "AMOUNT_INVALID" => Self::AmountInvalid,
6171 "INSUFFICIENT_FUNDS" => Self::InsufficientFunds,
6172 "AMOUNT_MISSING" => Self::AmountMissing,
6173 "FUNDING_REASON_MISSING" => Self::FundingReasonMissing,
6174 "OCA_ORDER_IDS_STOP_LOSS_NOT_ALLOWED" => Self::OcaOrderIdsStopLossNotAllowed,
6175 "CLIENT_EXTENSIONS_DATA_MISSING" => Self::ClientExtensionsDataMissing,
6176 "REPLACING_ORDER_INVALID" => Self::ReplacingOrderInvalid,
6177 "REPLACING_TRADE_ID_INVALID" => Self::ReplacingTradeIdInvalid,
6178 "ORDER_CANCEL_WOULD_TRIGGER_CLOSEOUT" => Self::OrderCancelWouldTriggerCloseout,
6179 _ => Self::Unknown(value),
6180 })
6181 }
6182}
6183
6184#[derive(Debug, Clone, PartialEq, Eq, Hash)]
6186#[non_exhaustive]
6187pub enum TransactionFilter {
6188 Order,
6190 Funding,
6192 Admin,
6194 Create,
6196 Close,
6198 Reopen,
6200 ClientConfigure,
6202 ClientConfigureReject,
6204 TransferFunds,
6206 TransferFundsReject,
6208 MarketOrder,
6210 MarketOrderReject,
6212 LimitOrder,
6214 LimitOrderReject,
6216 StopOrder,
6218 StopOrderReject,
6220 MarketIfTouchedOrder,
6222 MarketIfTouchedOrderReject,
6224 TakeProfitOrder,
6226 TakeProfitOrderReject,
6228 StopLossOrder,
6230 StopLossOrderReject,
6232 GuaranteedStopLossOrder,
6234 GuaranteedStopLossOrderReject,
6236 TrailingStopLossOrder,
6238 TrailingStopLossOrderReject,
6240 OneCancelsAllOrder,
6242 OneCancelsAllOrderReject,
6244 OneCancelsAllOrderTriggered,
6246 OrderFill,
6248 OrderCancel,
6250 OrderCancelReject,
6252 OrderClientExtensionsModify,
6254 OrderClientExtensionsModifyReject,
6256 TradeClientExtensionsModify,
6258 TradeClientExtensionsModifyReject,
6260 MarginCallEnter,
6262 MarginCallExtend,
6264 MarginCallExit,
6266 DelayedTradeClosure,
6268 DailyFinancing,
6270 ResetResettablePl,
6272 Unknown(String),
6274}
6275
6276impl TransactionFilter {
6277 pub fn as_str(&self) -> &str {
6279 match self {
6280 Self::Order => "ORDER",
6281 Self::Funding => "FUNDING",
6282 Self::Admin => "ADMIN",
6283 Self::Create => "CREATE",
6284 Self::Close => "CLOSE",
6285 Self::Reopen => "REOPEN",
6286 Self::ClientConfigure => "CLIENT_CONFIGURE",
6287 Self::ClientConfigureReject => "CLIENT_CONFIGURE_REJECT",
6288 Self::TransferFunds => "TRANSFER_FUNDS",
6289 Self::TransferFundsReject => "TRANSFER_FUNDS_REJECT",
6290 Self::MarketOrder => "MARKET_ORDER",
6291 Self::MarketOrderReject => "MARKET_ORDER_REJECT",
6292 Self::LimitOrder => "LIMIT_ORDER",
6293 Self::LimitOrderReject => "LIMIT_ORDER_REJECT",
6294 Self::StopOrder => "STOP_ORDER",
6295 Self::StopOrderReject => "STOP_ORDER_REJECT",
6296 Self::MarketIfTouchedOrder => "MARKET_IF_TOUCHED_ORDER",
6297 Self::MarketIfTouchedOrderReject => "MARKET_IF_TOUCHED_ORDER_REJECT",
6298 Self::TakeProfitOrder => "TAKE_PROFIT_ORDER",
6299 Self::TakeProfitOrderReject => "TAKE_PROFIT_ORDER_REJECT",
6300 Self::StopLossOrder => "STOP_LOSS_ORDER",
6301 Self::StopLossOrderReject => "STOP_LOSS_ORDER_REJECT",
6302 Self::GuaranteedStopLossOrder => "GUARANTEED_STOP_LOSS_ORDER",
6303 Self::GuaranteedStopLossOrderReject => "GUARANTEED_STOP_LOSS_ORDER_REJECT",
6304 Self::TrailingStopLossOrder => "TRAILING_STOP_LOSS_ORDER",
6305 Self::TrailingStopLossOrderReject => "TRAILING_STOP_LOSS_ORDER_REJECT",
6306 Self::OneCancelsAllOrder => "ONE_CANCELS_ALL_ORDER",
6307 Self::OneCancelsAllOrderReject => "ONE_CANCELS_ALL_ORDER_REJECT",
6308 Self::OneCancelsAllOrderTriggered => "ONE_CANCELS_ALL_ORDER_TRIGGERED",
6309 Self::OrderFill => "ORDER_FILL",
6310 Self::OrderCancel => "ORDER_CANCEL",
6311 Self::OrderCancelReject => "ORDER_CANCEL_REJECT",
6312 Self::OrderClientExtensionsModify => "ORDER_CLIENT_EXTENSIONS_MODIFY",
6313 Self::OrderClientExtensionsModifyReject => "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT",
6314 Self::TradeClientExtensionsModify => "TRADE_CLIENT_EXTENSIONS_MODIFY",
6315 Self::TradeClientExtensionsModifyReject => "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT",
6316 Self::MarginCallEnter => "MARGIN_CALL_ENTER",
6317 Self::MarginCallExtend => "MARGIN_CALL_EXTEND",
6318 Self::MarginCallExit => "MARGIN_CALL_EXIT",
6319 Self::DelayedTradeClosure => "DELAYED_TRADE_CLOSURE",
6320 Self::DailyFinancing => "DAILY_FINANCING",
6321 Self::ResetResettablePl => "RESET_RESETTABLE_PL",
6322 Self::Unknown(value) => value,
6323 }
6324 }
6325}
6326
6327impl Serialize for TransactionFilter {
6328 fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
6329 serializer.serialize_str(self.as_str())
6330 }
6331}
6332
6333impl<'de> Deserialize<'de> for TransactionFilter {
6334 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
6335 let value = String::deserialize(deserializer)?;
6336 Ok(match value.as_str() {
6337 "ORDER" => Self::Order,
6338 "FUNDING" => Self::Funding,
6339 "ADMIN" => Self::Admin,
6340 "CREATE" => Self::Create,
6341 "CLOSE" => Self::Close,
6342 "REOPEN" => Self::Reopen,
6343 "CLIENT_CONFIGURE" => Self::ClientConfigure,
6344 "CLIENT_CONFIGURE_REJECT" => Self::ClientConfigureReject,
6345 "TRANSFER_FUNDS" => Self::TransferFunds,
6346 "TRANSFER_FUNDS_REJECT" => Self::TransferFundsReject,
6347 "MARKET_ORDER" => Self::MarketOrder,
6348 "MARKET_ORDER_REJECT" => Self::MarketOrderReject,
6349 "LIMIT_ORDER" => Self::LimitOrder,
6350 "LIMIT_ORDER_REJECT" => Self::LimitOrderReject,
6351 "STOP_ORDER" => Self::StopOrder,
6352 "STOP_ORDER_REJECT" => Self::StopOrderReject,
6353 "MARKET_IF_TOUCHED_ORDER" => Self::MarketIfTouchedOrder,
6354 "MARKET_IF_TOUCHED_ORDER_REJECT" => Self::MarketIfTouchedOrderReject,
6355 "TAKE_PROFIT_ORDER" => Self::TakeProfitOrder,
6356 "TAKE_PROFIT_ORDER_REJECT" => Self::TakeProfitOrderReject,
6357 "STOP_LOSS_ORDER" => Self::StopLossOrder,
6358 "STOP_LOSS_ORDER_REJECT" => Self::StopLossOrderReject,
6359 "GUARANTEED_STOP_LOSS_ORDER" => Self::GuaranteedStopLossOrder,
6360 "GUARANTEED_STOP_LOSS_ORDER_REJECT" => Self::GuaranteedStopLossOrderReject,
6361 "TRAILING_STOP_LOSS_ORDER" => Self::TrailingStopLossOrder,
6362 "TRAILING_STOP_LOSS_ORDER_REJECT" => Self::TrailingStopLossOrderReject,
6363 "ONE_CANCELS_ALL_ORDER" => Self::OneCancelsAllOrder,
6364 "ONE_CANCELS_ALL_ORDER_REJECT" => Self::OneCancelsAllOrderReject,
6365 "ONE_CANCELS_ALL_ORDER_TRIGGERED" => Self::OneCancelsAllOrderTriggered,
6366 "ORDER_FILL" => Self::OrderFill,
6367 "ORDER_CANCEL" => Self::OrderCancel,
6368 "ORDER_CANCEL_REJECT" => Self::OrderCancelReject,
6369 "ORDER_CLIENT_EXTENSIONS_MODIFY" => Self::OrderClientExtensionsModify,
6370 "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT" => Self::OrderClientExtensionsModifyReject,
6371 "TRADE_CLIENT_EXTENSIONS_MODIFY" => Self::TradeClientExtensionsModify,
6372 "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT" => Self::TradeClientExtensionsModifyReject,
6373 "MARGIN_CALL_ENTER" => Self::MarginCallEnter,
6374 "MARGIN_CALL_EXTEND" => Self::MarginCallExtend,
6375 "MARGIN_CALL_EXIT" => Self::MarginCallExit,
6376 "DELAYED_TRADE_CLOSURE" => Self::DelayedTradeClosure,
6377 "DAILY_FINANCING" => Self::DailyFinancing,
6378 "RESET_RESETTABLE_PL" => Self::ResetResettablePl,
6379 _ => Self::Unknown(value),
6380 })
6381 }
6382}
6383
6384#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6387#[serde(rename_all = "camelCase")]
6388pub struct TransactionHeartbeat {
6389 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
6391 pub r#type: Option<String>,
6392 #[serde(
6394 rename = "lastTransactionID",
6395 default,
6396 skip_serializing_if = "Option::is_none"
6397 )]
6398 pub last_transaction_id: Option<TransactionID>,
6399 #[serde(rename = "time", default, skip_serializing_if = "Option::is_none")]
6401 pub time: Option<Timestamp>,
6402}