Skip to main content

oanda_v20_openapi/models/
client_configure_reject_transaction.rs

1/*
2 * OANDA v20 API
3 *
4 * The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
5 *
6 * The version of the OpenAPI document: 0.2.1
7 * Contact: jmicoud02@gmail.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ClientConfigureRejectTransaction : A ClientConfigureRejectTransaction represents the reject of configuration of an Account by a client.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ClientConfigureRejectTransaction {
17    /// The Transaction's Identifier.
18    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19    pub id: Option<i32>,
20    /// 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).
21    #[serde(rename = "time", skip_serializing_if = "Option::is_none")]
22    pub time: Option<String>,
23    /// The ID of the user that initiated the creation of the Transaction.
24    #[serde(rename = "userID", skip_serializing_if = "Option::is_none")]
25    pub user_id: Option<i32>,
26    /// The Account's identifier
27    #[serde(rename = "accountID", skip_serializing_if = "Option::is_none")]
28    pub account_id: Option<String>,
29    /// The ID of the \"batch\" that the Transaction belongs to. Transactions in the same batch are applied to the Account simultaneously.
30    #[serde(rename = "batchID", skip_serializing_if = "Option::is_none")]
31    pub batch_id: Option<i32>,
32    /// The Request ID of the request which generated the transaction.
33    #[serde(rename = "requestID", skip_serializing_if = "Option::is_none")]
34    pub request_id: Option<String>,
35    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
36    pub r#type: Option<models::TransactionType>,
37    /// The reason that the Reject Transaction was created
38    #[serde(rename = "rejectReason", skip_serializing_if = "Option::is_none")]
39    pub reject_reason: Option<RejectReason>,
40    /// The client-provided alias for the Account.
41    #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
42    pub alias: Option<String>,
43    /// The margin rate override for the Account.
44    #[serde(rename = "marginRate", skip_serializing_if = "Option::is_none")]
45    pub margin_rate: Option<f64>,
46}
47
48impl ClientConfigureRejectTransaction {
49    /// A ClientConfigureRejectTransaction represents the reject of configuration of an Account by a client.
50    pub fn new() -> ClientConfigureRejectTransaction {
51        ClientConfigureRejectTransaction {
52            id: None,
53            time: None,
54            user_id: None,
55            account_id: None,
56            batch_id: None,
57            request_id: None,
58            r#type: None,
59            reject_reason: None,
60            alias: None,
61            margin_rate: None,
62        }
63    }
64}
65/// The reason that the Reject Transaction was created
66#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
67pub enum RejectReason {
68    #[serde(rename = "INTERNAL_SERVER_ERROR")]
69    InternalServerError,
70    #[serde(rename = "INSTRUMENT_PRICE_UNKNOWN")]
71    InstrumentPriceUnknown,
72    #[serde(rename = "ACCOUNT_NOT_ACTIVE")]
73    AccountNotActive,
74    #[serde(rename = "ACCOUNT_LOCKED")]
75    AccountLocked,
76    #[serde(rename = "ACCOUNT_ORDER_CREATION_LOCKED")]
77    AccountOrderCreationLocked,
78    #[serde(rename = "ACCOUNT_CONFIGURATION_LOCKED")]
79    AccountConfigurationLocked,
80    #[serde(rename = "ACCOUNT_DEPOSIT_LOCKED")]
81    AccountDepositLocked,
82    #[serde(rename = "ACCOUNT_WITHDRAWAL_LOCKED")]
83    AccountWithdrawalLocked,
84    #[serde(rename = "ACCOUNT_ORDER_CANCEL_LOCKED")]
85    AccountOrderCancelLocked,
86    #[serde(rename = "INSTRUMENT_NOT_TRADEABLE")]
87    InstrumentNotTradeable,
88    #[serde(rename = "PENDING_ORDERS_ALLOWED_EXCEEDED")]
89    PendingOrdersAllowedExceeded,
90    #[serde(rename = "ORDER_ID_UNSPECIFIED")]
91    OrderIdUnspecified,
92    #[serde(rename = "ORDER_DOESNT_EXIST")]
93    OrderDoesntExist,
94    #[serde(rename = "ORDER_IDENTIFIER_INCONSISTENCY")]
95    OrderIdentifierInconsistency,
96    #[serde(rename = "TRADE_ID_UNSPECIFIED")]
97    TradeIdUnspecified,
98    #[serde(rename = "TRADE_DOESNT_EXIST")]
99    TradeDoesntExist,
100    #[serde(rename = "TRADE_IDENTIFIER_INCONSISTENCY")]
101    TradeIdentifierInconsistency,
102    #[serde(rename = "INSUFFICIENT_MARGIN")]
103    InsufficientMargin,
104    #[serde(rename = "INSTRUMENT_MISSING")]
105    InstrumentMissing,
106    #[serde(rename = "INSTRUMENT_UNKNOWN")]
107    InstrumentUnknown,
108    #[serde(rename = "UNITS_MISSING")]
109    UnitsMissing,
110    #[serde(rename = "UNITS_INVALID")]
111    UnitsInvalid,
112    #[serde(rename = "UNITS_PRECISION_EXCEEDED")]
113    UnitsPrecisionExceeded,
114    #[serde(rename = "UNITS_LIMIT_EXCEEDED")]
115    UnitsLimitExceeded,
116    #[serde(rename = "UNITS_MIMIMUM_NOT_MET")]
117    UnitsMimimumNotMet,
118    #[serde(rename = "PRICE_MISSING")]
119    PriceMissing,
120    #[serde(rename = "PRICE_INVALID")]
121    PriceInvalid,
122    #[serde(rename = "PRICE_PRECISION_EXCEEDED")]
123    PricePrecisionExceeded,
124    #[serde(rename = "PRICE_DISTANCE_MISSING")]
125    PriceDistanceMissing,
126    #[serde(rename = "PRICE_DISTANCE_INVALID")]
127    PriceDistanceInvalid,
128    #[serde(rename = "PRICE_DISTANCE_PRECISION_EXCEEDED")]
129    PriceDistancePrecisionExceeded,
130    #[serde(rename = "PRICE_DISTANCE_MAXIMUM_EXCEEDED")]
131    PriceDistanceMaximumExceeded,
132    #[serde(rename = "PRICE_DISTANCE_MINIMUM_NOT_MET")]
133    PriceDistanceMinimumNotMet,
134    #[serde(rename = "TIME_IN_FORCE_MISSING")]
135    TimeInForceMissing,
136    #[serde(rename = "TIME_IN_FORCE_INVALID")]
137    TimeInForceInvalid,
138    #[serde(rename = "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING")]
139    TimeInForceGtdTimestampMissing,
140    #[serde(rename = "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST")]
141    TimeInForceGtdTimestampInPast,
142    #[serde(rename = "PRICE_BOUND_INVALID")]
143    PriceBoundInvalid,
144    #[serde(rename = "PRICE_BOUND_PRECISION_EXCEEDED")]
145    PriceBoundPrecisionExceeded,
146    #[serde(rename = "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS")]
147    OrdersOnFillDuplicateClientOrderIds,
148    #[serde(rename = "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED")]
149    TradeOnFillClientExtensionsNotSupported,
150    #[serde(rename = "CLIENT_ORDER_ID_INVALID")]
151    ClientOrderIdInvalid,
152    #[serde(rename = "CLIENT_ORDER_ID_ALREADY_EXISTS")]
153    ClientOrderIdAlreadyExists,
154    #[serde(rename = "CLIENT_ORDER_TAG_INVALID")]
155    ClientOrderTagInvalid,
156    #[serde(rename = "CLIENT_ORDER_COMMENT_INVALID")]
157    ClientOrderCommentInvalid,
158    #[serde(rename = "CLIENT_TRADE_ID_INVALID")]
159    ClientTradeIdInvalid,
160    #[serde(rename = "CLIENT_TRADE_ID_ALREADY_EXISTS")]
161    ClientTradeIdAlreadyExists,
162    #[serde(rename = "CLIENT_TRADE_TAG_INVALID")]
163    ClientTradeTagInvalid,
164    #[serde(rename = "CLIENT_TRADE_COMMENT_INVALID")]
165    ClientTradeCommentInvalid,
166    #[serde(rename = "ORDER_FILL_POSITION_ACTION_MISSING")]
167    OrderFillPositionActionMissing,
168    #[serde(rename = "ORDER_FILL_POSITION_ACTION_INVALID")]
169    OrderFillPositionActionInvalid,
170    #[serde(rename = "TRIGGER_CONDITION_MISSING")]
171    TriggerConditionMissing,
172    #[serde(rename = "TRIGGER_CONDITION_INVALID")]
173    TriggerConditionInvalid,
174    #[serde(rename = "ORDER_PARTIAL_FILL_OPTION_MISSING")]
175    OrderPartialFillOptionMissing,
176    #[serde(rename = "ORDER_PARTIAL_FILL_OPTION_INVALID")]
177    OrderPartialFillOptionInvalid,
178    #[serde(rename = "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL")]
179    InvalidReissueImmediatePartialFill,
180    #[serde(rename = "TAKE_PROFIT_ORDER_ALREADY_EXISTS")]
181    TakeProfitOrderAlreadyExists,
182    #[serde(rename = "TAKE_PROFIT_ON_FILL_PRICE_MISSING")]
183    TakeProfitOnFillPriceMissing,
184    #[serde(rename = "TAKE_PROFIT_ON_FILL_PRICE_INVALID")]
185    TakeProfitOnFillPriceInvalid,
186    #[serde(rename = "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED")]
187    TakeProfitOnFillPricePrecisionExceeded,
188    #[serde(rename = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING")]
189    TakeProfitOnFillTimeInForceMissing,
190    #[serde(rename = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID")]
191    TakeProfitOnFillTimeInForceInvalid,
192    #[serde(rename = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING")]
193    TakeProfitOnFillGtdTimestampMissing,
194    #[serde(rename = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST")]
195    TakeProfitOnFillGtdTimestampInPast,
196    #[serde(rename = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID")]
197    TakeProfitOnFillClientOrderIdInvalid,
198    #[serde(rename = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID")]
199    TakeProfitOnFillClientOrderTagInvalid,
200    #[serde(rename = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID")]
201    TakeProfitOnFillClientOrderCommentInvalid,
202    #[serde(rename = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING")]
203    TakeProfitOnFillTriggerConditionMissing,
204    #[serde(rename = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID")]
205    TakeProfitOnFillTriggerConditionInvalid,
206    #[serde(rename = "STOP_LOSS_ORDER_ALREADY_EXISTS")]
207    StopLossOrderAlreadyExists,
208    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_REQUIRED")]
209    StopLossOrderGuaranteedRequired,
210    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD")]
211    StopLossOrderGuaranteedPriceWithinSpread,
212    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED")]
213    StopLossOrderGuaranteedNotAllowed,
214    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION")]
215    StopLossOrderGuaranteedHaltedCreateViolation,
216    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION")]
217    StopLossOrderGuaranteedHaltedTightenViolation,
218    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED")]
219    StopLossOrderGuaranteedHedgingNotAllowed,
220    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET")]
221    StopLossOrderGuaranteedMinimumDistanceNotMet,
222    #[serde(rename = "STOP_LOSS_ORDER_NOT_CANCELABLE")]
223    StopLossOrderNotCancelable,
224    #[serde(rename = "STOP_LOSS_ORDER_NOT_REPLACEABLE")]
225    StopLossOrderNotReplaceable,
226    #[serde(rename = "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED")]
227    StopLossOrderGuaranteedLevelRestrictionExceeded,
228    #[serde(rename = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED")]
229    StopLossOrderPriceAndDistanceBothSpecified,
230    #[serde(rename = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING")]
231    StopLossOrderPriceAndDistanceBothMissing,
232    #[serde(rename = "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER")]
233    StopLossOnFillRequiredForPendingOrder,
234    #[serde(rename = "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED")]
235    StopLossOnFillGuaranteedNotAllowed,
236    #[serde(rename = "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED")]
237    StopLossOnFillGuaranteedRequired,
238    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_MISSING")]
239    StopLossOnFillPriceMissing,
240    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_INVALID")]
241    StopLossOnFillPriceInvalid,
242    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED")]
243    StopLossOnFillPricePrecisionExceeded,
244    #[serde(rename = "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET")]
245    StopLossOnFillGuaranteedMinimumDistanceNotMet,
246    #[serde(rename = "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED")]
247    StopLossOnFillGuaranteedLevelRestrictionExceeded,
248    #[serde(rename = "STOP_LOSS_ON_FILL_DISTANCE_INVALID")]
249    StopLossOnFillDistanceInvalid,
250    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED")]
251    StopLossOnFillPriceDistanceMaximumExceeded,
252    #[serde(rename = "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED")]
253    StopLossOnFillDistancePrecisionExceeded,
254    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED")]
255    StopLossOnFillPriceAndDistanceBothSpecified,
256    #[serde(rename = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING")]
257    StopLossOnFillPriceAndDistanceBothMissing,
258    #[serde(rename = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING")]
259    StopLossOnFillTimeInForceMissing,
260    #[serde(rename = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID")]
261    StopLossOnFillTimeInForceInvalid,
262    #[serde(rename = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING")]
263    StopLossOnFillGtdTimestampMissing,
264    #[serde(rename = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST")]
265    StopLossOnFillGtdTimestampInPast,
266    #[serde(rename = "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID")]
267    StopLossOnFillClientOrderIdInvalid,
268    #[serde(rename = "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID")]
269    StopLossOnFillClientOrderTagInvalid,
270    #[serde(rename = "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID")]
271    StopLossOnFillClientOrderCommentInvalid,
272    #[serde(rename = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING")]
273    StopLossOnFillTriggerConditionMissing,
274    #[serde(rename = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID")]
275    StopLossOnFillTriggerConditionInvalid,
276    #[serde(rename = "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS")]
277    TrailingStopLossOrderAlreadyExists,
278    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING")]
279    TrailingStopLossOnFillPriceDistanceMissing,
280    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID")]
281    TrailingStopLossOnFillPriceDistanceInvalid,
282    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED")]
283    TrailingStopLossOnFillPriceDistancePrecisionExceeded,
284    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED")]
285    TrailingStopLossOnFillPriceDistanceMaximumExceeded,
286    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET")]
287    TrailingStopLossOnFillPriceDistanceMinimumNotMet,
288    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING")]
289    TrailingStopLossOnFillTimeInForceMissing,
290    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID")]
291    TrailingStopLossOnFillTimeInForceInvalid,
292    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING")]
293    TrailingStopLossOnFillGtdTimestampMissing,
294    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST")]
295    TrailingStopLossOnFillGtdTimestampInPast,
296    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID")]
297    TrailingStopLossOnFillClientOrderIdInvalid,
298    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID")]
299    TrailingStopLossOnFillClientOrderTagInvalid,
300    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID")]
301    TrailingStopLossOnFillClientOrderCommentInvalid,
302    #[serde(rename = "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED")]
303    TrailingStopLossOrdersNotSupported,
304    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING")]
305    TrailingStopLossOnFillTriggerConditionMissing,
306    #[serde(rename = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID")]
307    TrailingStopLossOnFillTriggerConditionInvalid,
308    #[serde(rename = "CLOSE_TRADE_TYPE_MISSING")]
309    CloseTradeTypeMissing,
310    #[serde(rename = "CLOSE_TRADE_PARTIAL_UNITS_MISSING")]
311    CloseTradePartialUnitsMissing,
312    #[serde(rename = "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE")]
313    CloseTradeUnitsExceedTradeSize,
314    #[serde(rename = "CLOSEOUT_POSITION_DOESNT_EXIST")]
315    CloseoutPositionDoesntExist,
316    #[serde(rename = "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION")]
317    CloseoutPositionIncompleteSpecification,
318    #[serde(rename = "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE")]
319    CloseoutPositionUnitsExceedPositionSize,
320    #[serde(rename = "CLOSEOUT_POSITION_REJECT")]
321    CloseoutPositionReject,
322    #[serde(rename = "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING")]
323    CloseoutPositionPartialUnitsMissing,
324    #[serde(rename = "MARKUP_GROUP_ID_INVALID")]
325    MarkupGroupIdInvalid,
326    #[serde(rename = "POSITION_AGGREGATION_MODE_INVALID")]
327    PositionAggregationModeInvalid,
328    #[serde(rename = "ADMIN_CONFIGURE_DATA_MISSING")]
329    AdminConfigureDataMissing,
330    #[serde(rename = "MARGIN_RATE_INVALID")]
331    MarginRateInvalid,
332    #[serde(rename = "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT")]
333    MarginRateWouldTriggerCloseout,
334    #[serde(rename = "ALIAS_INVALID")]
335    AliasInvalid,
336    #[serde(rename = "CLIENT_CONFIGURE_DATA_MISSING")]
337    ClientConfigureDataMissing,
338    #[serde(rename = "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL")]
339    MarginRateWouldTriggerMarginCall,
340    #[serde(rename = "AMOUNT_INVALID")]
341    AmountInvalid,
342    #[serde(rename = "INSUFFICIENT_FUNDS")]
343    InsufficientFunds,
344    #[serde(rename = "AMOUNT_MISSING")]
345    AmountMissing,
346    #[serde(rename = "FUNDING_REASON_MISSING")]
347    FundingReasonMissing,
348    #[serde(rename = "CLIENT_EXTENSIONS_DATA_MISSING")]
349    ClientExtensionsDataMissing,
350    #[serde(rename = "REPLACING_ORDER_INVALID")]
351    ReplacingOrderInvalid,
352    #[serde(rename = "REPLACING_TRADE_ID_INVALID")]
353    ReplacingTradeIdInvalid,
354}
355
356impl Default for RejectReason {
357    fn default() -> RejectReason {
358        Self::InternalServerError
359    }
360}
361