UNPKG

upstox-js-sdk

Version:

The official Node Js client for communicating with the Upstox API

95 lines (86 loc) 3.04 kB
/* * 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. * */ import {ApiClient} from '../ApiClient'; /** * The Instrument model module. * @module model/Instrument * @version v0 */ export class Instrument { /** * Constructs a new <code>Instrument</code>. * instruments * @alias module:model/Instrument * @class * @param instrumentKey {String} Instrument Key of the Instrument * @param quantity {Number} Quantity of the instrument to buy or sell for margin calculation * @param product {String} Product with which the order is to be placed * @param transactionType {String} Indicates whether its a BUY or SELL order */ constructor(instrumentKey, quantity, product, transactionType) { this.instrument_key = instrumentKey; this.quantity = quantity; this.product = product; this.transaction_type = transactionType; } /** * Constructs a <code>Instrument</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/Instrument} obj Optional instance to populate. * @return {module:model/Instrument} The populated <code>Instrument</code> instance. */ static constructFromObject(data, obj) { if (data) { obj = obj || new Instrument(); if (data.hasOwnProperty('instrument_key')) obj.instrumentKey = ApiClient.convertToType(data['instrument_key'], 'String'); if (data.hasOwnProperty('quantity')) obj.quantity = ApiClient.convertToType(data['quantity'], 'Number'); if (data.hasOwnProperty('product')) obj.product = ApiClient.convertToType(data['product'], 'String'); if (data.hasOwnProperty('transaction_type')) obj.transactionType = ApiClient.convertToType(data['transaction_type'], 'String'); if (data.hasOwnProperty('price')) obj.price = ApiClient.convertToType(data['price'], 'Number'); } return obj; } } /** * Instrument Key of the Instrument * @member {String} instrumentKey */ Instrument.prototype.instrument_key = undefined; /** * Quantity of the instrument to buy or sell for margin calculation * @member {Number} quantity */ Instrument.prototype.quantity = undefined; /** * Product with which the order is to be placed * @member {String} product */ Instrument.prototype.product = undefined; /** * Indicates whether its a BUY or SELL order * @member {String} transactionType */ Instrument.prototype.transaction_type = undefined; /** * price * @member {Number} price */ Instrument.prototype.price = undefined;