UNPKG

@gitchrisqueen/tdameritrade-api-js-client

Version:
156 lines (136 loc) 5.33 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/CashAccountCurrentBalances', 'model/CashAccountInitialBalances', 'model/MarginAccountOrderStrategies', 'model/MarginAccountPositions'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('./CashAccountCurrentBalances'), require('./CashAccountInitialBalances'), require('./MarginAccountOrderStrategies'), require('./MarginAccountPositions')); } else { // Browser globals (root is window) if (!root.GitChrisQueen_TDA_JS) { root.GitChrisQueen_TDA_JS = {}; } root.GitChrisQueen_TDA_JS.CashAccount = factory(root.GitChrisQueen_TDA_JS.ApiClient, root.GitChrisQueen_TDA_JS.CashAccountCurrentBalances, root.GitChrisQueen_TDA_JS.CashAccountInitialBalances, root.GitChrisQueen_TDA_JS.MarginAccountOrderStrategies, root.GitChrisQueen_TDA_JS.MarginAccountPositions); } }(this, function(ApiClient, CashAccountCurrentBalances, CashAccountInitialBalances, MarginAccountOrderStrategies, MarginAccountPositions) { 'use strict'; /** * The CashAccount model module. * @module model/CashAccount * @version 0.1.4 */ /** * Constructs a new <code>CashAccount</code>. * @alias module:model/CashAccount * @class */ var exports = function() { }; /** * Constructs a <code>CashAccount</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/CashAccount} obj Optional instance to populate. * @return {module:model/CashAccount} The populated <code>CashAccount</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('accountId')) obj.accountId = ApiClient.convertToType(data['accountId'], 'String'); if (data.hasOwnProperty('currentBalances')) obj.currentBalances = CashAccountCurrentBalances.constructFromObject(data['currentBalances']); if (data.hasOwnProperty('initialBalances')) obj.initialBalances = CashAccountInitialBalances.constructFromObject(data['initialBalances']); if (data.hasOwnProperty('isClosingOnlyRestricted')) obj.isClosingOnlyRestricted = ApiClient.convertToType(data['isClosingOnlyRestricted'], 'Boolean'); if (data.hasOwnProperty('isDayTrader')) obj.isDayTrader = ApiClient.convertToType(data['isDayTrader'], 'Boolean'); if (data.hasOwnProperty('orderStrategies')) obj.orderStrategies = MarginAccountOrderStrategies.constructFromObject(data['orderStrategies']); if (data.hasOwnProperty('positions')) obj.positions = MarginAccountPositions.constructFromObject(data['positions']); if (data.hasOwnProperty('projectedBalances')) obj.projectedBalances = CashAccountCurrentBalances.constructFromObject(data['projectedBalances']); if (data.hasOwnProperty('roundTrips')) obj.roundTrips = ApiClient.convertToType(data['roundTrips'], 'Number'); if (data.hasOwnProperty('type')) obj.type = ApiClient.convertToType(data['type'], 'String'); } return obj; } /** * @member {String} accountId */ exports.prototype.accountId = undefined; /** * @member {module:model/CashAccountCurrentBalances} currentBalances */ exports.prototype.currentBalances = undefined; /** * @member {module:model/CashAccountInitialBalances} initialBalances */ exports.prototype.initialBalances = undefined; /** * @member {Boolean} isClosingOnlyRestricted * @default false */ exports.prototype.isClosingOnlyRestricted = false; /** * @member {Boolean} isDayTrader * @default false */ exports.prototype.isDayTrader = false; /** * @member {module:model/MarginAccountOrderStrategies} orderStrategies */ exports.prototype.orderStrategies = undefined; /** * @member {module:model/MarginAccountPositions} positions */ exports.prototype.positions = undefined; /** * @member {module:model/CashAccountCurrentBalances} projectedBalances */ exports.prototype.projectedBalances = undefined; /** * @member {Number} roundTrips */ exports.prototype.roundTrips = undefined; /** * @member {module:model/CashAccount.TypeEnum} type */ exports.prototype.type = undefined; /** * Allowed values for the <code>type</code> property. * @enum {String} * @readonly */ exports.TypeEnum = { /** * value: "CASH" * @const */ CASH: "CASH", /** * value: "MARGIN" * @const */ MARGIN: "MARGIN" }; return exports; }));