UNPKG

@gitchrisqueen/tdameritrade-api-js-client

Version:
148 lines (133 loc) 4.66 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 * Do not edit the class manually. * */ import ApiClient from '../ApiClient'; import OptionChainStrategy from './OptionChainStrategy'; import OptionChainUnderlying from './OptionChainUnderlying'; /** * The OptionChain model module. * @module model/OptionChain * @version 0.1.4 */ export default class OptionChain { /** * Constructs a new <code>OptionChain</code>. * @alias module:model/OptionChain * @class */ constructor() { } /** * Constructs a <code>OptionChain</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/OptionChain} obj Optional instance to populate. * @return {module:model/OptionChain} The populated <code>OptionChain</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new OptionChain(); if (data.hasOwnProperty('symbol')) { obj['symbol'] = ApiClient.convertToType(data['symbol'], 'String'); } if (data.hasOwnProperty('status')) { obj['status'] = ApiClient.convertToType(data['status'], 'String'); } if (data.hasOwnProperty('underlying')) { obj['underlying'] = OptionChainUnderlying.constructFromObject(data['underlying']); } if (data.hasOwnProperty('strategy')) { obj['strategy'] = OptionChainStrategy.constructFromObject(data['strategy']); } if (data.hasOwnProperty('interval')) { obj['interval'] = ApiClient.convertToType(data['interval'], 'Number'); } if (data.hasOwnProperty('isDelayed')) { obj['isDelayed'] = ApiClient.convertToType(data['isDelayed'], 'Boolean'); } if (data.hasOwnProperty('isIndex')) { obj['isIndex'] = ApiClient.convertToType(data['isIndex'], 'Boolean'); } if (data.hasOwnProperty('daysToExpiration')) { obj['daysToExpiration'] = ApiClient.convertToType(data['daysToExpiration'], 'Number'); } if (data.hasOwnProperty('interestRate')) { obj['interestRate'] = ApiClient.convertToType(data['interestRate'], 'Number'); } if (data.hasOwnProperty('underlyingPrice')) { obj['underlyingPrice'] = ApiClient.convertToType(data['underlyingPrice'], 'Number'); } if (data.hasOwnProperty('volatility')) { obj['volatility'] = ApiClient.convertToType(data['volatility'], 'Number'); } if (data.hasOwnProperty('callExpDateMap')) { obj['callExpDateMap'] = ApiClient.convertToType(data['callExpDateMap'], {'String': Object}); } if (data.hasOwnProperty('putExpDateMap')) { obj['putExpDateMap'] = ApiClient.convertToType(data['putExpDateMap'], {'String': Object}); } } return obj; } /** * @member {String} symbol */ 'symbol' = undefined; /** * @member {String} status */ 'status' = undefined; /** * @member {module:model/OptionChainUnderlying} underlying */ 'underlying' = undefined; /** * @member {module:model/OptionChainStrategy} strategy */ 'strategy' = undefined; /** * @member {Number} interval */ 'interval' = undefined; /** * @member {Boolean} isDelayed */ 'isDelayed' = undefined; /** * @member {Boolean} isIndex */ 'isIndex' = undefined; /** * @member {Number} daysToExpiration */ 'daysToExpiration' = undefined; /** * @member {Number} interestRate */ 'interestRate' = undefined; /** * @member {Number} underlyingPrice */ 'underlyingPrice' = undefined; /** * @member {Number} volatility */ 'volatility' = undefined; /** * @member {Object.<String, Object>} callExpDateMap */ 'callExpDateMap' = undefined; /** * @member {Object.<String, Object>} putExpDateMap */ 'putExpDateMap' = undefined; }