@gitchrisqueen/tdameritrade-api-js-client
Version:
TD Ameritrade API integration for node.js
364 lines (349 loc) • 11 kB
JavaScript
/**
* TD Ameritrade API - OAuth2
* This is replication of the TD Ameritrade API.
*
* OpenAPI spec version: 0.1.4
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import UserPrincipalPreferencesMutualFundTaxLotMethod from './UserPrincipalPreferencesMutualFundTaxLotMethod';
/**
* The UserPrincipalPreferences model module.
* @module model/UserPrincipalPreferences
* @version 0.1.4
*/
export default class UserPrincipalPreferences {
/**
* Constructs a new <code>UserPrincipalPreferences</code>.
* @alias module:model/UserPrincipalPreferences
* @class
*/
constructor() {
}
/**
* Constructs a <code>UserPrincipalPreferences</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/UserPrincipalPreferences} obj Optional instance to populate.
* @return {module:model/UserPrincipalPreferences} The populated <code>UserPrincipalPreferences</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new UserPrincipalPreferences();
if (data.hasOwnProperty('expressTrading')) {
obj['expressTrading'] = ApiClient.convertToType(data['expressTrading'], 'Boolean');
}
if (data.hasOwnProperty('directOptionsRouting')) {
obj['directOptionsRouting'] = ApiClient.convertToType(data['directOptionsRouting'], 'Boolean');
}
if (data.hasOwnProperty('directEquityRouting')) {
obj['directEquityRouting'] = ApiClient.convertToType(data['directEquityRouting'], 'Boolean');
}
if (data.hasOwnProperty('defaultEquityOrderLegInstruction')) {
obj['defaultEquityOrderLegInstruction'] = ApiClient.convertToType(data['defaultEquityOrderLegInstruction'], 'String');
}
if (data.hasOwnProperty('defaultEquityOrderType')) {
obj['defaultEquityOrderType'] = ApiClient.convertToType(data['defaultEquityOrderType'], 'String');
}
if (data.hasOwnProperty('defaultEquityOrderPriceLinkType')) {
obj['defaultEquityOrderPriceLinkType'] = ApiClient.convertToType(data['defaultEquityOrderPriceLinkType'], 'String');
}
if (data.hasOwnProperty('defaultEquityOrderDuration')) {
obj['defaultEquityOrderDuration'] = ApiClient.convertToType(data['defaultEquityOrderDuration'], 'String');
}
if (data.hasOwnProperty('defaultEquityOrderMarketSession')) {
obj['defaultEquityOrderMarketSession'] = ApiClient.convertToType(data['defaultEquityOrderMarketSession'], 'String');
}
if (data.hasOwnProperty('defaultEquityQuantity')) {
obj['defaultEquityQuantity'] = ApiClient.convertToType(data['defaultEquityQuantity'], 'Number');
}
if (data.hasOwnProperty('mutualFundTaxLotMethod')) {
obj['mutualFundTaxLotMethod'] = UserPrincipalPreferencesMutualFundTaxLotMethod.constructFromObject(data['mutualFundTaxLotMethod']);
}
if (data.hasOwnProperty('optionTaxLotMethod')) {
obj['optionTaxLotMethod'] = UserPrincipalPreferencesMutualFundTaxLotMethod.constructFromObject(data['optionTaxLotMethod']);
}
if (data.hasOwnProperty('equityTaxLotMethod')) {
obj['equityTaxLotMethod'] = UserPrincipalPreferencesMutualFundTaxLotMethod.constructFromObject(data['equityTaxLotMethod']);
}
if (data.hasOwnProperty('defaultAdvancedToolLaunch')) {
obj['defaultAdvancedToolLaunch'] = ApiClient.convertToType(data['defaultAdvancedToolLaunch'], 'String');
}
if (data.hasOwnProperty('authTokenTimeout')) {
obj['authTokenTimeout'] = ApiClient.convertToType(data['authTokenTimeout'], 'String');
}
}
return obj;
}
/**
* @member {Boolean} expressTrading
* @default false
*/
'expressTrading' = false;
/**
* @member {Boolean} directOptionsRouting
* @default false
*/
'directOptionsRouting' = false;
/**
* @member {Boolean} directEquityRouting
* @default false
*/
'directEquityRouting' = false;
/**
* @member {module:model/UserPrincipalPreferences.DefaultEquityOrderLegInstructionEnum} defaultEquityOrderLegInstruction
*/
'defaultEquityOrderLegInstruction' = undefined;
/**
* @member {module:model/UserPrincipalPreferences.DefaultEquityOrderTypeEnum} defaultEquityOrderType
*/
'defaultEquityOrderType' = undefined;
/**
* @member {module:model/UserPrincipalPreferences.DefaultEquityOrderPriceLinkTypeEnum} defaultEquityOrderPriceLinkType
*/
'defaultEquityOrderPriceLinkType' = undefined;
/**
* @member {module:model/UserPrincipalPreferences.DefaultEquityOrderDurationEnum} defaultEquityOrderDuration
*/
'defaultEquityOrderDuration' = undefined;
/**
* @member {module:model/UserPrincipalPreferences.DefaultEquityOrderMarketSessionEnum} defaultEquityOrderMarketSession
*/
'defaultEquityOrderMarketSession' = undefined;
/**
* @member {Number} defaultEquityQuantity
*/
'defaultEquityQuantity' = undefined;
/**
* @member {module:model/UserPrincipalPreferencesMutualFundTaxLotMethod} mutualFundTaxLotMethod
*/
'mutualFundTaxLotMethod' = undefined;
/**
* @member {module:model/UserPrincipalPreferencesMutualFundTaxLotMethod} optionTaxLotMethod
*/
'optionTaxLotMethod' = undefined;
/**
* @member {module:model/UserPrincipalPreferencesMutualFundTaxLotMethod} equityTaxLotMethod
*/
'equityTaxLotMethod' = undefined;
/**
* @member {module:model/UserPrincipalPreferences.DefaultAdvancedToolLaunchEnum} defaultAdvancedToolLaunch
*/
'defaultAdvancedToolLaunch' = undefined;
/**
* @member {module:model/UserPrincipalPreferences.AuthTokenTimeoutEnum} authTokenTimeout
*/
'authTokenTimeout' = undefined;
/**
* Allowed values for the <code>defaultEquityOrderLegInstruction</code> property.
* @enum {String}
* @readonly
*/
static DefaultEquityOrderLegInstructionEnum = {
/**
* value: "BUY"
* @const
*/
"BUY": "BUY",
/**
* value: "SELL"
* @const
*/
"SELL": "SELL",
/**
* value: "BUY_TO_COVER"
* @const
*/
"BUY_TO_COVER": "BUY_TO_COVER",
/**
* value: "SELL_SHORT"
* @const
*/
"SELL_SHORT": "SELL_SHORT",
/**
* value: "NONE"
* @const
*/
"NONE": "NONE" };
/**
* Allowed values for the <code>defaultEquityOrderType</code> property.
* @enum {String}
* @readonly
*/
static DefaultEquityOrderTypeEnum = {
/**
* value: "MARKET"
* @const
*/
"MARKET": "MARKET",
/**
* value: "LIMIT"
* @const
*/
"LIMIT": "LIMIT",
/**
* value: "STOP"
* @const
*/
"STOP": "STOP",
/**
* value: "STOP_LIMIT"
* @const
*/
"STOP_LIMIT": "STOP_LIMIT",
/**
* value: "TRAILING_STOP"
* @const
*/
"TRAILING_STOP": "TRAILING_STOP",
/**
* value: "MARKET_ON_CLOSE"
* @const
*/
"MARKET_ON_CLOSE": "MARKET_ON_CLOSE",
/**
* value: "NONE"
* @const
*/
"NONE": "NONE" };
/**
* Allowed values for the <code>defaultEquityOrderPriceLinkType</code> property.
* @enum {String}
* @readonly
*/
static DefaultEquityOrderPriceLinkTypeEnum = {
/**
* value: "VALUE"
* @const
*/
"VALUE": "VALUE",
/**
* value: "PERCENT"
* @const
*/
"PERCENT": "PERCENT",
/**
* value: "NONE"
* @const
*/
"NONE": "NONE" };
/**
* Allowed values for the <code>defaultEquityOrderDuration</code> property.
* @enum {String}
* @readonly
*/
static DefaultEquityOrderDurationEnum = {
/**
* value: "DAY"
* @const
*/
"DAY": "DAY",
/**
* value: "GOOD_TILL_CANCEL"
* @const
*/
"GOOD_TILL_CANCEL": "GOOD_TILL_CANCEL",
/**
* value: "NONE"
* @const
*/
"NONE": "NONE" };
/**
* Allowed values for the <code>defaultEquityOrderMarketSession</code> property.
* @enum {String}
* @readonly
*/
static DefaultEquityOrderMarketSessionEnum = {
/**
* value: "AM"
* @const
*/
"AM": "AM",
/**
* value: "PM"
* @const
*/
"PM": "PM",
/**
* value: "NORMAL"
* @const
*/
"NORMAL": "NORMAL",
/**
* value: "SEAMLESS"
* @const
*/
"SEAMLESS": "SEAMLESS",
/**
* value: "NONE"
* @const
*/
"NONE": "NONE" };
/**
* Allowed values for the <code>defaultAdvancedToolLaunch</code> property.
* @enum {String}
* @readonly
*/
static DefaultAdvancedToolLaunchEnum = {
/**
* value: "TA"
* @const
*/
"TA": "TA",
/**
* value: "N"
* @const
*/
"N": "N",
/**
* value: "Y"
* @const
*/
"Y": "Y",
/**
* value: "TOS"
* @const
*/
"TOS": "TOS",
/**
* value: "NONE"
* @const
*/
"NONE": "NONE",
/**
* value: "CC2"
* @const
*/
"CC2": "CC2" };
/**
* Allowed values for the <code>authTokenTimeout</code> property.
* @enum {String}
* @readonly
*/
static AuthTokenTimeoutEnum = {
/**
* value: "FIFTY_FIVE_MINUTES"
* @const
*/
"FIFTY_FIVE_MINUTES": "FIFTY_FIVE_MINUTES",
/**
* value: "TWO_HOURS"
* @const
*/
"TWO_HOURS": "TWO_HOURS",
/**
* value: "FOUR_HOURS"
* @const
*/
"FOUR_HOURS": "FOUR_HOURS",
/**
* value: "EIGHT_HOURS"
* @const
*/
"EIGHT_HOURS": "EIGHT_HOURS" };
}