UNPKG

kucoin-universal-sdk

Version:
142 lines 4.41 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.GetPremiumIndexReqBuilder = exports.GetPremiumIndexReq = void 0; const class_transformer_1 = require("class-transformer"); class GetPremiumIndexReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * This parameter functions to judge whether the lookup is reversed. True means “yes”. False means “no”. This parameter is set as True by default. */ this.reverse = true; /** * This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default. */ this.forward = true; /** * Max. record count. The default record count is 10; the maximum length cannot exceed 100 */ this.maxCount = 10; } /** * Creates a new instance of the `GetPremiumIndexReq` class. * The builder pattern allows step-by-step construction of a `GetPremiumIndexReq` object. */ static builder() { return new GetPremiumIndexReqBuilder(new GetPremiumIndexReq()); } /** * Creates a new instance of the `GetPremiumIndexReq` class with the given data. */ static create(data) { let obj = new GetPremiumIndexReq(); obj.symbol = data.symbol; obj.startAt = data.startAt; obj.endAt = data.endAt; if (data.reverse) { obj.reverse = data.reverse; } else { obj.reverse = true; } obj.offset = data.offset; if (data.forward) { obj.forward = data.forward; } else { obj.forward = true; } if (data.maxCount) { obj.maxCount = data.maxCount; } else { obj.maxCount = 10; } 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 GetPremiumIndexReq(), jsonObject); } } exports.GetPremiumIndexReq = GetPremiumIndexReq; class GetPremiumIndexReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * Symbol of the contract. Please refer to [Get Symbol endpoint: premiumsSymbol1M, premiumsSymbol8H](https://www.kucoin.com/docs-new/api-3470220) */ setSymbol(value) { this.obj.symbol = value; return this; } /** * Start time (milliseconds) */ setStartAt(value) { this.obj.startAt = value; return this; } /** * End time (milliseconds) */ setEndAt(value) { this.obj.endAt = value; return this; } /** * This parameter functions to judge whether the lookup is reversed. True means “yes”. False means “no”. This parameter is set as True by default. */ setReverse(value) { this.obj.reverse = value; return this; } /** * Start offset. The unique attribute of the last returned result of the last request. The data of the first page will be returned by default. */ setOffset(value) { this.obj.offset = value; return this; } /** * This parameter functions to judge whether the lookup is forward or not. True means “yes” and False means “no”. This parameter is set as true by default. */ setForward(value) { this.obj.forward = value; return this; } /** * Max. record count. The default record count is 10; the maximum length cannot exceed 100 */ setMaxCount(value) { this.obj.maxCount = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.GetPremiumIndexReqBuilder = GetPremiumIndexReqBuilder; //# sourceMappingURL=model_get_premium_index_req.js.map