UNPKG

kucoin-universal-sdk

Version:
150 lines 4.1 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.GetBorrowHistoryReqBuilder = exports.GetBorrowHistoryReq = void 0; const class_transformer_1 = require("class-transformer"); class GetBorrowHistoryReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * true-isolated, false-cross; default is false */ this.isIsolated = false; /** * Current query page, with a starting value of 1. Default:1 */ this.currentPage = 1; /** * Number of results per page. Default is 50, minimum is 10, maximum is 500 */ this.pageSize = 50; } /** * Creates a new instance of the `GetBorrowHistoryReq` class. * The builder pattern allows step-by-step construction of a `GetBorrowHistoryReq` object. */ static builder() { return new GetBorrowHistoryReqBuilder(new GetBorrowHistoryReq()); } /** * Creates a new instance of the `GetBorrowHistoryReq` class with the given data. */ static create(data) { let obj = new GetBorrowHistoryReq(); obj.currency = data.currency; if (data.isIsolated) { obj.isIsolated = data.isIsolated; } else { obj.isIsolated = false; } obj.symbol = data.symbol; obj.orderNo = data.orderNo; obj.startTime = data.startTime; obj.endTime = data.endTime; if (data.currentPage) { obj.currentPage = data.currentPage; } else { obj.currentPage = 1; } if (data.pageSize) { obj.pageSize = data.pageSize; } else { obj.pageSize = 50; } 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 GetBorrowHistoryReq(), jsonObject); } } exports.GetBorrowHistoryReq = GetBorrowHistoryReq; class GetBorrowHistoryReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * currency */ setCurrency(value) { this.obj.currency = value; return this; } /** * true-isolated, false-cross; default is false */ setIsIsolated(value) { this.obj.isIsolated = value; return this; } /** * symbol, mandatory for isolated margin account */ setSymbol(value) { this.obj.symbol = value; return this; } /** * Borrow Order ID */ setOrderNo(value) { this.obj.orderNo = value; return this; } /** * The start and end times are not restricted. If the start time is empty or less than 1680278400000, the default value is set to 1680278400000 (April 1, 2023, 00:00:00) */ setStartTime(value) { this.obj.startTime = value; return this; } /** * End time */ setEndTime(value) { this.obj.endTime = value; return this; } /** * Current query page, with a starting value of 1. Default:1 */ setCurrentPage(value) { this.obj.currentPage = value; return this; } /** * Number of results per page. Default is 50, minimum is 10, maximum is 500 */ setPageSize(value) { this.obj.pageSize = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.GetBorrowHistoryReqBuilder = GetBorrowHistoryReqBuilder; //# sourceMappingURL=model_get_borrow_history_req.js.map