UNPKG

kucoin-universal-sdk

Version:
156 lines 4.85 kB
"use strict"; // Code generated by Kucoin Universal SDK Generator; DO NOT EDIT. Object.defineProperty(exports, "__esModule", { value: true }); exports.ModifySubAccountApiReqBuilder = exports.ModifySubAccountApiReq = void 0; const class_transformer_1 = require("class-transformer"); class ModifySubAccountApiReq { /** * 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 = ModifySubAccountApiReq.ExpireEnum._1; // @ts-ignore this.passphrase = null; // @ts-ignore this.subName = null; // @ts-ignore this.apiKey = null; } /** * Creates a new instance of the `ModifySubAccountApiReq` class. * The builder pattern allows step-by-step construction of a `ModifySubAccountApiReq` object. */ static builder() { return new ModifySubAccountApiReqBuilder(new ModifySubAccountApiReq()); } /** * Creates a new instance of the `ModifySubAccountApiReq` class with the given data. */ static create(data) { let obj = new ModifySubAccountApiReq(); obj.passphrase = data.passphrase; 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 = ModifySubAccountApiReq.ExpireEnum._1; } obj.subName = data.subName; obj.apiKey = data.apiKey; 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 ModifySubAccountApiReq(), jsonObject); } } exports.ModifySubAccountApiReq = ModifySubAccountApiReq; (function (ModifySubAccountApiReq) { 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 = ModifySubAccountApiReq.ExpireEnum || (ModifySubAccountApiReq.ExpireEnum = {})); })(ModifySubAccountApiReq || (exports.ModifySubAccountApiReq = ModifySubAccountApiReq = {})); class ModifySubAccountApiReqBuilder { 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; } /** * [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; } /** * API-Key (Sub-account APIKey) */ setApiKey(value) { this.obj.apiKey = value; return this; } /** * Get the final object. */ build() { return this.obj; } } exports.ModifySubAccountApiReqBuilder = ModifySubAccountApiReqBuilder; //# sourceMappingURL=model_modify_sub_account_api_req.js.map