kucoin-universal-sdk
Version:
Official KuCoin Universal SDK.
101 lines • 2.81 kB
JavaScript
;
// Code generated by Kucoin Universal SDK Generator; DO NOT EDIT.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModifyOrderReqBuilder = exports.ModifyOrderReq = void 0;
const class_transformer_1 = require("class-transformer");
class ModifyOrderReq {
/**
* Private constructor, please use the corresponding static methods to construct the object.
*/
constructor() {
// @ts-ignore
this.symbol = null;
}
/**
* Creates a new instance of the `ModifyOrderReq` class.
* The builder pattern allows step-by-step construction of a `ModifyOrderReq` object.
*/
static builder() {
return new ModifyOrderReqBuilder(new ModifyOrderReq());
}
/**
* Creates a new instance of the `ModifyOrderReq` class with the given data.
*/
static create(data) {
let obj = new ModifyOrderReq();
obj.clientOid = data.clientOid;
obj.symbol = data.symbol;
obj.orderId = data.orderId;
obj.newPrice = data.newPrice;
obj.newSize = data.newSize;
return obj;
}
/**
* Convert the object to a JSON string.
*/
toJson() {
return JSON.stringify((0, class_transformer_1.instanceToPlain)(this));
}
/**
* Create an object from a JSON string.
*/
static fromJson(input) {
return this.fromObject(JSON.parse(input));
}
/**
* Create an object from Js Object.
*/
static fromObject(jsonObject) {
return (0, class_transformer_1.plainToClassFromExist)(new ModifyOrderReq(), jsonObject);
}
}
exports.ModifyOrderReq = ModifyOrderReq;
class ModifyOrderReqBuilder {
constructor(obj) {
this.obj = obj;
this.obj = obj;
}
/**
* One must be chose out of the old client order ID, orderId and clientOid
*/
setClientOid(value) {
this.obj.clientOid = value;
return this;
}
/**
* symbol
*/
setSymbol(value) {
this.obj.symbol = value;
return this;
}
/**
* One must be chosen out of the old order id, orderId and clientOid
*/
setOrderId(value) {
this.obj.orderId = value;
return this;
}
/**
* One must be chosen out of the modified price of the new order, newPrice and newSize
*/
setNewPrice(value) {
this.obj.newPrice = value;
return this;
}
/**
* One must be chosen out of the modified size of the new order, newPrice and newSize
*/
setNewSize(value) {
this.obj.newSize = value;
return this;
}
/**
* Get the final object.
*/
build() {
return this.obj;
}
}
exports.ModifyOrderReqBuilder = ModifyOrderReqBuilder;
//# sourceMappingURL=model_modify_order_req.js.map