UNPKG

@gitchrisqueen/tdameritrade-api-js-client

Version:
173 lines (150 loc) 4.97 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/TransactionTransactionItemInstrument'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./TransactionTransactionItemInstrument')); } else { // Browser globals (root is window) if (!root.GitChrisQueen_TDA_JS) { root.GitChrisQueen_TDA_JS = {}; } root.GitChrisQueen_TDA_JS.TransactionTransactionItem = factory(root.GitChrisQueen_TDA_JS.ApiClient, root.GitChrisQueen_TDA_JS.TransactionTransactionItemInstrument); } }(this, function(ApiClient, TransactionTransactionItemInstrument) { 'use strict'; /** * The TransactionTransactionItem model module. * @module model/TransactionTransactionItem * @version 0.1.4 */ /** * Constructs a new <code>TransactionTransactionItem</code>. * @alias module:model/TransactionTransactionItem * @class */ var exports = function() { }; /** * Constructs a <code>TransactionTransactionItem</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/TransactionTransactionItem} obj Optional instance to populate. * @return {module:model/TransactionTransactionItem} The populated <code>TransactionTransactionItem</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('amount')) obj.amount = ApiClient.convertToType(data['amount'], 'Number'); if (data.hasOwnProperty('cost')) obj.cost = ApiClient.convertToType(data['cost'], 'Number'); if (data.hasOwnProperty('instruction')) obj.instruction = ApiClient.convertToType(data['instruction'], 'String'); if (data.hasOwnProperty('instrument')) obj.instrument = TransactionTransactionItemInstrument.constructFromObject(data['instrument']); if (data.hasOwnProperty('parentChildIndicator')) obj.parentChildIndicator = ApiClient.convertToType(data['parentChildIndicator'], 'String'); if (data.hasOwnProperty('parentOrderKey')) obj.parentOrderKey = ApiClient.convertToType(data['parentOrderKey'], 'Number'); if (data.hasOwnProperty('positionEffect')) obj.positionEffect = ApiClient.convertToType(data['positionEffect'], 'String'); if (data.hasOwnProperty('price')) obj.price = ApiClient.convertToType(data['price'], 'Number'); } return obj; } /** * @member {Number} accountId */ exports.prototype.accountId = undefined; /** * @member {Number} amount */ exports.prototype.amount = undefined; /** * @member {Number} cost */ exports.prototype.cost = undefined; /** * @member {module:model/TransactionTransactionItem.InstructionEnum} instruction */ exports.prototype.instruction = undefined; /** * @member {module:model/TransactionTransactionItemInstrument} instrument */ exports.prototype.instrument = undefined; /** * @member {String} parentChildIndicator */ exports.prototype.parentChildIndicator = undefined; /** * @member {Number} parentOrderKey */ exports.prototype.parentOrderKey = undefined; /** * @member {module:model/TransactionTransactionItem.PositionEffectEnum} positionEffect */ exports.prototype.positionEffect = undefined; /** * @member {Number} price */ exports.prototype.price = undefined; /** * Allowed values for the <code>instruction</code> property. * @enum {String} * @readonly */ exports.InstructionEnum = { /** * value: "BUY" * @const */ BUY: "BUY", /** * value: "SELL" * @const */ SELL: "SELL" }; /** * 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" }; return exports; }));