oanda-v20-openapi 0.2.1

The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
/*
 * OANDA v20 API
 *
 * The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
 *
 * The version of the OpenAPI document: 0.2.1
 * Contact: jmicoud02@gmail.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// MarketOrderRejectTransaction : A MarketOrderRejectTransaction represents the rejection of the creation of a Market Order.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MarketOrderRejectTransaction {
    /// The Transaction's Identifier.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    /// A date and time value using either RFC3339 or UNIX time representation. The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).
    #[serde(rename = "time", skip_serializing_if = "Option::is_none")]
    pub time: Option<String>,
    /// The ID of the user that initiated the creation of the Transaction.
    #[serde(rename = "userID", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<i32>,
    /// The Account's identifier
    #[serde(rename = "accountID", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// The ID of the \"batch\" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously.
    #[serde(rename = "batchID", skip_serializing_if = "Option::is_none")]
    pub batch_id: Option<i32>,
    /// The Request ID of the request which generated the transaction.
    #[serde(rename = "requestID", skip_serializing_if = "Option::is_none")]
    pub request_id: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<models::TransactionType>,
    /// The reason that the Reject Transaction was created
    #[serde(rename = "rejectReason", skip_serializing_if = "Option::is_none")]
    pub reject_reason: Option<RejectReason>,
    #[serde(rename = "instrument", skip_serializing_if = "Option::is_none")]
    pub instrument: Option<models::InstrumentName>,
    /// The quantity requested to be filled by the Market Order. A posititive number of units results in a long Order, and a negative number of units results in a short Order.
    #[serde(rename = "units", skip_serializing_if = "Option::is_none")]
    pub units: Option<f64>,
    #[serde(rename = "timeInForce", skip_serializing_if = "Option::is_none")]
    pub time_in_force: Option<models::MarketOrderTradeClose>,
    /// The worst price that the client is willing to have the Market Order filled at.
    #[serde(rename = "priceBound", skip_serializing_if = "Option::is_none")]
    pub price_bound: Option<f64>,
    #[serde(rename = "positionFill", skip_serializing_if = "Option::is_none")]
    pub position_fill: Option<models::MarketOrderPositionFill>,
    #[serde(rename = "tradeClose", skip_serializing_if = "Option::is_none")]
    pub trade_close: Option<Box<models::MarketOrderTradeClose>>,
    #[serde(rename = "longPositionCloseout", skip_serializing_if = "Option::is_none")]
    pub long_position_closeout: Option<Box<models::MarketOrderPositionCloseout>>,
    #[serde(rename = "shortPositionCloseout", skip_serializing_if = "Option::is_none")]
    pub short_position_closeout: Option<Box<models::MarketOrderPositionCloseout>>,
    #[serde(rename = "marginCloseout", skip_serializing_if = "Option::is_none")]
    pub margin_closeout: Option<Box<models::MarketOrderMarginCloseout>>,
    #[serde(rename = "delayedTradeClose", skip_serializing_if = "Option::is_none")]
    pub delayed_trade_close: Option<Box<models::MarketOrderDelayedTradeClose>>,
    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
    pub reason: Option<models::MarketOrderReason>,
    #[serde(rename = "clientExtensions", skip_serializing_if = "Option::is_none")]
    pub client_extensions: Option<Box<models::ClientExtensions>>,
    #[serde(rename = "takeProfitOnFill", skip_serializing_if = "Option::is_none")]
    pub take_profit_on_fill: Option<Box<models::TakeProfitDetails>>,
    #[serde(rename = "stopLossOnFill", skip_serializing_if = "Option::is_none")]
    pub stop_loss_on_fill: Option<Box<models::StopLossDetails>>,
    #[serde(rename = "trailingStopLossOnFill", skip_serializing_if = "Option::is_none")]
    pub trailing_stop_loss_on_fill: Option<Box<models::TrailingStopLossDetails>>,
    #[serde(rename = "tradeClientExtensions", skip_serializing_if = "Option::is_none")]
    pub trade_client_extensions: Option<Box<models::ClientExtensions>>,
}

impl MarketOrderRejectTransaction {
    /// A MarketOrderRejectTransaction represents the rejection of the creation of a Market Order.
    pub fn new() -> MarketOrderRejectTransaction {
        MarketOrderRejectTransaction {
            id: None,
            time: None,
            user_id: None,
            account_id: None,
            batch_id: None,
            request_id: None,
            r#type: None,
            reject_reason: None,
            instrument: None,
            units: None,
            time_in_force: None,
            price_bound: None,
            position_fill: None,
            trade_close: None,
            long_position_closeout: None,
            short_position_closeout: None,
            margin_closeout: None,
            delayed_trade_close: None,
            reason: None,
            client_extensions: None,
            take_profit_on_fill: None,
            stop_loss_on_fill: None,
            trailing_stop_loss_on_fill: None,
            trade_client_extensions: None,
        }
    }
}
/// The reason that the Reject Transaction was created
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RejectReason {
    #[serde(rename = "INTERNAL_SERVER_ERROR")]
    InternalServerError,
    #[serde(rename = "INSTRUMENT_PRICE_UNKNOWN")]
    InstrumentPriceUnknown,
    #[serde(rename = "ACCOUNT_NOT_ACTIVE")]
    AccountNotActive,
    #[serde(rename = "ACCOUNT_LOCKED")]
    AccountLocked,
    #[serde(rename = "ACCOUNT_ORDER_CREATION_LOCKED")]
    AccountOrderCreationLocked,
    #[serde(rename = "ACCOUNT_CONFIGURATION_LOCKED")]
    AccountConfigurationLocked,
    #[serde(rename = "ACCOUNT_DEPOSIT_LOCKED")]
    AccountDepositLocked,
    #[serde(rename = "ACCOUNT_WITHDRAWAL_LOCKED")]
    AccountWithdrawalLocked,
    #[serde(rename = "ACCOUNT_ORDER_CANCEL_LOCKED")]
    AccountOrderCancelLocked,
    #[serde(rename = "INSTRUMENT_NOT_TRADEABLE")]
    InstrumentNotTradeable,
    #[serde(rename = "PENDING_ORDERS_ALLOWED_EXCEEDED")]
    PendingOrdersAllowedExceeded,
    #[serde(rename = "ORDER_ID_UNSPECIFIED")]
    OrderIdUnspecified,
    #[serde(rename = "ORDER_DOESNT_EXIST")]
    OrderDoesntExist,
    #[serde(rename = "ORDER_IDENTIFIER_INCONSISTENCY")]
    OrderIdentifierInconsistency,
    #[serde(rename = "TRADE_ID_UNSPECIFIED")]
    TradeIdUnspecified,
    #[serde(rename = "TRADE_DOESNT_EXIST")]
    TradeDoesntExist,
    #[serde(rename = "TRADE_IDENTIFIER_INCONSISTENCY")]
    TradeIdentifierInconsistency,
    #[serde(rename = "INSUFFICIENT_MARGIN")]
    InsufficientMargin,
    #[serde(rename = "INSTRUMENT_MISSING")]
    InstrumentMissing,
    #[serde(rename = "INSTRUMENT_UNKNOWN")]
    InstrumentUnknown,
    #[serde(rename = "UNITS_MISSING")]
    UnitsMissing,
    #[serde(rename = "UNITS_INVALID")]
    UnitsInvalid,
    #[serde(rename = "UNITS_PRECISION_EXCEEDED")]
    UnitsPrecisionExceeded,
    #[serde(rename = "UNITS_LIMIT_EXCEEDED")]
    UnitsLimitExceeded,
    #[serde(rename = "UNITS_MIMIMUM_NOT_MET")]
    UnitsMimimumNotMet,
    #[serde(rename = "PRICE_MISSING")]
    PriceMissing,
    #[serde(rename = "PRICE_INVALID")]
    PriceInvalid,
    #[serde(rename = "PRICE_PRECISION_EXCEEDED")]
    PricePrecisionExceeded,
    #[serde(rename = "PRICE_DISTANCE_MISSING")]
    PriceDistanceMissing,
    #[serde(rename = "PRICE_DISTANCE_INVALID")]
    PriceDistanceInvalid,
    #[serde(rename = "PRICE_DISTANCE_PRECISION_EXCEEDED")]
    PriceDistancePrecisionExceeded,
    #[serde(rename = "PRICE_DISTANCE_MAXIMUM_EXCEEDED")]
    PriceDistanceMaximumExceeded,
    #[serde(rename = "PRICE_DISTANCE_MINIMUM_NOT_MET")]
    PriceDistanceMinimumNotMet,
    #[serde(rename = "TIME_IN_FORCE_MISSING")]
    TimeInForceMissing,
    #[serde(rename = "TIME_IN_FORCE_INVALID")]
    TimeInForceInvalid,
    #[serde(rename = "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING")]
    TimeInForceGtdTimestampMissing,
    #[serde(rename = "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST")]
    TimeInForceGtdTimestampInPast,
    #[serde(rename = "PRICE_BOUND_INVALID")]
    PriceBoundInvalid,
    #[serde(rename = "PRICE_BOUND_PRECISION_EXCEEDED")]
    PriceBoundPrecisionExceeded,
    #[serde(rename = "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS")]
    OrdersOnFillDuplicateClientOrderIds,
    #[serde(rename = "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED")]
    TradeOnFillClientExtensionsNotSupported,
    #[serde(rename = "CLIENT_ORDER_ID_INVALID")]
    ClientOrderIdInvalid,
    #[serde(rename = "CLIENT_ORDER_ID_ALREADY_EXISTS")]
    ClientOrderIdAlreadyExists,
    #[serde(rename = "CLIENT_ORDER_TAG_INVALID")]
    ClientOrderTagInvalid,
    #[serde(rename = "CLIENT_ORDER_COMMENT_INVALID")]
    ClientOrderCommentInvalid,
    #[serde(rename = "CLIENT_TRADE_ID_INVALID")]
    ClientTradeIdInvalid,
    #[serde(rename = "CLIENT_TRADE_ID_ALREADY_EXISTS")]
    ClientTradeIdAlreadyExists,
    #[serde(rename = "CLIENT_TRADE_TAG_INVALID")]
    ClientTradeTagInvalid,
    #[serde(rename = "CLIENT_TRADE_COMMENT_INVALID")]
    ClientTradeCommentInvalid,
    #[serde(rename = "ORDER_FILL_POSITION_ACTION_MISSING")]
    OrderFillPositionActionMissing,
    #[serde(rename = "ORDER_FILL_POSITION_ACTION_INVALID")]
    OrderFillPositionActionInvalid,
    #[serde(rename = "TRIGGER_CONDITION_MISSING")]
    TriggerConditionMissing,
    #[serde(rename = "TRIGGER_CONDITION_INVALID")]
    TriggerConditionInvalid,
    #[serde(rename = "ORDER_PARTIAL_FILL_OPTION_MISSING")]
    OrderPartialFillOptionMissing,
    #[serde(rename = "ORDER_PARTIAL_FILL_OPTION_INVALID")]
    OrderPartialFillOptionInvalid,
    #[serde(rename = "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL")]
    InvalidReissueImmediatePartialFill,
    #[serde(rename = "TAKE_PROFIT_ORDER_ALREADY_EXISTS")]
    TakeProfitOrderAlreadyExists,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_PRICE_MISSING")]
    TakeProfitOnFillPriceMissing,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_PRICE_INVALID")]
    TakeProfitOnFillPriceInvalid,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED")]
    TakeProfitOnFillPricePrecisionExceeded,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING")]
    TakeProfitOnFillTimeInForceMissing,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID")]
    TakeProfitOnFillTimeInForceInvalid,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING")]
    TakeProfitOnFillGtdTimestampMissing,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST")]
    TakeProfitOnFillGtdTimestampInPast,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID")]
    TakeProfitOnFillClientOrderIdInvalid,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID")]
    TakeProfitOnFillClientOrderTagInvalid,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID")]
    TakeProfitOnFillClientOrderCommentInvalid,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING")]
    TakeProfitOnFillTriggerConditionMissing,
    #[serde(rename = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID")]
    TakeProfitOnFillTriggerConditionInvalid,
    #[serde(rename = "STOP_LOSS_ORDER_ALREADY_EXISTS")]
    StopLossOrderAlreadyExists,
    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_REQUIRED")]
    StopLossOrderGuaranteedRequired,
    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD")]
    StopLossOrderGuaranteedPriceWithinSpread,
    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED")]
    StopLossOrderGuaranteedNotAllowed,
    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION")]
    StopLossOrderGuaranteedHaltedCreateViolation,
    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION")]
    StopLossOrderGuaranteedHaltedTightenViolation,
    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED")]
    StopLossOrderGuaranteedHedgingNotAllowed,
    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET")]
    StopLossOrderGuaranteedMinimumDistanceNotMet,
    #[serde(rename = "STOP_LOSS_ORDER_NOT_CANCELABLE")]
    StopLossOrderNotCancelable,
    #[serde(rename = "STOP_LOSS_ORDER_NOT_REPLACEABLE")]
    StopLossOrderNotReplaceable,
    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED")]
    StopLossOrderGuaranteedLevelRestrictionExceeded,
    #[serde(rename = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED")]
    StopLossOrderPriceAndDistanceBothSpecified,
    #[serde(rename = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING")]
    StopLossOrderPriceAndDistanceBothMissing,
    #[serde(rename = "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER")]
    StopLossOnFillRequiredForPendingOrder,
    #[serde(rename = "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED")]
    StopLossOnFillGuaranteedNotAllowed,
    #[serde(rename = "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED")]
    StopLossOnFillGuaranteedRequired,
    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_MISSING")]
    StopLossOnFillPriceMissing,
    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_INVALID")]
    StopLossOnFillPriceInvalid,
    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED")]
    StopLossOnFillPricePrecisionExceeded,
    #[serde(rename = "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET")]
    StopLossOnFillGuaranteedMinimumDistanceNotMet,
    #[serde(rename = "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED")]
    StopLossOnFillGuaranteedLevelRestrictionExceeded,
    #[serde(rename = "STOP_LOSS_ON_FILL_DISTANCE_INVALID")]
    StopLossOnFillDistanceInvalid,
    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED")]
    StopLossOnFillPriceDistanceMaximumExceeded,
    #[serde(rename = "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED")]
    StopLossOnFillDistancePrecisionExceeded,
    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED")]
    StopLossOnFillPriceAndDistanceBothSpecified,
    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING")]
    StopLossOnFillPriceAndDistanceBothMissing,
    #[serde(rename = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING")]
    StopLossOnFillTimeInForceMissing,
    #[serde(rename = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID")]
    StopLossOnFillTimeInForceInvalid,
    #[serde(rename = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING")]
    StopLossOnFillGtdTimestampMissing,
    #[serde(rename = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST")]
    StopLossOnFillGtdTimestampInPast,
    #[serde(rename = "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID")]
    StopLossOnFillClientOrderIdInvalid,
    #[serde(rename = "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID")]
    StopLossOnFillClientOrderTagInvalid,
    #[serde(rename = "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID")]
    StopLossOnFillClientOrderCommentInvalid,
    #[serde(rename = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING")]
    StopLossOnFillTriggerConditionMissing,
    #[serde(rename = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID")]
    StopLossOnFillTriggerConditionInvalid,
    #[serde(rename = "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS")]
    TrailingStopLossOrderAlreadyExists,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING")]
    TrailingStopLossOnFillPriceDistanceMissing,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID")]
    TrailingStopLossOnFillPriceDistanceInvalid,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED")]
    TrailingStopLossOnFillPriceDistancePrecisionExceeded,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED")]
    TrailingStopLossOnFillPriceDistanceMaximumExceeded,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET")]
    TrailingStopLossOnFillPriceDistanceMinimumNotMet,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING")]
    TrailingStopLossOnFillTimeInForceMissing,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID")]
    TrailingStopLossOnFillTimeInForceInvalid,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING")]
    TrailingStopLossOnFillGtdTimestampMissing,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST")]
    TrailingStopLossOnFillGtdTimestampInPast,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID")]
    TrailingStopLossOnFillClientOrderIdInvalid,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID")]
    TrailingStopLossOnFillClientOrderTagInvalid,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID")]
    TrailingStopLossOnFillClientOrderCommentInvalid,
    #[serde(rename = "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED")]
    TrailingStopLossOrdersNotSupported,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING")]
    TrailingStopLossOnFillTriggerConditionMissing,
    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID")]
    TrailingStopLossOnFillTriggerConditionInvalid,
    #[serde(rename = "CLOSE_TRADE_TYPE_MISSING")]
    CloseTradeTypeMissing,
    #[serde(rename = "CLOSE_TRADE_PARTIAL_UNITS_MISSING")]
    CloseTradePartialUnitsMissing,
    #[serde(rename = "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE")]
    CloseTradeUnitsExceedTradeSize,
    #[serde(rename = "CLOSEOUT_POSITION_DOESNT_EXIST")]
    CloseoutPositionDoesntExist,
    #[serde(rename = "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION")]
    CloseoutPositionIncompleteSpecification,
    #[serde(rename = "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE")]
    CloseoutPositionUnitsExceedPositionSize,
    #[serde(rename = "CLOSEOUT_POSITION_REJECT")]
    CloseoutPositionReject,
    #[serde(rename = "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING")]
    CloseoutPositionPartialUnitsMissing,
    #[serde(rename = "MARKUP_GROUP_ID_INVALID")]
    MarkupGroupIdInvalid,
    #[serde(rename = "POSITION_AGGREGATION_MODE_INVALID")]
    PositionAggregationModeInvalid,
    #[serde(rename = "ADMIN_CONFIGURE_DATA_MISSING")]
    AdminConfigureDataMissing,
    #[serde(rename = "MARGIN_RATE_INVALID")]
    MarginRateInvalid,
    #[serde(rename = "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT")]
    MarginRateWouldTriggerCloseout,
    #[serde(rename = "ALIAS_INVALID")]
    AliasInvalid,
    #[serde(rename = "CLIENT_CONFIGURE_DATA_MISSING")]
    ClientConfigureDataMissing,
    #[serde(rename = "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL")]
    MarginRateWouldTriggerMarginCall,
    #[serde(rename = "AMOUNT_INVALID")]
    AmountInvalid,
    #[serde(rename = "INSUFFICIENT_FUNDS")]
    InsufficientFunds,
    #[serde(rename = "AMOUNT_MISSING")]
    AmountMissing,
    #[serde(rename = "FUNDING_REASON_MISSING")]
    FundingReasonMissing,
    #[serde(rename = "CLIENT_EXTENSIONS_DATA_MISSING")]
    ClientExtensionsDataMissing,
    #[serde(rename = "REPLACING_ORDER_INVALID")]
    ReplacingOrderInvalid,
    #[serde(rename = "REPLACING_TRADE_ID_INVALID")]
    ReplacingTradeIdInvalid,
}

impl Default for RejectReason {
    fn default() -> RejectReason {
        Self::InternalServerError
    }
}