UNPKG

kucoin-universal-sdk

Version:
92 lines 3.05 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchSwitchMarginModeReqBuilder = exports.BatchSwitchMarginModeReq = void 0; const class_transformer_1 = require("class-transformer"); class BatchSwitchMarginModeReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { // @ts-ignore this.marginMode = null; // @ts-ignore this.symbols = null; } /** * Creates a new instance of the `BatchSwitchMarginModeReq` class. * The builder pattern allows step-by-step construction of a `BatchSwitchMarginModeReq` object. */ static builder() { return new BatchSwitchMarginModeReqBuilder(new BatchSwitchMarginModeReq()); } /** * Creates a new instance of the `BatchSwitchMarginModeReq` class with the given data. */ static create(data) { let obj = new BatchSwitchMarginModeReq(); obj.marginMode = data.marginMode; obj.symbols = data.symbols; 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 BatchSwitchMarginModeReq(), jsonObject); } } exports.BatchSwitchMarginModeReq = BatchSwitchMarginModeReq; (function (BatchSwitchMarginModeReq) { let MarginModeEnum; (function (MarginModeEnum) { /** * Isolated Margin Mode */ MarginModeEnum[MarginModeEnum["ISOLATED"] = 'ISOLATED'] = "ISOLATED"; /** * Cross Margin MOde */ MarginModeEnum[MarginModeEnum["CROSS"] = 'CROSS'] = "CROSS"; })(MarginModeEnum = BatchSwitchMarginModeReq.MarginModeEnum || (BatchSwitchMarginModeReq.MarginModeEnum = {})); })(BatchSwitchMarginModeReq || (exports.BatchSwitchMarginModeReq = BatchSwitchMarginModeReq = {})); class BatchSwitchMarginModeReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * Modified margin model: ISOLATED (isolated), CROSS (cross margin). */ setMarginMode(value) { this.obj.marginMode = value; return this; } /** * Symbol list of the contract, Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-3470220) */ setSymbols(value) { this.obj.symbols = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.BatchSwitchMarginModeReqBuilder = BatchSwitchMarginModeReqBuilder; //# sourceMappingURL=model_batch_switch_margin_mode_req.js.map