UNPKG

@gitchrisqueen/tdameritrade-api-js-client

Version:
145 lines (126 loc) 4.11 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/WatchListInstrument'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./WatchListInstrument')); } else { // Browser globals (root is window) if (!root.GitChrisQueen_TDA_JS) { root.GitChrisQueen_TDA_JS = {}; } root.GitChrisQueen_TDA_JS.WatchListWatchlistItems = factory(root.GitChrisQueen_TDA_JS.ApiClient, root.GitChrisQueen_TDA_JS.WatchListInstrument); } }(this, function(ApiClient, WatchListInstrument) { 'use strict'; /** * The WatchListWatchlistItems model module. * @module model/WatchListWatchlistItems * @version 0.1.4 */ /** * Constructs a new <code>WatchListWatchlistItems</code>. * @alias module:model/WatchListWatchlistItems * @class */ var exports = function() { }; /** * Constructs a <code>WatchListWatchlistItems</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/WatchListWatchlistItems} obj Optional instance to populate. * @return {module:model/WatchListWatchlistItems} The populated <code>WatchListWatchlistItems</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('averagePrice')) obj.averagePrice = ApiClient.convertToType(data['averagePrice'], 'Number'); if (data.hasOwnProperty('commission')) obj.commission = ApiClient.convertToType(data['commission'], 'Number'); if (data.hasOwnProperty('instrument')) obj.instrument = WatchListInstrument.constructFromObject(data['instrument']); if (data.hasOwnProperty('purchasedDate')) obj.purchasedDate = ApiClient.convertToType(data['purchasedDate'], Object); if (data.hasOwnProperty('quantity')) obj.quantity = ApiClient.convertToType(data['quantity'], 'Number'); if (data.hasOwnProperty('sequenceId')) obj.sequenceId = ApiClient.convertToType(data['sequenceId'], 'Number'); if (data.hasOwnProperty('status')) obj.status = ApiClient.convertToType(data['status'], 'String'); } return obj; } /** * @member {Number} averagePrice */ exports.prototype.averagePrice = undefined; /** * @member {Number} commission */ exports.prototype.commission = undefined; /** * @member {module:model/WatchListInstrument} instrument */ exports.prototype.instrument = undefined; /** * @member {Object} purchasedDate */ exports.prototype.purchasedDate = undefined; /** * @member {Number} quantity */ exports.prototype.quantity = undefined; /** * @member {Number} sequenceId */ exports.prototype.sequenceId = undefined; /** * @member {module:model/WatchListWatchlistItems.StatusEnum} status */ exports.prototype.status = undefined; /** * Allowed values for the <code>status</code> property. * @enum {String} * @readonly */ exports.StatusEnum = { /** * value: "UNCHANGED" * @const */ UNCHANGED: "UNCHANGED", /** * value: "CREATED" * @const */ CREATED: "CREATED", /** * value: "UPDATED" * @const */ UPDATED: "UPDATED", /** * value: "DELETED" * @const */ DELETED: "DELETED" }; return exports; }));