UNPKG

kucoin-universal-sdk

Version:
130 lines 3.6 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.GetPurchaseOrdersReqBuilder = exports.GetPurchaseOrdersReq = void 0; const class_transformer_1 = require("class-transformer"); class GetPurchaseOrdersReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * Current page; default is 1 */ this.currentPage = 1; /** * Page size; 1<=pageSize<=50; default is 50 */ this.pageSize = 50; } /** * Creates a new instance of the `GetPurchaseOrdersReq` class. * The builder pattern allows step-by-step construction of a `GetPurchaseOrdersReq` object. */ static builder() { return new GetPurchaseOrdersReqBuilder(new GetPurchaseOrdersReq()); } /** * Creates a new instance of the `GetPurchaseOrdersReq` class with the given data. */ static create(data) { let obj = new GetPurchaseOrdersReq(); obj.status = data.status; obj.currency = data.currency; obj.purchaseOrderNo = data.purchaseOrderNo; 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 GetPurchaseOrdersReq(), jsonObject); } } exports.GetPurchaseOrdersReq = GetPurchaseOrdersReq; (function (GetPurchaseOrdersReq) { let StatusEnum; (function (StatusEnum) { /** * completed */ StatusEnum[StatusEnum["DONE"] = 'DONE'] = "DONE"; /** * settling */ StatusEnum[StatusEnum["PENDING"] = 'PENDING'] = "PENDING"; })(StatusEnum = GetPurchaseOrdersReq.StatusEnum || (GetPurchaseOrdersReq.StatusEnum = {})); })(GetPurchaseOrdersReq || (exports.GetPurchaseOrdersReq = GetPurchaseOrdersReq = {})); class GetPurchaseOrdersReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * DONE-completed; PENDING-settling */ setStatus(value) { this.obj.status = value; return this; } /** * Currency */ setCurrency(value) { this.obj.currency = value; return this; } /** * Purchase order ID */ setPurchaseOrderNo(value) { this.obj.purchaseOrderNo = value; return this; } /** * Current page; default is 1 */ setCurrentPage(value) { this.obj.currentPage = value; return this; } /** * Page size; 1<=pageSize<=50; default is 50 */ setPageSize(value) { this.obj.pageSize = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.GetPurchaseOrdersReqBuilder = GetPurchaseOrdersReqBuilder; //# sourceMappingURL=model_get_purchase_orders_req.js.map