@gitchrisqueen/tdameritrade-api-js-client
Version:
TD Ameritrade API integration for node.js
934 lines (792 loc) • 20.6 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
*
* Swagger Codegen version: 2.4.14
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/OrderGetCancelTime', 'model/OrderGetDuration', 'model/OrderGetOrderActivityCollection', 'model/OrderGetOrderLegCollection', 'model/OrderGetOrderType', 'model/OrderGetSession'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./OrderGetCancelTime'), require('./OrderGetDuration'), require('./OrderGetOrderActivityCollection'), require('./OrderGetOrderLegCollection'), require('./OrderGetOrderType'), require('./OrderGetSession'));
} else {
// Browser globals (root is window)
if (!root.GitChrisQueen_TDA_JS) {
root.GitChrisQueen_TDA_JS = {};
}
root.GitChrisQueen_TDA_JS.OrderGet = factory(root.GitChrisQueen_TDA_JS.ApiClient, root.GitChrisQueen_TDA_JS.OrderGetCancelTime, root.GitChrisQueen_TDA_JS.OrderGetDuration, root.GitChrisQueen_TDA_JS.OrderGetOrderActivityCollection, root.GitChrisQueen_TDA_JS.OrderGetOrderLegCollection, root.GitChrisQueen_TDA_JS.OrderGetOrderType, root.GitChrisQueen_TDA_JS.OrderGetSession);
}
}(this, function(ApiClient, OrderGetCancelTime, OrderGetDuration, OrderGetOrderActivityCollection, OrderGetOrderLegCollection, OrderGetOrderType, OrderGetSession) {
'use strict';
/**
* The OrderGet model module.
* @module model/OrderGet
* @version 0.1.4
*/
/**
* Constructs a new <code>OrderGet</code>.
* @alias module:model/OrderGet
* @class
*/
var exports = function() {
};
/**
* Constructs a <code>OrderGet</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/OrderGet} obj Optional instance to populate.
* @return {module:model/OrderGet} The populated <code>OrderGet</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('accountId'))
obj.accountId = ApiClient.convertToType(data['accountId'], 'Number');
if (data.hasOwnProperty('activationPrice'))
obj.activationPrice = ApiClient.convertToType(data['activationPrice'], 'Number');
if (data.hasOwnProperty('cancelTime'))
obj.cancelTime = OrderGetCancelTime.constructFromObject(data['cancelTime']);
if (data.hasOwnProperty('cancelable'))
obj.cancelable = ApiClient.convertToType(data['cancelable'], 'Boolean');
if (data.hasOwnProperty('childOrderStrategies'))
obj.childOrderStrategies = ApiClient.convertToType(data['childOrderStrategies'], [Object]);
if (data.hasOwnProperty('closedTime'))
obj.closedTime = ApiClient.convertToType(data['closedTime'], 'Date');
if (data.hasOwnProperty('complexOrderStrategyType'))
obj.complexOrderStrategyType = ApiClient.convertToType(data['complexOrderStrategyType'], 'String');
if (data.hasOwnProperty('destinationLinkName'))
obj.destinationLinkName = ApiClient.convertToType(data['destinationLinkName'], 'String');
if (data.hasOwnProperty('duration'))
obj.duration = OrderGetDuration.constructFromObject(data['duration']);
if (data.hasOwnProperty('editable'))
obj.editable = ApiClient.convertToType(data['editable'], 'Boolean');
if (data.hasOwnProperty('enteredTime'))
obj.enteredTime = ApiClient.convertToType(data['enteredTime'], 'Date');
if (data.hasOwnProperty('filledQuantity'))
obj.filledQuantity = ApiClient.convertToType(data['filledQuantity'], 'Number');
if (data.hasOwnProperty('orderActivityCollection'))
obj.orderActivityCollection = ApiClient.convertToType(data['orderActivityCollection'], [OrderGetOrderActivityCollection]);
if (data.hasOwnProperty('orderId'))
obj.orderId = ApiClient.convertToType(data['orderId'], 'Number');
if (data.hasOwnProperty('orderLegCollection'))
obj.orderLegCollection = ApiClient.convertToType(data['orderLegCollection'], [OrderGetOrderLegCollection]);
if (data.hasOwnProperty('orderStrategyType'))
obj.orderStrategyType = ApiClient.convertToType(data['orderStrategyType'], 'String');
if (data.hasOwnProperty('orderType'))
obj.orderType = OrderGetOrderType.constructFromObject(data['orderType']);
if (data.hasOwnProperty('price'))
obj.price = ApiClient.convertToType(data['price'], 'Number');
if (data.hasOwnProperty('priceLinkBasis'))
obj.priceLinkBasis = ApiClient.convertToType(data['priceLinkBasis'], 'String');
if (data.hasOwnProperty('priceLinkType'))
obj.priceLinkType = ApiClient.convertToType(data['priceLinkType'], 'String');
if (data.hasOwnProperty('quality'))
obj.quality = ApiClient.convertToType(data['quality'], 'Number');
if (data.hasOwnProperty('releaseTime'))
obj.releaseTime = ApiClient.convertToType(data['releaseTime'], 'Date');
if (data.hasOwnProperty('remainingQuantity'))
obj.remainingQuantity = ApiClient.convertToType(data['remainingQuantity'], 'Number');
if (data.hasOwnProperty('replacingOrderCollection'))
obj.replacingOrderCollection = ApiClient.convertToType(data['replacingOrderCollection'], [Object]);
if (data.hasOwnProperty('requestedDestination'))
obj.requestedDestination = ApiClient.convertToType(data['requestedDestination'], 'String');
if (data.hasOwnProperty('session'))
obj.session = OrderGetSession.constructFromObject(data['session']);
if (data.hasOwnProperty('specialInstruction'))
obj.specialInstruction = ApiClient.convertToType(data['specialInstruction'], 'String');
if (data.hasOwnProperty('status'))
obj.status = ApiClient.convertToType(data['status'], 'String');
if (data.hasOwnProperty('statusDescription'))
obj.statusDescription = ApiClient.convertToType(data['statusDescription'], 'String');
if (data.hasOwnProperty('stopPrice'))
obj.stopPrice = ApiClient.convertToType(data['stopPrice'], 'Number');
if (data.hasOwnProperty('stopPriceLinkBasis'))
obj.stopPriceLinkBasis = ApiClient.convertToType(data['stopPriceLinkBasis'], 'String');
if (data.hasOwnProperty('stopPriceLinkType'))
obj.stopPriceLinkType = ApiClient.convertToType(data['stopPriceLinkType'], 'String');
if (data.hasOwnProperty('stopPriceOffset'))
obj.stopPriceOffset = ApiClient.convertToType(data['stopPriceOffset'], 'Number');
if (data.hasOwnProperty('stopType'))
obj.stopType = ApiClient.convertToType(data['stopType'], 'String');
if (data.hasOwnProperty('tag'))
obj.tag = ApiClient.convertToType(data['tag'], 'String');
if (data.hasOwnProperty('taxLotMethod'))
obj.taxLotMethod = ApiClient.convertToType(data['taxLotMethod'], 'String');
}
return obj;
}
/**
* @member {Number} accountId
*/
exports.prototype.accountId = undefined;
/**
* @member {Number} activationPrice
*/
exports.prototype.activationPrice = undefined;
/**
* @member {module:model/OrderGetCancelTime} cancelTime
*/
exports.prototype.cancelTime = undefined;
/**
* @member {Boolean} cancelable
* @default false
*/
exports.prototype.cancelable = false;
/**
* @member {Array.<Object>} childOrderStrategies
*/
exports.prototype.childOrderStrategies = undefined;
/**
* @member {Date} closedTime
*/
exports.prototype.closedTime = undefined;
/**
* @member {module:model/OrderGet.ComplexOrderStrategyTypeEnum} complexOrderStrategyType
*/
exports.prototype.complexOrderStrategyType = undefined;
/**
* @member {String} destinationLinkName
*/
exports.prototype.destinationLinkName = undefined;
/**
* @member {module:model/OrderGetDuration} duration
*/
exports.prototype.duration = undefined;
/**
* @member {Boolean} editable
* @default false
*/
exports.prototype.editable = false;
/**
* @member {Date} enteredTime
*/
exports.prototype.enteredTime = undefined;
/**
* @member {Number} filledQuantity
*/
exports.prototype.filledQuantity = undefined;
/**
* @member {Array.<module:model/OrderGetOrderActivityCollection>} orderActivityCollection
*/
exports.prototype.orderActivityCollection = undefined;
/**
* @member {Number} orderId
*/
exports.prototype.orderId = undefined;
/**
* @member {Array.<module:model/OrderGetOrderLegCollection>} orderLegCollection
*/
exports.prototype.orderLegCollection = undefined;
/**
* @member {module:model/OrderGet.OrderStrategyTypeEnum} orderStrategyType
*/
exports.prototype.orderStrategyType = undefined;
/**
* @member {module:model/OrderGetOrderType} orderType
*/
exports.prototype.orderType = undefined;
/**
* @member {Number} price
*/
exports.prototype.price = undefined;
/**
* @member {module:model/OrderGet.PriceLinkBasisEnum} priceLinkBasis
*/
exports.prototype.priceLinkBasis = undefined;
/**
* @member {module:model/OrderGet.PriceLinkTypeEnum} priceLinkType
*/
exports.prototype.priceLinkType = undefined;
/**
* @member {Number} quality
*/
exports.prototype.quality = undefined;
/**
* @member {Date} releaseTime
*/
exports.prototype.releaseTime = undefined;
/**
* @member {Number} remainingQuantity
*/
exports.prototype.remainingQuantity = undefined;
/**
* @member {Array.<Object>} replacingOrderCollection
*/
exports.prototype.replacingOrderCollection = undefined;
/**
* @member {module:model/OrderGet.RequestedDestinationEnum} requestedDestination
*/
exports.prototype.requestedDestination = undefined;
/**
* @member {module:model/OrderGetSession} session
*/
exports.prototype.session = undefined;
/**
* @member {module:model/OrderGet.SpecialInstructionEnum} specialInstruction
*/
exports.prototype.specialInstruction = undefined;
/**
* @member {module:model/OrderGet.StatusEnum} status
*/
exports.prototype.status = undefined;
/**
* @member {String} statusDescription
*/
exports.prototype.statusDescription = undefined;
/**
* @member {Number} stopPrice
*/
exports.prototype.stopPrice = undefined;
/**
* @member {module:model/OrderGet.StopPriceLinkBasisEnum} stopPriceLinkBasis
*/
exports.prototype.stopPriceLinkBasis = undefined;
/**
* @member {module:model/OrderGet.StopPriceLinkTypeEnum} stopPriceLinkType
*/
exports.prototype.stopPriceLinkType = undefined;
/**
* @member {Number} stopPriceOffset
*/
exports.prototype.stopPriceOffset = undefined;
/**
* @member {module:model/OrderGet.StopTypeEnum} stopType
*/
exports.prototype.stopType = undefined;
/**
* @member {String} tag
*/
exports.prototype.tag = undefined;
/**
* @member {module:model/OrderGet.TaxLotMethodEnum} taxLotMethod
*/
exports.prototype.taxLotMethod = undefined;
/**
* Allowed values for the <code>complexOrderStrategyType</code> property.
* @enum {String}
* @readonly
*/
exports.ComplexOrderStrategyTypeEnum = {
/**
* value: "NONE"
* @const
*/
NONE: "NONE",
/**
* value: "COVERED"
* @const
*/
COVERED: "COVERED",
/**
* value: "VERTICAL"
* @const
*/
VERTICAL: "VERTICAL",
/**
* value: "BACK_RATIO"
* @const
*/
BACK_RATIO: "BACK_RATIO",
/**
* value: "CALENDAR"
* @const
*/
CALENDAR: "CALENDAR",
/**
* value: "DIAGONAL"
* @const
*/
DIAGONAL: "DIAGONAL",
/**
* value: "STRADDLE"
* @const
*/
STRADDLE: "STRADDLE",
/**
* value: "STRANGLE"
* @const
*/
STRANGLE: "STRANGLE",
/**
* value: "COLLAR_SYNTHETIC"
* @const
*/
COLLAR_SYNTHETIC: "COLLAR_SYNTHETIC",
/**
* value: "BUTTERFLY"
* @const
*/
BUTTERFLY: "BUTTERFLY",
/**
* value: "CONDOR"
* @const
*/
CONDOR: "CONDOR",
/**
* value: "IRON_CONDOR"
* @const
*/
IRON_CONDOR: "IRON_CONDOR",
/**
* value: "VERTICAL_ROLL"
* @const
*/
VERTICAL_ROLL: "VERTICAL_ROLL",
/**
* value: "COLLAR_WITH_STOCK"
* @const
*/
COLLAR_WITH_STOCK: "COLLAR_WITH_STOCK",
/**
* value: "DOUBLE_DIAGONAL"
* @const
*/
DOUBLE_DIAGONAL: "DOUBLE_DIAGONAL",
/**
* value: "UNBALANCED_BUTTERFLY"
* @const
*/
UNBALANCED_BUTTERFLY: "UNBALANCED_BUTTERFLY",
/**
* value: "UNBALANCED_CONDOR"
* @const
*/
UNBALANCED_CONDOR: "UNBALANCED_CONDOR",
/**
* value: "UNBALANCED_IRON_CONDOR"
* @const
*/
UNBALANCED_IRON_CONDOR: "UNBALANCED_IRON_CONDOR",
/**
* value: "UNBALANCED_VERTICAL_ROLL"
* @const
*/
UNBALANCED_VERTICAL_ROLL: "UNBALANCED_VERTICAL_ROLL",
/**
* value: "CUSTOM"
* @const
*/
CUSTOM: "CUSTOM"
};
/**
* Allowed values for the <code>orderStrategyType</code> property.
* @enum {String}
* @readonly
*/
exports.OrderStrategyTypeEnum = {
/**
* value: "SINGLE"
* @const
*/
SINGLE: "SINGLE",
/**
* value: "OCO"
* @const
*/
OCO: "OCO",
/**
* value: "TRIGGER"
* @const
*/
TRIGGER: "TRIGGER"
};
/**
* Allowed values for the <code>priceLinkBasis</code> property.
* @enum {String}
* @readonly
*/
exports.PriceLinkBasisEnum = {
/**
* value: "MANUAL"
* @const
*/
MANUAL: "MANUAL",
/**
* value: "BASE"
* @const
*/
BASE: "BASE",
/**
* value: "TRIGGER"
* @const
*/
TRIGGER: "TRIGGER",
/**
* value: "LAST"
* @const
*/
LAST: "LAST",
/**
* value: "BID"
* @const
*/
BID: "BID",
/**
* value: "ASK"
* @const
*/
ASK: "ASK",
/**
* value: "ASK_BID"
* @const
*/
ASK_BID: "ASK_BID",
/**
* value: "MARK"
* @const
*/
MARK: "MARK",
/**
* value: "AVERAGE"
* @const
*/
AVERAGE: "AVERAGE"
};
/**
* Allowed values for the <code>priceLinkType</code> property.
* @enum {String}
* @readonly
*/
exports.PriceLinkTypeEnum = {
/**
* value: "VALUE"
* @const
*/
VALUE: "VALUE",
/**
* value: "PERCENT"
* @const
*/
PERCENT: "PERCENT",
/**
* value: "TICK"
* @const
*/
TICK: "TICK"
};
/**
* Allowed values for the <code>requestedDestination</code> property.
* @enum {String}
* @readonly
*/
exports.RequestedDestinationEnum = {
/**
* value: "INET"
* @const
*/
INET: "INET",
/**
* value: "ECN_ARCA"
* @const
*/
ECN_ARCA: "ECN_ARCA",
/**
* value: "CBOE"
* @const
*/
CBOE: "CBOE",
/**
* value: "AMEX"
* @const
*/
AMEX: "AMEX",
/**
* value: "PHLX"
* @const
*/
PHLX: "PHLX",
/**
* value: "ISE"
* @const
*/
ISE: "ISE",
/**
* value: "BOX"
* @const
*/
BOX: "BOX",
/**
* value: "NYSE"
* @const
*/
NYSE: "NYSE",
/**
* value: "NASDAQ"
* @const
*/
NASDAQ: "NASDAQ",
/**
* value: "BATS"
* @const
*/
BATS: "BATS",
/**
* value: "C2"
* @const
*/
C2: "C2",
/**
* value: "AUTO"
* @const
*/
AUTO: "AUTO"
};
/**
* Allowed values for the <code>specialInstruction</code> property.
* @enum {String}
* @readonly
*/
exports.SpecialInstructionEnum = {
/**
* value: "ALL_OR_NONE"
* @const
*/
ALL_OR_NONE: "ALL_OR_NONE",
/**
* value: "DO_NOT_REDUCE"
* @const
*/
DO_NOT_REDUCE: "DO_NOT_REDUCE",
/**
* value: "ALL_OR_NONE_DO_NOT_REDUCE"
* @const
*/
ALL_OR_NONE_DO_NOT_REDUCE: "ALL_OR_NONE_DO_NOT_REDUCE"
};
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
exports.StatusEnum = {
/**
* value: "AWAITING_PARENT_ORDER"
* @const
*/
AWAITING_PARENT_ORDER: "AWAITING_PARENT_ORDER",
/**
* value: "AWAITING_CONDITION"
* @const
*/
AWAITING_CONDITION: "AWAITING_CONDITION",
/**
* value: "AWAITING_MANUAL_REVIEW"
* @const
*/
AWAITING_MANUAL_REVIEW: "AWAITING_MANUAL_REVIEW",
/**
* value: "ACCEPTED"
* @const
*/
ACCEPTED: "ACCEPTED",
/**
* value: "AWAITING_UR_OUT"
* @const
*/
AWAITING_UR_OUT: "AWAITING_UR_OUT",
/**
* value: "PENDING_ACTIVATION"
* @const
*/
PENDING_ACTIVATION: "PENDING_ACTIVATION",
/**
* value: "QUEUED"
* @const
*/
QUEUED: "QUEUED",
/**
* value: "WORKING"
* @const
*/
WORKING: "WORKING",
/**
* value: "REJECTED"
* @const
*/
REJECTED: "REJECTED",
/**
* value: "PENDING_CANCEL"
* @const
*/
PENDING_CANCEL: "PENDING_CANCEL",
/**
* value: "CANCELED"
* @const
*/
CANCELED: "CANCELED",
/**
* value: "PENDING_REPLACE"
* @const
*/
PENDING_REPLACE: "PENDING_REPLACE",
/**
* value: "REPLACED"
* @const
*/
REPLACED: "REPLACED",
/**
* value: "FILLED"
* @const
*/
FILLED: "FILLED",
/**
* value: "EXPIRED"
* @const
*/
EXPIRED: "EXPIRED"
};
/**
* Allowed values for the <code>stopPriceLinkBasis</code> property.
* @enum {String}
* @readonly
*/
exports.StopPriceLinkBasisEnum = {
/**
* value: "MANUAL"
* @const
*/
MANUAL: "MANUAL",
/**
* value: "BASE"
* @const
*/
BASE: "BASE",
/**
* value: "TRIGGER"
* @const
*/
TRIGGER: "TRIGGER",
/**
* value: "LAST"
* @const
*/
LAST: "LAST",
/**
* value: "BID"
* @const
*/
BID: "BID",
/**
* value: "ASK"
* @const
*/
ASK: "ASK",
/**
* value: "ASK_BID"
* @const
*/
ASK_BID: "ASK_BID",
/**
* value: "MARK"
* @const
*/
MARK: "MARK",
/**
* value: "AVERAGE"
* @const
*/
AVERAGE: "AVERAGE"
};
/**
* Allowed values for the <code>stopPriceLinkType</code> property.
* @enum {String}
* @readonly
*/
exports.StopPriceLinkTypeEnum = {
/**
* value: "VALUE"
* @const
*/
VALUE: "VALUE",
/**
* value: "PERCENT"
* @const
*/
PERCENT: "PERCENT",
/**
* value: "TICK"
* @const
*/
TICK: "TICK"
};
/**
* Allowed values for the <code>stopType</code> property.
* @enum {String}
* @readonly
*/
exports.StopTypeEnum = {
/**
* value: "STANDARD"
* @const
*/
STANDARD: "STANDARD",
/**
* value: "BID"
* @const
*/
BID: "BID",
/**
* value: "ASK"
* @const
*/
ASK: "ASK",
/**
* value: "LAST"
* @const
*/
LAST: "LAST",
/**
* value: "MARK"
* @const
*/
MARK: "MARK"
};
/**
* Allowed values for the <code>taxLotMethod</code> property.
* @enum {String}
* @readonly
*/
exports.TaxLotMethodEnum = {
/**
* value: "FIFO"
* @const
*/
FIFO: "FIFO",
/**
* value: "LIFO"
* @const
*/
LIFO: "LIFO",
/**
* value: "HIGH_COST"
* @const
*/
HIGH_COST: "HIGH_COST",
/**
* value: "LOW_COST"
* @const
*/
LOW_COST: "LOW_COST",
/**
* value: "AVERAGE_COST"
* @const
*/
AVERAGE_COST: "AVERAGE_COST",
/**
* value: "SPECIFIC_LOT"
* @const
*/
SPECIFIC_LOT: "SPECIFIC_LOT"
};
return exports;
}));