upstox-js-sdk
Version:
The official Node Js client for communicating with the Upstox API
105 lines (96 loc) • 3.48 kB
JavaScript
/*
* 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.66
*
* Do not edit the class manually.
*
*/
import {ApiClient} from '../ApiClient';
import {GttRule} from './GttRule';
/**
* The GttModifyOrderRequest model module.
* @module model/GttModifyOrderRequest
* @version v0
*/
export class GttModifyOrderRequest {
/**
* Constructs a new <code>GttModifyOrderRequest</code>.
* @alias module:model/GttModifyOrderRequest
* @class
* @param type {module:model/GttModifyOrderRequest.TypeEnum} Type of GTT order. It can be one of the following: SINGLE refers to a single-leg GTT order MULTIPLE refers to a multi-leg GTT order
* @param quantity {Number} Quantity with which the order is to be placed
* @param rules {Array.<module:model/GttRule>} List of rules defining the conditions for each leg in the GTT order
* @param gttOrderId {String} Unique identifier of the GTT order to be modified
*/
constructor(type, quantity, rules, gttOrderId) {
this.type = type;
this.quantity = quantity;
this.rules = rules;
this.gttOrderId = gttOrderId;
}
/**
* Constructs a <code>GttModifyOrderRequest</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/GttModifyOrderRequest} obj Optional instance to populate.
* @return {module:model/GttModifyOrderRequest} The populated <code>GttModifyOrderRequest</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new GttModifyOrderRequest();
if (data.hasOwnProperty('type'))
obj.type = ApiClient.convertToType(data['type'], 'String');
if (data.hasOwnProperty('quantity'))
obj.quantity = ApiClient.convertToType(data['quantity'], 'Number');
if (data.hasOwnProperty('rules'))
obj.rules = ApiClient.convertToType(data['rules'], [GttRule]);
if (data.hasOwnProperty('gtt_order_id'))
obj.gttOrderId = ApiClient.convertToType(data['gtt_order_id'], 'String');
}
return obj;
}
}
/**
* Allowed values for the <code>type</code> property.
* @enum {String}
* @readonly
*/
GttModifyOrderRequest.TypeEnum = {
/**
* value: "SINGLE"
* @const
*/
SINGLE: "SINGLE",
/**
* value: "MULTIPLE"
* @const
*/
MULTIPLE: "MULTIPLE"
};
/**
* Type of GTT order. It can be one of the following: SINGLE refers to a single-leg GTT order MULTIPLE refers to a multi-leg GTT order
* @member {module:model/GttModifyOrderRequest.TypeEnum} type
*/
GttModifyOrderRequest.prototype.type = undefined;
/**
* Quantity with which the order is to be placed
* @member {Number} quantity
*/
GttModifyOrderRequest.prototype.quantity = undefined;
/**
* List of rules defining the conditions for each leg in the GTT order
* @member {Array.<module:model/GttRule>} rules
*/
GttModifyOrderRequest.prototype.rules = undefined;
/**
* Unique identifier of the GTT order to be modified
* @member {String} gttOrderId
*/
GttModifyOrderRequest.prototype.gttOrderId = undefined;