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
/*
 * 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};

/// TradeClientExtensionsModifyRejectTransaction : A TradeClientExtensionsModifyRejectTransaction represents the rejection of the modification of a Trade's Client Extensions.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TradeClientExtensionsModifyRejectTransaction {
    /// 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>,
    /// The ID of the Trade who's client extensions are to be modified.
    #[serde(rename = "tradeID", skip_serializing_if = "Option::is_none")]
    pub trade_id: Option<i32>,
    /// The original Client ID of the Trade who's client extensions are to be modified.
    #[serde(rename = "clientTradeID", skip_serializing_if = "Option::is_none")]
    pub client_trade_id: Option<String>,
    #[serde(rename = "tradeClientExtensionsModify", skip_serializing_if = "Option::is_none")]
    pub trade_client_extensions_modify: Option<Box<models::ClientExtensions>>,
}

impl TradeClientExtensionsModifyRejectTransaction {
    /// A TradeClientExtensionsModifyRejectTransaction represents the rejection of the modification of a Trade's Client Extensions.
    pub fn new() -> TradeClientExtensionsModifyRejectTransaction {
        TradeClientExtensionsModifyRejectTransaction {
            id: None,
            time: None,
            user_id: None,
            account_id: None,
            batch_id: None,
            request_id: None,
            r#type: None,
            reject_reason: None,
            trade_id: None,
            client_trade_id: None,
            trade_client_extensions_modify: 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
    }
}