UNPKG

@gitchrisqueen/tdameritrade-api-js-client

Version:
277 lines (237 loc) 6.3 kB
/* * 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/OrderGetInstrument'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./OrderGetInstrument')); } else { // Browser globals (root is window) if (!root.GitChrisQueen_TDA_JS) { root.GitChrisQueen_TDA_JS = {}; } root.GitChrisQueen_TDA_JS.OrderGetOrderLegCollection = factory(root.GitChrisQueen_TDA_JS.ApiClient, root.GitChrisQueen_TDA_JS.OrderGetInstrument); } }(this, function(ApiClient, OrderGetInstrument) { 'use strict'; /** * The OrderGetOrderLegCollection model module. * @module model/OrderGetOrderLegCollection * @version 0.1.4 */ /** * Constructs a new <code>OrderGetOrderLegCollection</code>. * @alias module:model/OrderGetOrderLegCollection * @class */ var exports = function() { }; /** * Constructs a <code>OrderGetOrderLegCollection</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/OrderGetOrderLegCollection} obj Optional instance to populate. * @return {module:model/OrderGetOrderLegCollection} The populated <code>OrderGetOrderLegCollection</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('instruction')) obj.instruction = ApiClient.convertToType(data['instruction'], 'String'); if (data.hasOwnProperty('instrument')) obj.instrument = OrderGetInstrument.constructFromObject(data['instrument']); if (data.hasOwnProperty('legId')) obj.legId = ApiClient.convertToType(data['legId'], 'Number'); if (data.hasOwnProperty('orderLegType')) obj.orderLegType = ApiClient.convertToType(data['orderLegType'], 'String'); if (data.hasOwnProperty('positionEffect')) obj.positionEffect = ApiClient.convertToType(data['positionEffect'], 'String'); if (data.hasOwnProperty('quantity')) obj.quantity = ApiClient.convertToType(data['quantity'], 'Number'); if (data.hasOwnProperty('quantityType')) obj.quantityType = ApiClient.convertToType(data['quantityType'], 'String'); } return obj; } /** * @member {module:model/OrderGetOrderLegCollection.InstructionEnum} instruction */ exports.prototype.instruction = undefined; /** * @member {module:model/OrderGetInstrument} instrument */ exports.prototype.instrument = undefined; /** * @member {Number} legId */ exports.prototype.legId = undefined; /** * @member {module:model/OrderGetOrderLegCollection.OrderLegTypeEnum} orderLegType */ exports.prototype.orderLegType = undefined; /** * @member {module:model/OrderGetOrderLegCollection.PositionEffectEnum} positionEffect */ exports.prototype.positionEffect = undefined; /** * @member {Number} quantity */ exports.prototype.quantity = undefined; /** * @member {module:model/OrderGetOrderLegCollection.QuantityTypeEnum} quantityType */ exports.prototype.quantityType = undefined; /** * Allowed values for the <code>instruction</code> property. * @enum {String} * @readonly */ exports.InstructionEnum = { /** * 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: "BUY_TO_OPEN" * @const */ BUY_TO_OPEN: "BUY_TO_OPEN", /** * value: "BUY_TO_CLOSE" * @const */ BUY_TO_CLOSE: "BUY_TO_CLOSE", /** * value: "SELL_TO_OPEN" * @const */ SELL_TO_OPEN: "SELL_TO_OPEN", /** * value: "SELL_TO_CLOSE" * @const */ SELL_TO_CLOSE: "SELL_TO_CLOSE", /** * value: "EXCHANGE" * @const */ EXCHANGE: "EXCHANGE" }; /** * Allowed values for the <code>orderLegType</code> property. * @enum {String} * @readonly */ exports.OrderLegTypeEnum = { /** * value: "EQUITY" * @const */ EQUITY: "EQUITY", /** * value: "OPTION" * @const */ OPTION: "OPTION", /** * value: "INDEX" * @const */ INDEX: "INDEX", /** * value: "MUTUAL_FUND" * @const */ MUTUAL_FUND: "MUTUAL_FUND", /** * value: "CASH_EQUIVALENT" * @const */ CASH_EQUIVALENT: "CASH_EQUIVALENT", /** * value: "FIXED_INCOME" * @const */ FIXED_INCOME: "FIXED_INCOME", /** * value: "CURRENCY" * @const */ CURRENCY: "CURRENCY" }; /** * Allowed values for the <code>positionEffect</code> property. * @enum {String} * @readonly */ exports.PositionEffectEnum = { /** * value: "OPENING" * @const */ OPENING: "OPENING", /** * value: "CLOSING" * @const */ CLOSING: "CLOSING", /** * value: "AUTOMATIC" * @const */ AUTOMATIC: "AUTOMATIC" }; /** * Allowed values for the <code>quantityType</code> property. * @enum {String} * @readonly */ exports.QuantityTypeEnum = { /** * value: "ALL_SHARES" * @const */ ALL_SHARES: "ALL_SHARES", /** * value: "DOLLARS" * @const */ DOLLARS: "DOLLARS", /** * value: "SHARES" * @const */ SHARES: "SHARES" }; return exports; }));