UNPKG

kucoin-universal-sdk

Version:
156 lines 4.78 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.AddSubAccountApiReqBuilder = exports.AddSubAccountApiReq = void 0; const class_transformer_1 = require("class-transformer"); class AddSubAccountApiReq { /** * Private constructor, please use the corresponding static methods to construct the object. */ constructor() { /** * [Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General, Spot, Futures, Margin, InnerTransfer (Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\") */ this.permission = 'General'; /** * API expiration time: Never expire(default)-1, 30Day30, 90Day90, 180Day180, 360Day360 */ this.expire = AddSubAccountApiReq.ExpireEnum._1; // @ts-ignore this.passphrase = null; // @ts-ignore this.remark = null; // @ts-ignore this.subName = null; } /** * Creates a new instance of the `AddSubAccountApiReq` class. * The builder pattern allows step-by-step construction of a `AddSubAccountApiReq` object. */ static builder() { return new AddSubAccountApiReqBuilder(new AddSubAccountApiReq()); } /** * Creates a new instance of the `AddSubAccountApiReq` class with the given data. */ static create(data) { let obj = new AddSubAccountApiReq(); obj.passphrase = data.passphrase; obj.remark = data.remark; if (data.permission) { obj.permission = data.permission; } else { obj.permission = 'General'; } obj.ipWhitelist = data.ipWhitelist; if (data.expire) { obj.expire = data.expire; } else { obj.expire = AddSubAccountApiReq.ExpireEnum._1; } obj.subName = data.subName; 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 AddSubAccountApiReq(), jsonObject); } } exports.AddSubAccountApiReq = AddSubAccountApiReq; (function (AddSubAccountApiReq) { let ExpireEnum; (function (ExpireEnum) { /** * */ ExpireEnum[ExpireEnum["_1"] = '-1'] = "_1"; /** * */ ExpireEnum[ExpireEnum["_30"] = '30'] = "_30"; /** * */ ExpireEnum[ExpireEnum["_90"] = '90'] = "_90"; /** * */ ExpireEnum[ExpireEnum["_180"] = '180'] = "_180"; /** * */ ExpireEnum[ExpireEnum["_360"] = '360'] = "_360"; })(ExpireEnum = AddSubAccountApiReq.ExpireEnum || (AddSubAccountApiReq.ExpireEnum = {})); })(AddSubAccountApiReq || (exports.AddSubAccountApiReq = AddSubAccountApiReq = {})); class AddSubAccountApiReqBuilder { constructor(obj) { this.obj = obj; this.obj = obj; } /** * Password (Must contain 7–32 characters. Cannot contain any spaces.) */ setPassphrase(value) { this.obj.passphrase = value; return this; } /** * Remarks (1–24 characters) */ setRemark(value) { this.obj.remark = value; return this; } /** * [Permissions](https://www.kucoin.com/docs-new/doc-338144)(Only General, Spot, Futures, Margin, InnerTransfer (Flex Transfer) permissions can be set, such as \"General, Trade\". The default is \"General\") */ setPermission(value) { this.obj.permission = value; return this; } /** * IP whitelist (You may add up to 20 IPs. Use a halfwidth comma to each IP) */ setIpWhitelist(value) { this.obj.ipWhitelist = value; return this; } /** * API expiration time: Never expire(default)-1, 30Day30, 90Day90, 180Day180, 360Day360 */ setExpire(value) { this.obj.expire = value; return this; } /** * Sub-account name, create sub account name of API Key. */ setSubName(value) { this.obj.subName = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.AddSubAccountApiReqBuilder = AddSubAccountApiReqBuilder; //# sourceMappingURL=model_add_sub_account_api_req.js.map