UNPKG

@gitchrisqueen/tdameritrade-api-js-client

Version:
85 lines (73 loc) 2.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 * Do not edit the class manually. * */ import ApiClient from "../ApiClient"; import ErrorObject from '../model/ErrorObject'; import Mover from '../model/Mover'; /** * Movers service. * @module api/MoversApi * @version 0.1.4 */ export default class MoversApi { /** * Constructs a new MoversApi. * @alias module:api/MoversApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient) { this.apiClient = apiClient || ApiClient.instance; } /** * Get price history for a symbol * @param {Object} opts Optional parameters * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Mover} and HTTP response */ marketdataIndexMoversGETWithHttpInfo(index, opts) { opts = opts || {}; let postBody = null; let pathParams = { 'index': index }; let queryParams = { 'apikey': opts['apikey'], 'direction': opts['direction'], 'change': opts['change'] }; let headerParams = { }; let formParams = { }; let authNames = ['bearerAuth']; let contentTypes = []; let accepts = ['application/json']; let returnType = Mover; return this.apiClient.callApi( '/marketdata/{index}/movers', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType ); } /** * Get price history for a symbol * @param {Object} opts Optional parameters * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Mover} */ marketdataIndexMoversGET(index, opts) { return this.marketdataIndexMoversGETWithHttpInfo(index, opts) .then(function(response_and_data) { return response_and_data.data; }); } }