UNPKG

upstox-js-sdk

Version:

The official Node Js client for communicating with the Upstox API

171 lines (164 loc) 7.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MarketHolidaysAndTimingsApi = void 0; var _ApiClient = require("../ApiClient"); var _ApiGatewayErrorResponse = require("../model/ApiGatewayErrorResponse"); var _GetExchangeTimingResponse = require("../model/GetExchangeTimingResponse"); var _GetHolidayResponse = require("../model/GetHolidayResponse"); var _GetMarketStatusResponse = require("../model/GetMarketStatusResponse"); /* * OpenAPI definition * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: v0 * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * * Swagger Codegen version: 3.0.54 * * Do not edit the class manually. * */ /** * MarketHolidaysAndTimings service. * @module api/MarketHolidaysAndTimingsApi * @version v0 */ class MarketHolidaysAndTimingsApi { /** * Constructs a new MarketHolidaysAndTimingsApi. * @alias module:api/MarketHolidaysAndTimingsApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instanc e} if unspecified. */ constructor(apiClient) { this.apiClient = apiClient || _ApiClient.ApiClient.instance; } /** * Callback function to receive the result of the getExchangeTimings operation. * @callback moduleapi/MarketHolidaysAndTimingsApi~getExchangeTimingsCallback * @param {String} error Error message, if any. * @param {module:model/GetExchangeTimingResponse{ data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get Exchange Timings on particular date * This API provides the functionality to retrieve the exchange timings on particular date * @param {String} _date * @param {module:api/MarketHolidaysAndTimingsApi~getExchangeTimingsCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} */ getExchangeTimings(_date, callback) { let postBody = null; // verify the required parameter '_date' is set if (_date === undefined || _date === null) { throw new Error("Missing the required parameter '_date' when calling getExchangeTimings"); } let pathParams = { 'date': _date }; let queryParams = {}; let headerParams = {}; let formParams = {}; let authNames = []; let contentTypes = []; let accepts = ['application/json', '*/*']; let returnType = _GetExchangeTimingResponse.GetExchangeTimingResponse; return this.apiClient.callApi('/v2/market/timings/{date}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback); } /** * Callback function to receive the result of the getHoliday operation. * @callback moduleapi/MarketHolidaysAndTimingsApi~getHolidayCallback * @param {String} error Error message, if any. * @param {module:model/GetHolidayResponse{ data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get Holiday on particular date * This API provides the functionality to retrieve the holiday on particular date * @param {String} _date * @param {module:api/MarketHolidaysAndTimingsApi~getHolidayCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} */ getHoliday(_date, callback) { let postBody = null; // verify the required parameter '_date' is set if (_date === undefined || _date === null) { throw new Error("Missing the required parameter '_date' when calling getHoliday"); } let pathParams = { 'date': _date }; let queryParams = {}; let headerParams = {}; let formParams = {}; let authNames = []; let contentTypes = []; let accepts = ['application/json', '*/*']; let returnType = _GetHolidayResponse.GetHolidayResponse; return this.apiClient.callApi('/v2/market/holidays/{date}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback); } /** * Callback function to receive the result of the getHolidays operation. * @callback moduleapi/MarketHolidaysAndTimingsApi~getHolidaysCallback * @param {String} error Error message, if any. * @param {module:model/GetHolidayResponse{ data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get Holiday list of current year * This API provides the functionality to retrieve the holiday list of current year * @param {module:api/MarketHolidaysAndTimingsApi~getHolidaysCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} */ getHolidays(callback) { let postBody = null; let pathParams = {}; let queryParams = {}; let headerParams = {}; let formParams = {}; let authNames = []; let contentTypes = []; let accepts = ['application/json', '*/*']; let returnType = _GetHolidayResponse.GetHolidayResponse; return this.apiClient.callApi('/v2/market/holidays', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback); } /** * Callback function to receive the result of the getMarketStatus operation. * @callback moduleapi/MarketHolidaysAndTimingsApi~getMarketStatusCallback * @param {String} error Error message, if any. * @param {module:model/GetMarketStatusResponse{ data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Get Market status for particular exchange * This API provides the functionality to retrieve the market status for particular exchange * @param {String} exchange * @param {module:api/MarketHolidaysAndTimingsApi~getMarketStatusCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link <&vendorExtensions.x-jsdoc-type>} */ getMarketStatus(exchange, callback) { let postBody = null; // verify the required parameter 'exchange' is set if (exchange === undefined || exchange === null) { throw new Error("Missing the required parameter 'exchange' when calling getMarketStatus"); } let pathParams = { 'exchange': exchange }; let queryParams = {}; let headerParams = {}; let formParams = {}; let authNames = ['OAUTH2']; let contentTypes = []; let accepts = ['application/json', '*/*']; let returnType = _GetMarketStatusResponse.GetMarketStatusResponse; return this.apiClient.callApi('/v2/market/status/{exchange}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback); } } exports.MarketHolidaysAndTimingsApi = MarketHolidaysAndTimingsApi;